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

Commit 8b93b0cb authored by Yan Zhu's avatar Yan Zhu Committed by Android (Google) Code Review
Browse files

Merge "Separate out test for bound widget package from setup"

parents 15cc27f5 df47a146
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.doReturn;
@@ -297,9 +298,6 @@ public class AppStandbyControllerTests {
        mInjector.setDisplayOn(true);
        setChargingState(controller, false);
        controller.checkIdleStates(USER_ID);
        assertEquals(STANDBY_BUCKET_EXEMPTED,
                controller.getAppStandbyBucket(PACKAGE_EXEMPTED_1, USER_ID,
                        mInjector.mElapsedRealtime, false));
        assertNotEquals(STANDBY_BUCKET_EXEMPTED,
                controller.getAppStandbyBucket(PACKAGE_1, USER_ID,
                        mInjector.mElapsedRealtime, false));
@@ -377,6 +375,14 @@ public class AppStandbyControllerTests {
        }
    }

    @Test
    public void testBoundWidgetPackageExempt() throws Exception {
        assumeTrue(mInjector.getContext().getSystemService(AppWidgetManager.class) != null);
        assertEquals(STANDBY_BUCKET_EXEMPTED,
                mController.getAppStandbyBucket(PACKAGE_EXEMPTED_1, USER_ID,
                        mInjector.mElapsedRealtime, false));
    }

    @Test
    public void testCharging() throws Exception {
        long startTime;