Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5e96800 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Fix up the tests (yet again)"

parents 68255423 685db72e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class QSFooter implements OnClickListener, DialogInterface.OnClickListene

    private AlertDialog mDialog;
    private QSTileHost mHost;
    protected Handler mHandler;
    protected H mHandler;

    private boolean mIsVisible;
    private boolean mIsIconVisible;
@@ -83,7 +83,7 @@ public class QSFooter implements OnClickListener, DialogInterface.OnClickListene
        mMainHandler = new Handler(Looper.getMainLooper());
        mActivityStarter = Dependency.get(ActivityStarter.class);
        mSecurityController = Dependency.get(SecurityController.class);
        mHandler = new Handler((Looper) Dependency.get(Dependency.BG_LOOPER));
        mHandler = new H(Dependency.get(Dependency.BG_LOOPER));
    }

    public void setHostEnvironment(QSTileHost host) {
+4 −8
Original line number Diff line number Diff line
@@ -162,6 +162,10 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
        BatteryMeterView battery = (BatteryMeterView) findViewById(R.id.battery);
        int colorSecondary = Utils.getColorAttr(getContext(), android.R.attr.textColorSecondary);
        battery.setRawColors(colorForeground, colorSecondary);

        mNextAlarmController = Dependency.get(NextAlarmController.class);
        mUserInfoController = Dependency.get(UserInfoController.class);
        mActivityStarter = Dependency.get(ActivityStarter.class);
    }

    @Override
@@ -259,14 +263,6 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
        mExpandIndicator.setExpanded(headerExpansionFraction > EXPAND_INDICATOR_THRESHOLD);
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        mNextAlarmController = Dependency.get(NextAlarmController.class);
        mUserInfoController = Dependency.get(UserInfoController.class);
        mActivityStarter = Dependency.get(ActivityStarter.class);
    }

    @Override
    @VisibleForTesting
    public void onDetachedFromWindow() {
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@
    <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" />
    <uses-permission android:name="android.permission.STATUS_BAR_SERVICE" />
    <uses-permission android:name="android.permission.ACCESS_VR_MANAGER" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" />
    <uses-permission android:name="android.permission.MANAGE_NETWORK_POLICY" />

    <application>
        <uses-library android:name="android.test.runner" />
+5 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
package com.android.systemui;

import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -25,6 +26,8 @@ import com.android.systemui.statusbar.policy.FlashlightController;

import org.junit.Test;

import java.io.PrintWriter;

public class DependencyTest extends SysuiTestCase {

    @Test
@@ -46,8 +49,8 @@ public class DependencyTest extends SysuiTestCase {
        Dumpable d = mock(Dumpable.class);
        injectTestDependency("test", d);
        Dependency.get("test");
        mDependency.dump(null, null, null);
        verify(d).dump(eq(null), eq(null), eq(null));
        mDependency.dump(null, mock(PrintWriter.class), null);
        verify(d).dump(eq(null), any(), eq(null));
    }

    @Test
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ public abstract class SysuiTestCase {
    public void SysuiSetup() throws Exception {
        System.setProperty("dexmaker.share_classloader", "true");
        mContext = new TestableContext(InstrumentationRegistry.getTargetContext(), this);
        SystemUIFactory.createFromConfig(mContext);
        mDependency = new TestDependency();
        mDependency.mContext = mContext;
        mDependency.start();
Loading