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

Commit 82fe00fa authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[DO NOT MERGE] Fix DozeScreenBrightnessTest." into sc-dev

parents 3df34b9f 20d85a91
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -301,13 +301,14 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
        when(mWakefulnessLifecycle.getLastSleepReason()).thenReturn(
                PowerManager.GO_TO_SLEEP_REASON_TIMEOUT);
        when(mDozeParameters.shouldControlUnlockedScreenOff()).thenReturn(true);
        when(mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()).thenReturn(true);

        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE);

        // If we're dozing after a timeout, and playing the unlocked screen animation, we should
        // stay at dim brightness, because the screen dims just before timeout.
        assertEquals(mServiceFake.screenBrightness, DIM_BRIGHTNESS);
        // stay at or below dim brightness, because the screen dims just before timeout.
        assertTrue(mServiceFake.screenBrightness <= DIM_BRIGHTNESS);
    }

    @Test
@@ -315,6 +316,7 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
        when(mWakefulnessLifecycle.getLastSleepReason()).thenReturn(
                PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON);
        when(mDozeParameters.shouldControlUnlockedScreenOff()).thenReturn(true);
        when(mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()).thenReturn(true);

        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE);
@@ -329,6 +331,7 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
        when(mWakefulnessLifecycle.getLastSleepReason()).thenReturn(
                PowerManager.GO_TO_SLEEP_REASON_TIMEOUT);
        when(mDozeParameters.shouldControlUnlockedScreenOff()).thenReturn(false);
        when(mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()).thenReturn(false);

        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE);