From 4248780bc67087ee3b0290ce945b8d30e1a30e0d Mon Sep 17 00:00:00 2001 From: Antonella Dellanzo Date: Fri, 13 Nov 2020 14:24:39 +0100 Subject: [PATCH] Add assertions to CloseAppHomeButtonTest Adding all the assertions for the CloseAppHomeButtonTest. This includes WM assertions (the common ones for all test + one that the launcher replaces the app window and another that the wallpaper window becomes visible) and layers assertions (the common ones + one for the wallpaper layer replacing the app layer). Test: atest FlickerTests:CloseAppHomeButtonTest Bug: b/171049778 Change-Id: I179a39914c71049002c987f5543dfa26ea6225f3 --- .../flicker/close/CloseAppHomeButtonTest.kt | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt index b0a1565d9f549..4bbb38c4d71aa 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt @@ -20,12 +20,25 @@ import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry import com.android.server.wm.flicker.Flicker +import com.android.server.wm.flicker.endRotation import com.android.server.wm.flicker.FlickerTestRunnerFactory import com.android.server.wm.flicker.FlickerTestRunner +import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible +import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible +import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible +import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible +import com.android.server.wm.flicker.launcherReplacesAppWindowAsTopWindow +import com.android.server.wm.flicker.wallpaperWindowBecomesVisible +import com.android.server.wm.flicker.wallpaperLayerReplacesAppLayer +import com.android.server.wm.flicker.noUncoveredRegions +import com.android.server.wm.flicker.navBarLayerRotatesAndScales +import com.android.server.wm.flicker.statusBarLayerRotatesScales +import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.helpers.StandardAppHelper 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.helpers.waitUntilGone import com.android.server.wm.flicker.repetitions import com.android.server.wm.flicker.startRotation @@ -77,6 +90,32 @@ class CloseAppHomeButtonTest( testApp.exit() } } + assertions { + windowManagerTrace { + navBarWindowIsAlwaysVisible() + statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry() + + launcherReplacesAppWindowAsTopWindow(testApp) + wallpaperWindowBecomesVisible() + } + + layersTrace { + noUncoveredRegions(configuration.startRotation, + Surface.ROTATION_0, bugId = 141361128) + navBarLayerRotatesAndScales(configuration.startRotation, + Surface.ROTATION_0) + statusBarLayerRotatesScales(configuration.startRotation, + Surface.ROTATION_0) + navBarLayerIsAlwaysVisible( + enabled = Surface.ROTATION_0 == configuration.endRotation) + statusBarLayerIsAlwaysVisible( + enabled = Surface.ROTATION_0 == configuration.endRotation) + visibleLayersShownMoreThanOneConsecutiveEntry() + + wallpaperLayerReplacesAppLayer(testApp) + } + } } } }