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

Commit 4cb95ca2 authored by Antonella Dellanzo's avatar Antonella Dellanzo
Browse files

Add assertion for OpenAppFromOverview test

Adding the assertions for the test OpenAppFromOverviewTest (wm and layer ones).

Test: atest FlickerTests:OpenAppFromOverviewTest
Bug: b/171049760
Change-Id: I04102fa79cdb33ee228aa5ecefb1f5ea408bf06d
parent 494b0901
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
@@ -22,14 +22,25 @@ import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.Flicker
import com.android.server.wm.flicker.FlickerTestRunnerFactory
import com.android.server.wm.flicker.FlickerTestRunner
import com.android.server.wm.flicker.endRotation
import com.android.server.wm.flicker.focusChanges
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.helpers.StandardAppHelper
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
import com.android.server.wm.flicker.helpers.hasWindow
import com.android.server.wm.flicker.helpers.buildTestTag
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 org.junit.FixMethodOrder
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -78,6 +89,37 @@ class OpenAppFromOverviewTest(
                                this.setRotation(Surface.ROTATION_0)
                            }
                        }
                        assertions {
                            windowManagerTrace {
                                navBarWindowIsAlwaysVisible()
                                statusBarWindowIsAlwaysVisible()
                                visibleWindowsShownMoreThanOneConsecutiveEntry()

                                appWindowReplacesLauncherAsTopWindow(testApp)
                                wallpaperWindowBecomesInvisible()
                            }

                            layersTrace {
                                noUncoveredRegions(Surface.ROTATION_0, configuration.endRotation,
                                        bugId = 141361128)
                                navBarLayerRotatesAndScales(Surface.ROTATION_0,
                                        configuration.endRotation)
                                statusBarLayerRotatesScales(Surface.ROTATION_0,
                                        configuration.endRotation)
                                statusBarLayerIsAlwaysVisible(
                                        enabled = Surface.ROTATION_0 == configuration.endRotation)
                                navBarLayerIsAlwaysVisible(
                                        enabled = Surface.ROTATION_0 == configuration.endRotation)
                                visibleLayersShownMoreThanOneConsecutiveEntry(
                                        enabled = Surface.ROTATION_0 == configuration.endRotation)

                                appLayerReplacesWallpaperLayer(testApp)
                            }

                            eventLog {
                                focusChanges("NexusLauncherActivity", testApp.`package`)
                            }
                        }
                    }
        }
    }