summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-02-09 08:44:56 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-02-09 08:44:56 +0000
commit6a7f2d9e9541bfd0444c0f7a0f16ab88b36bf4cd (patch)
tree4a13d40ac4732873c8cce74a5af2c9ecc938216c
parent9f44d9997c03ba5b6825d06f66a4f1c40c310e36 (diff)
parent524524b6bcd0e19cec52f448a5fbf5d52bbdcf3a (diff)
Merge "Update Close App tests to new DSL format" into sc-dev
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt60
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt57
2 files changed, 76 insertions, 41 deletions
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
index b5fd4a50ae66..c507841ffb71 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
@@ -16,7 +16,6 @@
package com.android.server.wm.flicker.close
-import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.RequiresDevice
import androidx.test.platform.app.InstrumentationRegistry
@@ -50,7 +49,6 @@ import org.junit.runners.Parameterized
* Test app closes by pressing back button
* To run this test: `atest FlickerTests:CloseAppBackButtonTest`
*/
-@Presubmit
@RequiresDevice
@RunWith(Parameterized::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -65,7 +63,7 @@ class CloseAppBackButtonTest(
val testApp = SimpleAppHelper(instrumentation)
return FlickerTestRunnerFactory.getInstance()
.buildTest(instrumentation, repetitions = 5) { configuration ->
- withTestName { buildTestTag("closeAppBackButton", configuration) }
+ withTestName { buildTestTag(configuration) }
repeat { configuration.repetitions }
setup {
test {
@@ -89,29 +87,47 @@ class CloseAppBackButtonTest(
}
}
assertions {
- windowManagerTrace {
- navBarWindowIsAlwaysVisible()
- statusBarWindowIsAlwaysVisible()
- visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173684672)
+ val isRotated = configuration.startRotation.isRotated()
- launcherReplacesAppWindowAsTopWindow(testApp)
- wallpaperWindowBecomesVisible()
+ presubmit {
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ launcherReplacesAppWindowAsTopWindow(testApp)
+ wallpaperWindowBecomesVisible()
+ }
+
+ layersTrace {
+ noUncoveredRegions(configuration.startRotation,
+ Surface.ROTATION_0)
+ navBarLayerIsAlwaysVisible()
+ statusBarLayerIsAlwaysVisible()
+ wallpaperLayerReplacesAppLayer(testApp)
+
+ if (!isRotated) {
+ navBarLayerRotatesAndScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ statusBarLayerRotatesScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ }
+ }
}
- layersTrace {
- noUncoveredRegions(configuration.startRotation,
- Surface.ROTATION_0)
- navBarLayerRotatesAndScales(configuration.startRotation,
- Surface.ROTATION_0,
- enabled = !configuration.startRotation.isRotated())
- statusBarLayerRotatesScales(configuration.startRotation,
- Surface.ROTATION_0,
- enabled = !configuration.startRotation.isRotated())
- navBarLayerIsAlwaysVisible()
- statusBarLayerIsAlwaysVisible()
- visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173684672)
+ flaky {
+ windowManagerTrace {
+ visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173684672)
+ }
+
+ layersTrace {
+ visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173684672)
- wallpaperLayerReplacesAppLayer(testApp)
+ if (isRotated) {
+ navBarLayerRotatesAndScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ statusBarLayerRotatesScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ }
+ }
}
}
}
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 584e4b16fab7..d1c3efe35c54 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
@@ -37,6 +37,7 @@ import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEn
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.helpers.buildTestTag
+import com.android.server.wm.flicker.helpers.isRotated
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
@@ -64,7 +65,7 @@ class CloseAppHomeButtonTest(
val testApp = SimpleAppHelper(instrumentation)
return FlickerTestRunnerFactory.getInstance()
.buildTest(instrumentation, repetitions = 5) { configuration ->
- withTestName { buildTestTag("closeAppHomeButton", configuration) }
+ withTestName { buildTestTag(configuration) }
repeat { configuration.repetitions }
setup {
test {
@@ -88,28 +89,46 @@ class CloseAppHomeButtonTest(
}
}
assertions {
- windowManagerTrace {
- navBarWindowIsAlwaysVisible()
- statusBarWindowIsAlwaysVisible()
- visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173689015)
+ val isRotated = configuration.startRotation.isRotated()
- launcherReplacesAppWindowAsTopWindow(testApp)
- wallpaperWindowBecomesVisible()
+ presubmit {
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ launcherReplacesAppWindowAsTopWindow(testApp)
+ wallpaperWindowBecomesVisible()
+ }
+
+ layersTrace {
+ noUncoveredRegions(configuration.startRotation,
+ Surface.ROTATION_0)
+ navBarLayerIsAlwaysVisible()
+ statusBarLayerIsAlwaysVisible()
+ wallpaperLayerReplacesAppLayer(testApp)
+
+ if (!isRotated) {
+ navBarLayerRotatesAndScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ statusBarLayerRotatesScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ }
+ }
}
- layersTrace {
- val isRotation0 = configuration.startRotation == Surface.ROTATION_0
- noUncoveredRegions(configuration.startRotation,
- Surface.ROTATION_0)
- navBarLayerRotatesAndScales(configuration.startRotation,
- Surface.ROTATION_0, enabled = isRotation0)
- statusBarLayerRotatesScales(configuration.startRotation,
- Surface.ROTATION_0, enabled = isRotation0)
- navBarLayerIsAlwaysVisible()
- statusBarLayerIsAlwaysVisible()
- visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173689015)
+ flaky {
+ windowManagerTrace {
+ visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173689015)
+ }
+ layersTrace {
+ visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173689015)
- wallpaperLayerReplacesAppLayer(testApp)
+ if (isRotated) {
+ navBarLayerRotatesAndScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ statusBarLayerRotatesScales(configuration.startRotation,
+ Surface.ROTATION_0)
+ }
+ }
}
}
}