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

Commit db45b25e authored by Oleg Petšjonkin's avatar Oleg Petšjonkin Committed by Android (Google) Code Review
Browse files

Merge "Renaming Kotlin tests according to style guide" into main

parents 7ac68008 46cd5a7e
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()