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

Commit 4136f92c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Execute flicker tests with device without wallpaper" into tm-dev am:...

Merge "Execute flicker tests with device without wallpaper" into tm-dev am: 759d7606 am: da2bb131

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17745135



Change-Id: Ib9da72a2d34d087401022fe56b97d3a12d38e4a4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 774b3829 da2bb131
Loading
Loading
Loading
Loading
+9 −6
Original line number Original line Diff line number Diff line
@@ -63,8 +63,12 @@ import org.junit.runners.Parameterized
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group4
@Group4
class TaskTransitionTest(val testSpec: FlickerTestParameter) {
class TaskTransitionTest(val testSpec: FlickerTestParameter) {
    val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val mTestApp: NewTasksAppHelper = NewTasksAppHelper(instrumentation)
    private val mTestApp: NewTasksAppHelper = NewTasksAppHelper(instrumentation)
    private val mWallpaper by lazy {
        getWallpaperPackage(InstrumentationRegistry.getInstrumentation())
            ?: error("Unable to obtain wallpaper")
    }


    @FlickerBuilderProvider
    @FlickerBuilderProvider
    fun buildFlicker(): FlickerBuilder {
    fun buildFlicker(): FlickerBuilder {
@@ -97,7 +101,7 @@ class TaskTransitionTest(val testSpec: FlickerTestParameter) {
    @Test
    @Test
    fun wallpaperWindowIsNeverVisible() {
    fun wallpaperWindowIsNeverVisible() {
        testSpec.assertWm {
        testSpec.assertWm {
            this.isNonAppWindowInvisible(WALLPAPER)
            this.isNonAppWindowInvisible(mWallpaper)
        }
        }
    }
    }


@@ -109,7 +113,7 @@ class TaskTransitionTest(val testSpec: FlickerTestParameter) {
    @Test
    @Test
    fun wallpaperLayerIsNeverVisible() {
    fun wallpaperLayerIsNeverVisible() {
        testSpec.assertLayers {
        testSpec.assertLayers {
            this.isInvisible(WALLPAPER)
            this.isInvisible(mWallpaper)
            this.isInvisible(WALLPAPER_BBQ_WRAPPER)
            this.isInvisible(WALLPAPER_BBQ_WRAPPER)
        }
        }
    }
    }
@@ -229,15 +233,14 @@ class TaskTransitionTest(val testSpec: FlickerTestParameter) {
    fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
    fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()


    companion object {
    companion object {
        private val WALLPAPER = getWallpaperPackage(InstrumentationRegistry.getInstrumentation())
        private val LAUNCH_NEW_TASK_ACTIVITY =
        private val LAUNCH_NEW_TASK_ACTIVITY =
                LAUNCH_NEW_TASK_ACTIVITY_COMPONENT_NAME.toFlickerComponent()
                LAUNCH_NEW_TASK_ACTIVITY_COMPONENT_NAME.toFlickerComponent()
        private val SIMPLE_ACTIVITY = SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent()
        private val SIMPLE_ACTIVITY = SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent()


        private fun getWallpaperPackage(instrumentation: Instrumentation): FlickerComponentName {
        private fun getWallpaperPackage(instrumentation: Instrumentation): FlickerComponentName? {
            val wallpaperManager = WallpaperManager.getInstance(instrumentation.targetContext)
            val wallpaperManager = WallpaperManager.getInstance(instrumentation.targetContext)


            return wallpaperManager.wallpaperInfo.component.toFlickerComponent()
            return wallpaperManager.wallpaperInfo?.component?.toFlickerComponent()
        }
        }


        @Parameterized.Parameters(name = "{0}")
        @Parameterized.Parameters(name = "{0}")