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

Commit b7138470 authored by Nataniel Borges's avatar Nataniel Borges Committed by Android (Google) Code Review
Browse files

Merge "Generalize rotation transition" into sc-dev

parents 8767b883 b4252090
Loading
Loading
Loading
Loading
+0 −74
Original line number Diff line number Diff line
@@ -17,25 +17,12 @@
package com.android.server.wm.flicker.rotation

import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.endRotation
import com.android.server.wm.flicker.focusDoesNotChange
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.statusBarLayerRotatesScales
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -64,24 +51,6 @@ class ChangeAppRotationTest(
            }
        }

    @Presubmit
    @Test
    fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()

    @Presubmit
    @Test
    fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()

    @Presubmit
    @Test
    fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry()

    @Presubmit
    @Test
    fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
        testSpec.config.endRotation, allStates = false)

    @Presubmit
    @Test
    fun screenshotLayerBecomesInvisible() {
@@ -94,49 +63,6 @@ class ChangeAppRotationTest(
        }
    }

    @FlakyTest(bugId = 140855415)
    @Test
    fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()

    @FlakyTest(bugId = 140855415)
    @Test
    fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()

    @FlakyTest(bugId = 140855415)
    @Test
    fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales(
        testSpec.config.startRotation, testSpec.config.endRotation)

    @FlakyTest(bugId = 140855415)
    @Test
    fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales(
        testSpec.config.startRotation, testSpec.config.endRotation)

    @FlakyTest(bugId = 140855415)
    @Test
    fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry()

    @FlakyTest(bugId = 140855415)
    @Test
    fun appLayerRotates_StartingPos() {
        testSpec.assertLayersStart {
            this.coversExactly(startingPos, testApp.getPackage())
        }
    }

    @FlakyTest(bugId = 140855415)
    @Test
    fun appLayerRotates_EndingPos() {
        testSpec.assertLayersEnd {
            this.coversExactly(endingPos, testApp.getPackage())
        }
    }

    @FlakyTest(bugId = 151179149)
    @Test
    fun focusDoesNotChange() = testSpec.focusDoesNotChange()

    companion object {
        private const val SCREENSHOT_LAYER = "RotationLayer"

+91 −0
Original line number Diff line number Diff line
@@ -17,17 +17,30 @@
package com.android.server.wm.flicker.rotation

import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.endRotation
import com.android.server.wm.flicker.focusDoesNotChange
import com.android.server.wm.flicker.helpers.StandardAppHelper
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.statusBarLayerRotatesScales
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import org.junit.Test

abstract class RotationTransition(protected val testSpec: FlickerTestParameter) {
    protected abstract val testApp: StandardAppHelper
@@ -63,4 +76,82 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
            transition(testSpec.config)
        }
    }

    @Presubmit
    @Test
    open fun navBarWindowIsAlwaysVisible() {
        testSpec.navBarWindowIsAlwaysVisible()
    }

    @FlakyTest(bugId = 140855415)
    @Test
    open fun navBarLayerIsAlwaysVisible() {
        testSpec.navBarLayerIsAlwaysVisible()
    }

    @FlakyTest(bugId = 140855415)
    @Test
    open fun navBarLayerRotatesAndScales() {
        testSpec.navBarLayerRotatesAndScales(
            testSpec.config.startRotation, testSpec.config.endRotation)
    }

    @Presubmit
    @Test
    open fun statusBarWindowIsAlwaysVisible() {
        testSpec.statusBarWindowIsAlwaysVisible()
    }

    @FlakyTest(bugId = 140855415)
    @Test
    open fun statusBarLayerIsAlwaysVisible() {
        testSpec.statusBarLayerIsAlwaysVisible()
    }

    @FlakyTest(bugId = 140855415)
    @Test
    open fun statusBarLayerRotatesScales() {
        testSpec.statusBarLayerRotatesScales(
            testSpec.config.startRotation, testSpec.config.endRotation)
    }

    @FlakyTest(bugId = 140855415)
    @Test
    open fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry()

    @Presubmit
    @Test
    open fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry()
    }

    @Presubmit
    @Test
    open fun noUncoveredRegions() {
        testSpec.noUncoveredRegions(testSpec.config.startRotation,
            testSpec.config.endRotation, allStates = false)
    }

    @FlakyTest(bugId = 151179149)
    @Test
    open fun focusDoesNotChange() {
        testSpec.focusDoesNotChange()
    }

    @FlakyTest(bugId = 140855415)
    @Test
    open fun appLayerRotates_StartingPos() {
        testSpec.assertLayersStart {
            this.coversExactly(startingPos, testApp.getPackage())
        }
    }

    @FlakyTest(bugId = 140855415)
    @Test
    open fun appLayerRotates_EndingPos() {
        testSpec.assertLayersEnd {
            this.coversExactly(endingPos, testApp.getPackage())
        }
    }
}
 No newline at end of file
+7 −52
Original line number Diff line number Diff line
@@ -24,21 +24,9 @@ import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.appWindowAlwaysVisibleOnTop
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.endRotation
import com.android.server.wm.flicker.focusDoesNotChange
import com.android.server.wm.flicker.helpers.SeamlessRotationAppHelper
import com.android.server.wm.flicker.layerAlwaysVisible
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.statusBarLayerRotatesScales
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.testapp.ActivityOptions
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -71,54 +59,25 @@ class SeamlessAppRotationTest(
            }
        }

    @Presubmit
    @Test
    fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry()

    @Presubmit
    @Test
    fun appWindowAlwaysVisibleOnTop() = testSpec.appWindowAlwaysVisibleOnTop(testApp.`package`)

    @Presubmit
    @Test
    fun layerAlwaysVisible() = testSpec.layerAlwaysVisible(testApp.`package`)

    @FlakyTest(bugId = 140855415)
    @Test
    fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    @FlakyTest(bugId = 140855415)
    @Test
    fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()

    @FlakyTest(bugId = 140855415)
    @Test
    fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()

    @FlakyTest(bugId = 140855415)
    @Test
    fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
    override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()

    @FlakyTest(bugId = 147659548)
    @Test
    fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
        testSpec.config.endRotation, allStates = false)

    @FlakyTest
    @Test
    fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales(
        testSpec.config.startRotation, testSpec.config.endRotation)
    override fun noUncoveredRegions() = super.noUncoveredRegions()

    @FlakyTest
    @Presubmit
    @Test
    fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales(
        testSpec.config.startRotation, testSpec.config.endRotation)
    fun appWindowAlwaysVisibleOnTop() = testSpec.appWindowAlwaysVisibleOnTop(testApp.`package`)

    @FlakyTest
    @Presubmit
    @Test
    fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry()
    fun layerAlwaysVisible() = testSpec.layerAlwaysVisible(testApp.`package`)

    @FlakyTest(bugId = 147659548)
    @Test
@@ -128,10 +87,6 @@ class SeamlessAppRotationTest(
        }
    }

    @FlakyTest(bugId = 151179149)
    @Test
    fun focusDoesNotChange() = testSpec.focusDoesNotChange()

    companion object {
        private val testFactory = FlickerTestParameterFactory.getInstance()