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

Commit 46cd5a7e authored by petsjonkin's avatar petsjonkin
Browse files

Renaming Kotlin tests according to style guide

Package: com.android.server.display

Bug: b/364026442
Test: atest com.android.server.display
Flag: EXEMPT test only
Change-Id: I04560ffcb7da5f7b8be1cc10b03333fe6d219b37
parent 8755f8ea
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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,
+4 −4
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ class DisplayPowerStateTest {
    }

    @Test
    fun `destroys ColorFade on stop`() {
    fun destroysColorFadeOnStop() {
        displayPowerState.stop()
        val runnableCaptor = argumentCaptor<Runnable>()

@@ -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)

@@ -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()