[DO NOT MERGE] Fix DozeScreenBrightnessTest. am: 20d85a91d4 am: ba860f3f98
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15994907 Change-Id: Ibed65a17e425af06caf6a2b1d383344f1ae418ab
This commit is contained in:
@@ -319,13 +319,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
|
||||
@@ -333,6 +334,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);
|
||||
@@ -347,6 +349,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);
|
||||
|
||||
Reference in New Issue
Block a user