Loading services/tests/displayservicetests/src/com/android/server/display/BrightnessRangeControllerTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -42,31 +42,31 @@ class BrightnessRangeControllerTest { private val mockToken = mock<IBinder>() @Test fun `returns HBC max brightness if HBM supported and ON`() { fun testMaxBrightness_HbmSupportedAndOn() { val controller = createController() assertThat(controller.currentBrightnessMax).isEqualTo(MAX_BRIGHTNESS) } @Test fun `returns NBC max brightness if device does not support HBM`() { fun testMaxBrightness_HbmNotSupported() { val controller = createController(hbmSupported = false) assertThat(controller.currentBrightnessMax).isEqualTo(NORMAL_BRIGHTNESS_LOW) } @Test fun `returns NBC max brightness if HBM not allowed`() { fun testMaxBrightness_HbmNotAllowed() { val controller = createController(hbmAllowed = false) assertThat(controller.currentBrightnessMax).isEqualTo(NORMAL_BRIGHTNESS_LOW) } @Test fun `returns HBC max brightness if NBM is disabled`() { fun testMaxBrightness_HbmDisabledAndNotAllowed() { val controller = createController(nbmEnabled = false, hbmAllowed = false) assertThat(controller.currentBrightnessMax).isEqualTo(MAX_BRIGHTNESS) } @Test fun `returns HBC max brightness if lower than NBC max brightness`() { fun testMaxBrightness_transitionPointLessThanCurrentNbmLimit() { val controller = createController( hbmAllowed = false, hbmMaxBrightness = TRANSITION_POINT, Loading services/tests/displayservicetests/src/com/android/server/display/DisplayPowerStateTest.kt +4 −4 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class DisplayPowerStateTest { } @Test fun `destroys ColorFade on stop`() { fun destroysColorFadeOnStop() { displayPowerState.stop() val runnableCaptor = argumentCaptor<Runnable>() Loading @@ -71,13 +71,13 @@ class DisplayPowerStateTest { } @Test fun `GIVEN not prepared WHEN draw runnable is called THEN colorFade not drawn`() { fun testColorFadeDraw_notPrepared() { displayPowerState.mColorFadeDrawRunnable.run() verify(mockColorFade, never()).draw(anyFloat()) } @Test fun `GIVEN prepared WHEN draw runnable is called THEN colorFade is drawn`() { fun testColorFadeDraw_prepared() { displayPowerState.prepareColorFade(mockContext, ColorFade.MODE_FADE) clearInvocations(mockColorFade) Loading @@ -87,7 +87,7 @@ class DisplayPowerStateTest { } @Test fun `GIVEN prepared AND stopped WHEN draw runnable is called THEN colorFade is not drawn`() { fun testColorFadeDraw_preparedAndStopped() { displayPowerState.prepareColorFade(mockContext, ColorFade.MODE_FADE) clearInvocations(mockColorFade) displayPowerState.stop() Loading Loading
services/tests/displayservicetests/src/com/android/server/display/BrightnessRangeControllerTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -42,31 +42,31 @@ class BrightnessRangeControllerTest { private val mockToken = mock<IBinder>() @Test fun `returns HBC max brightness if HBM supported and ON`() { fun testMaxBrightness_HbmSupportedAndOn() { val controller = createController() assertThat(controller.currentBrightnessMax).isEqualTo(MAX_BRIGHTNESS) } @Test fun `returns NBC max brightness if device does not support HBM`() { fun testMaxBrightness_HbmNotSupported() { val controller = createController(hbmSupported = false) assertThat(controller.currentBrightnessMax).isEqualTo(NORMAL_BRIGHTNESS_LOW) } @Test fun `returns NBC max brightness if HBM not allowed`() { fun testMaxBrightness_HbmNotAllowed() { val controller = createController(hbmAllowed = false) assertThat(controller.currentBrightnessMax).isEqualTo(NORMAL_BRIGHTNESS_LOW) } @Test fun `returns HBC max brightness if NBM is disabled`() { fun testMaxBrightness_HbmDisabledAndNotAllowed() { val controller = createController(nbmEnabled = false, hbmAllowed = false) assertThat(controller.currentBrightnessMax).isEqualTo(MAX_BRIGHTNESS) } @Test fun `returns HBC max brightness if lower than NBC max brightness`() { fun testMaxBrightness_transitionPointLessThanCurrentNbmLimit() { val controller = createController( hbmAllowed = false, hbmMaxBrightness = TRANSITION_POINT, Loading
services/tests/displayservicetests/src/com/android/server/display/DisplayPowerStateTest.kt +4 −4 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class DisplayPowerStateTest { } @Test fun `destroys ColorFade on stop`() { fun destroysColorFadeOnStop() { displayPowerState.stop() val runnableCaptor = argumentCaptor<Runnable>() Loading @@ -71,13 +71,13 @@ class DisplayPowerStateTest { } @Test fun `GIVEN not prepared WHEN draw runnable is called THEN colorFade not drawn`() { fun testColorFadeDraw_notPrepared() { displayPowerState.mColorFadeDrawRunnable.run() verify(mockColorFade, never()).draw(anyFloat()) } @Test fun `GIVEN prepared WHEN draw runnable is called THEN colorFade is drawn`() { fun testColorFadeDraw_prepared() { displayPowerState.prepareColorFade(mockContext, ColorFade.MODE_FADE) clearInvocations(mockColorFade) Loading @@ -87,7 +87,7 @@ class DisplayPowerStateTest { } @Test fun `GIVEN prepared AND stopped WHEN draw runnable is called THEN colorFade is not drawn`() { fun testColorFadeDraw_preparedAndStopped() { displayPowerState.prepareColorFade(mockContext, ColorFade.MODE_FADE) clearInvocations(mockColorFade) displayPowerState.stop() Loading