From 4503f978aa990b599d91acc38de476275ac856a9 Mon Sep 17 00:00:00 2001 From: Antonella Dellanzo Date: Thu, 5 Nov 2020 17:08:31 +0000 Subject: [PATCH] Updating SeamlessAppRotation test Updating the SeamlessAppRotationTest WM and layer assertions (adding new ones). Test: atest FlickerTests:SeamlessAppRotationTest Bug: b/171049719 Change-Id: I7c6f88088ad1c357f163ffb0126cdc921217ccb3 --- .../server/wm/flicker/CommonAssertions.kt | 20 +++++++++++++++++++ .../rotation/SeamlessAppRotationTest.kt | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt index 12cec8d4b6e28..a85e92c920939 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt @@ -79,6 +79,16 @@ fun WmAssertion.wallpaperWindowBecomesVisible( } } +fun WmAssertion.windowAlwaysVisible( + packageName: String, + bugId: Int = 0, + enabled: Boolean = bugId == 0 +) { + all("windowAlwaysVisible", bugId, enabled) { + this.showsAppWindowOnTop(packageName) + } +} + @JvmOverloads fun LayersAssertion.noUncoveredRegions( beginRotation: Int, @@ -214,6 +224,16 @@ fun LayersAssertion.wallpaperLayerReplacesAppLayer( } } +fun LayersAssertion.layerAlwaysVisible( + packageName: String, + bugId: Int = 0, + enabled: Boolean = bugId == 0 +) { + all("layerAlwaysVisible", bugId, enabled) { + this.showsLayer(packageName) + } +} + fun EventLogAssertion.focusChanges( vararg windows: String, bugId: Int = 0, diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt index d100383bc9f72..a1a7102f71e67 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt @@ -30,6 +30,8 @@ import com.android.server.wm.flicker.FlickerTestRunner import com.android.server.wm.flicker.FlickerTestRunnerFactory import com.android.server.wm.flicker.endRotation import com.android.server.wm.flicker.focusDoesNotChange +import com.android.server.wm.flicker.windowAlwaysVisible +import com.android.server.wm.flicker.layerAlwaysVisible import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.flicker.helpers.buildTestTag import com.android.server.wm.flicker.helpers.setRotation @@ -39,6 +41,8 @@ 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.visibleWindowsShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.repetitions import com.android.server.wm.flicker.startRotation import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible @@ -141,6 +145,8 @@ class SeamlessAppRotationTest( windowManagerTrace { navBarWindowIsAlwaysVisible(bugId = 140855415) statusBarWindowIsAlwaysVisible(bugId = 140855415) + visibleWindowsShownMoreThanOneConsecutiveEntry() + windowAlwaysVisible(configuration.intentPackageName) } layersTrace { @@ -152,6 +158,9 @@ class SeamlessAppRotationTest( configuration.endRotation) statusBarLayerRotatesScales(configuration.startRotation, configuration.endRotation, enabled = false) + visibleLayersShownMoreThanOneConsecutiveEntry( + enabled = configuration.startRotation == configuration.endRotation) + layerAlwaysVisible(configuration.intentPackageName) } layersTrace {