summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Antonella Dellanzo <adellanzo@google.com> 2020-10-23 14:36:29 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-10-23 14:36:29 +0000
commit527e407e2fb83f08bdf54937c4cb60c3bddd541d (patch)
treebb1e0417bbda9c78d861594ec781dc8033d03225
parentfdaa88758151a635c6194324de053b350c90e846 (diff)
parenta1d07a8c4fbfe2c9dd42267b9a93f710e17dd03a (diff)
Merge "Fix NavBar & StatusBar layer always visible assertion"
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt30
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt8
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt6
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppColdTest.kt9
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt9
5 files changed, 47 insertions, 15 deletions
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 8457039e0399..58b3992b2244 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
@@ -77,21 +77,43 @@ fun LayersAssertion.noUncoveredRegions(
@JvmOverloads
fun LayersAssertion.navBarLayerIsAlwaysVisible(
+ rotatesScreen: Boolean = false,
bugId: Int = 0,
enabled: Boolean = bugId == 0
) {
- all("navBarLayerIsAlwaysVisible", enabled, bugId) {
- this.showsLayer(NAVIGATION_BAR_WINDOW_TITLE)
+ if (rotatesScreen) {
+ all("navBarLayerIsAlwaysVisible", enabled, bugId) {
+ this.showsLayer(NAVIGATION_BAR_WINDOW_TITLE)
+ .then()
+ .hidesLayer(NAVIGATION_BAR_WINDOW_TITLE)
+ .then()
+ .showsLayer(NAVIGATION_BAR_WINDOW_TITLE)
+ }
+ } else {
+ all("navBarLayerIsAlwaysVisible", enabled, bugId) {
+ this.showsLayer(NAVIGATION_BAR_WINDOW_TITLE)
+ }
}
}
@JvmOverloads
fun LayersAssertion.statusBarLayerIsAlwaysVisible(
+ rotatesScreen: Boolean = false,
bugId: Int = 0,
enabled: Boolean = bugId == 0
) {
- all("statusBarLayerIsAlwaysVisible", enabled, bugId) {
- this.showsLayer(STATUS_BAR_WINDOW_TITLE)
+ if (rotatesScreen) {
+ all("statusBarLayerIsAlwaysVisible", enabled, bugId) {
+ this.showsLayer(STATUS_BAR_WINDOW_TITLE)
+ .then()
+ hidesLayer(STATUS_BAR_WINDOW_TITLE)
+ .then()
+ .showsLayer(STATUS_BAR_WINDOW_TITLE)
+ }
+ } else {
+ all("statusBarLayerIsAlwaysVisible", enabled, bugId) {
+ this.showsLayer(STATUS_BAR_WINDOW_TITLE)
+ }
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
index 76478025ee63..992493143179 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
@@ -43,7 +43,7 @@ import org.junit.runners.Parameterized
/**
* Test IME window closing back to app window transitions.
- * To run this test: `atest FlickerTests:CloseImeWindowToAppTest`
+ * To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToHomeTest`
*/
@Presubmit
@RequiresDevice
@@ -94,14 +94,16 @@ class CloseImeAutoOpenWindowToHomeTest(
}
layersTrace {
- navBarLayerIsAlwaysVisible(bugId = 140855415)
- statusBarLayerIsAlwaysVisible(bugId = 140855415)
noUncoveredRegions(configuration.startRotation, Surface.ROTATION_0,
allStates = false)
navBarLayerRotatesAndScales(configuration.startRotation,
Surface.ROTATION_0, bugId = 140855415)
statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0)
+ navBarLayerIsAlwaysVisible(configuration.startRotation !=
+ Surface.ROTATION_0)
+ statusBarLayerIsAlwaysVisible(configuration.startRotation !=
+ Surface.ROTATION_0)
imeLayerBecomesInvisible(bugId = 141458352)
imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
index 6cfb28202b39..46f584b51e8c 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
@@ -100,14 +100,16 @@ class CloseImeWindowToHomeTest(
}
layersTrace {
- navBarLayerIsAlwaysVisible(bugId = 140855415)
- statusBarLayerIsAlwaysVisible(bugId = 140855415)
noUncoveredRegions(configuration.startRotation,
Surface.ROTATION_0, allStates = false)
navBarLayerRotatesAndScales(configuration.startRotation,
Surface.ROTATION_0, bugId = 140855415)
statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0)
+ navBarLayerIsAlwaysVisible(configuration.startRotation !=
+ Surface.ROTATION_0)
+ statusBarLayerIsAlwaysVisible(configuration.startRotation !=
+ Surface.ROTATION_0)
imeLayerBecomesInvisible(bugId = 153739621)
imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppColdTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppColdTest.kt
index 1081414e9b6b..1194933ee315 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppColdTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppColdTest.kt
@@ -87,6 +87,7 @@ class OpenAppColdTest(
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+
appWindowReplacesLauncherAsTopWindow(testApp)
wallpaperWindowBecomesInvisible()
}
@@ -99,9 +100,11 @@ class OpenAppColdTest(
configuration.endRotation)
statusBarLayerRotatesScales(Surface.ROTATION_0,
configuration.endRotation)
- navBarLayerIsAlwaysVisible(
- enabled = configuration.endRotation == Surface.ROTATION_0)
- statusBarLayerIsAlwaysVisible(enabled = false)
+ navBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
+ configuration.endRotation)
+ statusBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
+ configuration.endRotation)
+
wallpaperLayerBecomesInvisible(testApp)
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt
index 2061994b57b1..136be29e421d 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt
@@ -91,6 +91,7 @@ class OpenAppWarmTest(
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+
appWindowReplacesLauncherAsTopWindow(testApp)
wallpaperWindowBecomesInvisible(enabled = false)
}
@@ -103,9 +104,11 @@ class OpenAppWarmTest(
configuration.endRotation)
statusBarLayerRotatesScales(Surface.ROTATION_0,
configuration.endRotation)
- navBarLayerIsAlwaysVisible(
- enabled = configuration.endRotation == Surface.ROTATION_0)
- statusBarLayerIsAlwaysVisible(enabled = false)
+ navBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
+ configuration.endRotation)
+ statusBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
+ configuration.endRotation)
+
wallpaperLayerBecomesInvisible(testApp)
}