summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nataniel Borges <natanieljr@google.com> 2022-12-15 13:29:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-12-15 13:29:55 +0000
commitbbfc607211ae2d58bfb9b2a008ec1f304088931a (patch)
tree8239b91f3b7a5c123e2c75c8a4481afa372b6c01
parentc9f75fda7430e95d721953f63d443aa544c2dde1 (diff)
parentdb02059f6a3420faf9ae5e206a8f715b5d458e50 (diff)
Merge "Compatibilize app close tests with ARM CF"
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt35
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt4
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt4
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest_ShellTransit.kt13
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt5
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt5
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt5
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt5
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest_ShellTransit.kt14
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest_ShellTransit.kt14
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchFromLauncherTest.kt12
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt2
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt23
13 files changed, 60 insertions, 81 deletions
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt
index a4609f7510e3..948288a1fc67 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/BaseTest.kt
@@ -18,12 +18,14 @@ package com.android.server.wm.flicker
import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
+import android.util.Log
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.tapl.LauncherInstrumentation
import com.android.server.wm.flicker.junit.FlickerBuilderProvider
import com.android.server.wm.traces.common.ComponentNameMatcher
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import org.junit.Assume
+import org.junit.AssumptionViolatedException
import org.junit.Test
/**
@@ -48,6 +50,8 @@ constructor(
tapl.setExpectedRotationCheckEnabled(true)
}
+ private val logTag = this::class.java.simpleName
+
/** Specification of the test transition to execute */
abstract val transition: FlickerBuilder.() -> Unit
@@ -100,10 +104,24 @@ constructor(
@Test
open fun navBarWindowIsAlwaysVisible() {
Assume.assumeFalse(flicker.scenario.isTablet)
+ Assume.assumeFalse(flicker.scenario.isLandscapeOrSeascapeAtStart)
flicker.navBarWindowIsAlwaysVisible()
}
/**
+ * Checks that the [ComponentNameMatcher.NAV_BAR] window is visible at the start and end of
+ * the transition
+ *
+ * Note: Phones only
+ */
+ @Presubmit
+ @Test
+ open fun navBarWindowIsVisibleAtStartAndEnd() {
+ Assume.assumeFalse(flicker.scenario.isTablet)
+ flicker.navBarWindowIsVisibleAtStartAndEnd()
+ }
+
+ /**
* Checks that the [ComponentNameMatcher.TASK_BAR] window is visible at the start and end of the
* transition
*
@@ -179,13 +197,18 @@ constructor(
statusBarWindowIsAlwaysVisible()
visibleLayersShownMoreThanOneConsecutiveEntry()
visibleWindowsShownMoreThanOneConsecutiveEntry()
+ runAndIgnoreAssumptionViolation { taskBarLayerIsVisibleAtStartAndEnd() }
+ runAndIgnoreAssumptionViolation { taskBarWindowIsAlwaysVisible() }
+ runAndIgnoreAssumptionViolation { navBarLayerIsVisibleAtStartAndEnd() }
+ runAndIgnoreAssumptionViolation { navBarWindowIsAlwaysVisible() }
+ runAndIgnoreAssumptionViolation { navBarWindowIsVisibleAtStartAndEnd() }
+ }
- if (flicker.scenario.isTablet) {
- taskBarLayerIsVisibleAtStartAndEnd()
- taskBarWindowIsAlwaysVisible()
- } else {
- navBarLayerIsVisibleAtStartAndEnd()
- navBarWindowIsAlwaysVisible()
+ protected fun runAndIgnoreAssumptionViolation(predicate: () -> Unit) {
+ try {
+ predicate()
+ } catch (e: AssumptionViolatedException) {
+ Log.e(logTag, "Assumption violation on CUJ complete", e)
}
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
index ca4c6a39687f..098c082552bc 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
@@ -106,12 +106,10 @@ class CloseImeWindowToAppTest(flicker: FlickerTest) : BaseTest(flicker) {
@IwTest(focusArea = "ime")
override fun cujCompleted() {
super.cujCompleted()
- if (!flicker.scenario.isTablet) {
- navBarLayerPositionAtStartAndEnd()
- }
imeLayerBecomesInvisible()
imeAppLayerIsAlwaysVisible()
imeAppWindowIsAlwaysVisible()
+ runAndIgnoreAssumptionViolation { navBarLayerPositionAtStartAndEnd() }
}
companion object {
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 730c4f5e8d27..f110e54b9ced 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
@@ -104,13 +104,11 @@ class CloseImeWindowToHomeTest(flicker: FlickerTest) : BaseTest(flicker) {
@IwTest(focusArea = "ime")
override fun cujCompleted() {
super.cujCompleted()
- if (!flicker.scenario.isTablet) {
- navBarLayerPositionAtStartAndEnd()
- }
imeLayerBecomesInvisible()
imeAppWindowBecomesInvisible()
imeWindowBecomesInvisible()
imeLayerBecomesInvisible()
+ runAndIgnoreAssumptionViolation { navBarLayerPositionAtStartAndEnd() }
}
companion object {
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest_ShellTransit.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest_ShellTransit.kt
index c599b10e0084..e297e893d6d1 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest_ShellTransit.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest_ShellTransit.kt
@@ -21,8 +21,6 @@ import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerTest
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
-import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
-import com.android.server.wm.traces.common.ComponentNameMatcher
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
@@ -68,15 +66,4 @@ class SwitchImeWindowsFromGestureNavTest_ShellTransit(flicker: FlickerTest) :
@Ignore("Nav bar window becomes invisible during quick switch")
@Test
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
-
- /**
- * Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the
- * start and end of the WM trace
- */
- @Presubmit
- @Test
- fun navBarWindowIsVisibleAtStartAndEnd() {
- Assume.assumeFalse(flicker.scenario.isTablet)
- flicker.navBarWindowIsVisibleAtStartAndEnd()
- }
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt
index f5f71904f092..26898f8b3ae6 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt
@@ -89,6 +89,11 @@ open class OpenAppFromLockNotificationCold(flicker: FlickerTest) :
override fun statusBarLayerIsVisibleAtStartAndEnd() =
super.statusBarLayerIsVisibleAtStartAndEnd()
+ /** {@inheritDoc} */
+ @Test
+ @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end")
+ override fun navBarWindowIsVisibleAtStartAndEnd() = super.navBarWindowIsVisibleAtStartAndEnd()
+
/**
* Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the
* transition
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt
index fe49c61049c9..c44ad83755f8 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt
@@ -112,6 +112,11 @@ class OpenAppFromLockNotificationWarm(flicker: FlickerTest) : OpenAppFromNotific
/** {@inheritDoc} */
@Test
@Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end")
+ override fun navBarWindowIsVisibleAtStartAndEnd() = super.navBarWindowIsVisibleAtStartAndEnd()
+
+ /** {@inheritDoc} */
+ @Test
+ @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end")
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
/** {@inheritDoc} */
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt
index d9a3ad2b3d6d..e3ffb45dbf42 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt
@@ -109,6 +109,11 @@ class OpenAppFromLockNotificationWithLockOverlayApp(flicker: FlickerTest) :
@Test
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 209599395)
+ @Test
+ override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt
index f295ce30978b..142c6888e776 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt
@@ -146,6 +146,11 @@ open class OpenAppNonResizeableTest(flicker: FlickerTest) : OpenAppFromLockTrans
/** {@inheritDoc} */
@Test
+ @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end")
+ override fun navBarWindowIsVisibleAtStartAndEnd() = super.navBarWindowIsVisibleAtStartAndEnd()
+
+ /** {@inheritDoc} */
+ @Test
@Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end")
override fun statusBarWindowIsAlwaysVisible() {}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest_ShellTransit.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest_ShellTransit.kt
index ec4e35c0f9dd..6dc11b5de1f2 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest_ShellTransit.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest_ShellTransit.kt
@@ -17,13 +17,10 @@
package com.android.server.wm.flicker.quickswitch
import android.platform.test.annotations.FlakyTest
-import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerTest
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
-import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
-import com.android.server.wm.traces.common.ComponentNameMatcher
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
@@ -61,17 +58,6 @@ open class QuickSwitchBetweenTwoAppsBackTest_ShellTransit(flicker: FlickerTest)
@Test
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
- /**
- * Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the
- * start and end of the WM trace
- */
- @Presubmit
- @Test
- fun navBarWindowIsVisibleAtStartAndEnd() {
- Assume.assumeFalse(flicker.scenario.isTablet)
- flicker.navBarWindowIsVisibleAtStartAndEnd()
- }
-
/** {@inheritDoc} */
@FlakyTest(bugId = 250520840)
@Test
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest_ShellTransit.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest_ShellTransit.kt
index 477b41973454..5a78868a8a05 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest_ShellTransit.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest_ShellTransit.kt
@@ -17,13 +17,10 @@
package com.android.server.wm.flicker.quickswitch
import android.platform.test.annotations.FlakyTest
-import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerTest
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
-import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
-import com.android.server.wm.traces.common.ComponentNameMatcher
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
@@ -62,17 +59,6 @@ open class QuickSwitchBetweenTwoAppsForwardTest_ShellTransit(flicker: FlickerTes
@Test
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
- /**
- * Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the
- * start and end of the WM trace
- */
- @Presubmit
- @Test
- fun navBarWindowIsVisibleAtStartAndEnd() {
- Assume.assumeFalse(flicker.scenario.isTablet)
- flicker.navBarWindowIsVisibleAtStartAndEnd()
- }
-
@FlakyTest(bugId = 246284708)
@Test
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchFromLauncherTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchFromLauncherTest.kt
index 8c8220ff04c9..456eab141f93 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchFromLauncherTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchFromLauncherTest.kt
@@ -26,7 +26,6 @@ import com.android.server.wm.flicker.FlickerTestFactory
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
-import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
import com.android.server.wm.traces.common.ComponentNameMatcher
import com.android.server.wm.traces.common.Rect
import com.android.server.wm.traces.common.service.PlatformConsts
@@ -262,17 +261,6 @@ class QuickSwitchFromLauncherTest(flicker: FlickerTest) : BaseTest(flicker) {
@Test
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
- /**
- * Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the
- * start and end of the WM trace
- */
- @Presubmit
- @Test
- fun navBarWindowIsVisibleAtStartAndEnd() {
- Assume.assumeFalse(flicker.scenario.isTablet)
- flicker.navBarWindowIsVisibleAtStartAndEnd()
- }
-
@Presubmit
@Test
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt
index 5b52c753d5f2..e3296a50b106 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt
@@ -127,7 +127,7 @@ class ChangeAppRotationTest(flicker: FlickerTest) : RotationTransition(flicker)
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
@Test
- @IwTest(focusArea = "ime")
+ @IwTest(focusArea = "framework")
override fun cujCompleted() {
super.cujCompleted()
focusChanges()
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 2447474a4a9d..741ae51887a3 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
@@ -207,22 +207,8 @@ open class SeamlessAppRotationTest(flicker: FlickerTest) : RotationTransition(fl
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
@Test
- @IwTest(focusArea = "ime")
+ @IwTest(focusArea = "framework")
override fun cujCompleted() {
- if (!flicker.scenario.isTablet) {
- // not yet tablet compatible
- appLayerRotates()
- appLayerAlwaysVisible()
- // not tablet compatible
- navBarLayerIsVisibleAtStartAndEnd()
- navBarWindowIsAlwaysVisible()
- }
-
- if (flicker.scenario.isTablet) {
- taskBarLayerIsVisibleAtStartAndEnd()
- taskBarWindowIsAlwaysVisible()
- }
-
appWindowFullScreen()
appWindowSeamlessRotation()
focusDoesNotChange()
@@ -233,6 +219,13 @@ open class SeamlessAppRotationTest(flicker: FlickerTest) : RotationTransition(fl
entireScreenCovered()
visibleLayersShownMoreThanOneConsecutiveEntry()
visibleWindowsShownMoreThanOneConsecutiveEntry()
+
+ runAndIgnoreAssumptionViolation { appLayerRotates() }
+ runAndIgnoreAssumptionViolation { appLayerAlwaysVisible() }
+ runAndIgnoreAssumptionViolation { navBarLayerIsVisibleAtStartAndEnd() }
+ runAndIgnoreAssumptionViolation { navBarWindowIsAlwaysVisible() }
+ runAndIgnoreAssumptionViolation { taskBarLayerIsVisibleAtStartAndEnd() }
+ runAndIgnoreAssumptionViolation { taskBarWindowIsAlwaysVisible() }
}
companion object {