Merge "Compatibilize app close tests with ARM CF"
This commit is contained in:
committed by
Android (Google) Code Review
commit
bbfc607211
@@ -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,9 +104,23 @@ 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -109,6 +109,11 @@ class OpenAppFromLockNotificationWarm(flicker: FlickerTest) : OpenAppFromNotific
|
||||
*/
|
||||
@Presubmit @Test fun statusBarLayerPositionAtEnd() = flicker.statusBarLayerPositionAtEnd()
|
||||
|
||||
/** {@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")
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -144,6 +144,11 @@ open class OpenAppNonResizeableTest(flicker: FlickerTest) : OpenAppFromLockTrans
|
||||
@Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end")
|
||||
override fun navBarWindowIsAlwaysVisible() {}
|
||||
|
||||
/** {@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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() =
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user