From a80f06cdb65f6a1c5d8777a033fbc4abd86c2ce2 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Tue, 11 Oct 2022 20:45:19 +0000 Subject: [PATCH] Promote passing app launch assertions Fixes: 213853038 Bug: 203538234 Bug: 229738092 Bug: 229735718 Bug: 246284526 Test: atest FlickerTests Change-Id: I64454bc5ee172a3b38bc43bc654f264defa97a52 --- .../wm/flicker/launch/OpenAppColdTest.kt | 6 - .../launch/OpenAppFromLockNotificationCold.kt | 60 +++------ .../launch/OpenAppFromLockNotificationWarm.kt | 78 ++--------- ...pFromLockNotificationWithLockOverlayApp.kt | 11 +- .../launch/OpenAppFromNotificationCold.kt | 48 +++++++ .../launch/OpenAppFromNotificationWarm.kt | 123 +++++++----------- .../launch/OpenAppNonResizeableTest.kt | 33 ++--- 7 files changed, 148 insertions(+), 211 deletions(-) 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 7cd8526dc0f7b..7576ab94284bd 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 @@ -79,12 +79,6 @@ open class OpenAppColdTest(testSpec: FlickerTestParameter) : /** {@inheritDoc} */ @Presubmit @Test override fun appLayerReplacesLauncher() = super.appLayerReplacesLauncher() - /** {@inheritDoc} */ - @FlakyTest(bugId = 240238245) - @Test - override fun visibleLayersShownMoreThanOneConsecutiveEntry() = - super.visibleLayersShownMoreThanOneConsecutiveEntry() - companion object { /** * Creates the test configurations. 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 2469faeaaa667..09d7637ffefcc 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 @@ -18,14 +18,13 @@ package com.android.server.wm.flicker.launch import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.Postsubmit +import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDevice import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.dsl.FlickerBuilder -import com.android.server.wm.flicker.navBarLayerPositionAtEnd -import com.android.server.wm.flicker.statusBarLayerPositionAtEnd -import org.junit.Assume +import com.android.server.wm.traces.common.ComponentNameMatcher import org.junit.FixMethodOrder import org.junit.Ignore import org.junit.Test @@ -65,43 +64,37 @@ open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) : } } - /** {@inheritDoc} */ - @FlakyTest(bugId = 229735718) - @Test - override fun entireScreenCovered() = super.entireScreenCovered() - /** {@inheritDoc} */ @FlakyTest(bugId = 203538234) @Test override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = super.visibleWindowsShownMoreThanOneConsecutiveEntry() - /** {@inheritDoc} */ - @FlakyTest(bugId = 203538234) - @Test - override fun appWindowBecomesTopWindow() = super.appWindowBecomesTopWindow() - /** {@inheritDoc} */ @Test @Ignore("Display is off at the start") override fun navBarLayerPositionAtStartAndEnd() {} - /** Checks the position of the [ComponentMatcher.NAV_BAR] at the end of the transition */ - @Postsubmit - @Test - fun navBarLayerPositionAtEnd() { - Assume.assumeFalse(testSpec.isTablet) - testSpec.navBarLayerPositionAtEnd() - } - /** {@inheritDoc} */ @Test @Ignore("Display is off at the start") override fun statusBarLayerPositionAtStartAndEnd() {} + /** {@inheritDoc} */ + @Test + @Ignore("Display is off at the start") + override fun taskBarLayerIsVisibleAtStartAndEnd() {} + + /** {@inheritDoc} */ + @Test + @Ignore("Display is off at the start") + override fun statusBarLayerIsVisibleAtStartAndEnd() = + super.statusBarLayerIsVisibleAtStartAndEnd() + /** - * Checks the position of the [ComponentMatcher.STATUS_BAR] at the start and end of the + * Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the * transition */ - @Postsubmit @Test fun statusBarLayerPositionEnd() = testSpec.statusBarLayerPositionAtEnd() + @Presubmit @Test override fun statusBarLayerPositionAtEnd() = + super.statusBarLayerPositionAtEnd() /** {@inheritDoc} */ @Postsubmit @@ -109,36 +102,19 @@ open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) : override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd() /** {@inheritDoc} */ - @Postsubmit @Test - override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible() - - /** {@inheritDoc} */ - @Postsubmit @Test override fun appLayerBecomesVisible() = super.appLayerBecomesVisible() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible() + @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end") + override fun navBarWindowIsAlwaysVisible() {} /** {@inheritDoc} */ @Postsubmit @Test override fun appWindowBecomesVisible() = super.appWindowBecomesVisible() - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun statusBarLayerIsVisibleAtStartAndEnd() = - super.statusBarLayerIsVisibleAtStartAndEnd() - /** {@inheritDoc} */ @Postsubmit @Test override fun visibleLayersShownMoreThanOneConsecutiveEntry() = super.visibleLayersShownMoreThanOneConsecutiveEntry() - /** {@inheritDoc} */ - @Postsubmit @Test override fun appWindowIsTopWindowAtEnd() = super.appWindowIsTopWindowAtEnd() - companion object { /** * Creates the test configurations. 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 c26b665953da3..5a7b8b9e3d9ab 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 @@ -17,19 +17,14 @@ package com.android.server.wm.flicker.launch import android.platform.test.annotations.FlakyTest -import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDevice import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.dsl.FlickerBuilder -import com.android.server.wm.flicker.navBarLayerIsVisibleAtEnd -import com.android.server.wm.flicker.navBarLayerPositionAtEnd -import com.android.server.wm.flicker.navBarWindowIsVisibleAtEnd import com.android.server.wm.flicker.statusBarLayerPositionAtEnd import com.android.server.wm.traces.common.ComponentNameMatcher -import org.junit.Assume import org.junit.FixMethodOrder import org.junit.Ignore import org.junit.Test @@ -48,8 +43,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@Postsubmit -open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) : +class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) : OpenAppFromNotificationWarm(testSpec) { override val openingNotificationsFromLockScreen = true @@ -74,8 +68,8 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) : * window of the transition, with snapshot or splash screen windows optionally showing first. */ @Test - @Postsubmit - open fun appWindowBecomesFirstAndOnlyTopWindow() { + @Presubmit + fun appWindowBecomesFirstAndOnlyTopWindow() { testSpec.assertWm { this.hasNoVisibleAppWindow() .then() @@ -89,96 +83,52 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) : /** Checks that the screen is locked at the start of the transition */ @Test - @Postsubmit + @Presubmit fun screenLockedStart() { testSpec.assertWmStart { isKeyguardShowing() } } - /** {@inheritDoc} */ - @FlakyTest(bugId = 229735718) - @Test - override fun entireScreenCovered() = super.entireScreenCovered() - - /** {@inheritDoc} */ - @FlakyTest(bugId = 203538234) - @Test - override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = - super.visibleWindowsShownMoreThanOneConsecutiveEntry() - /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end") override fun navBarLayerPositionAtStartAndEnd() {} - /** Checks the position of the [ComponentNameMatcher.NAV_BAR] at the end of the transition */ - @Postsubmit - @Test - fun navBarLayerPositionAtEnd() { - Assume.assumeFalse(testSpec.isTablet) - testSpec.navBarLayerPositionAtEnd() - } - /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") override fun statusBarLayerPositionAtStartAndEnd() {} + /** {@inheritDoc} */ + @Test + @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") + override fun statusBarLayerIsVisibleAtStartAndEnd() = + super.statusBarLayerIsVisibleAtStartAndEnd() + /** * Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the * transition */ - @Postsubmit @Test fun statusBarLayerPositionEnd() = testSpec.statusBarLayerPositionAtEnd() + @Presubmit @Test fun statusBarLayerPositionAtEnd() = testSpec.statusBarLayerPositionAtEnd() /** {@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} */ - @Postsubmit @Test fun navBarLayerIsVisibleAtEnd() = testSpec.navBarLayerIsVisibleAtEnd() - /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end") - override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible() - - @Postsubmit @Test fun navBarWindowIsVisibleAtEnd() = testSpec.navBarWindowIsVisibleAtEnd() + override fun navBarWindowIsAlwaysVisible() {} /** {@inheritDoc} */ - @Postsubmit @Test override fun appLayerBecomesVisible() = super.appLayerBecomesVisible() + @FlakyTest @Test override fun appWindowBecomesVisible() = super.appWindowBecomesVisible() /** {@inheritDoc} */ - @Postsubmit - @Test - override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible() - - /** {@inheritDoc} */ - @Postsubmit @Test override fun appWindowBecomesTopWindow() = super.appWindowBecomesTopWindow() - - /** {@inheritDoc} */ - @Postsubmit @Test override fun appWindowBecomesVisible() = super.appWindowBecomesVisible() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun statusBarLayerIsVisibleAtStartAndEnd() = - super.statusBarLayerIsVisibleAtStartAndEnd() - - /** {@inheritDoc} */ - @Postsubmit + @FlakyTest(bugId = 246284526) @Test override fun visibleLayersShownMoreThanOneConsecutiveEntry() = super.visibleLayersShownMoreThanOneConsecutiveEntry() - /** {@inheritDoc} */ - @Postsubmit @Test override fun appWindowIsTopWindowAtEnd() = super.appWindowIsTopWindowAtEnd() - - /** {@inheritDoc} */ - @Presubmit - @Test - override fun appWindowBecomesTopWindow_ShellTransit() = - super.appWindowBecomesTopWindow_ShellTransit() - companion object { /** * Creates the test configurations. 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 0b4361ce8f2e9..c10b99317b19e 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 @@ -16,8 +16,8 @@ package com.android.server.wm.flicker.launch -import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.Postsubmit +import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDevice import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter @@ -95,12 +95,13 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet } /** {@inheritDoc} */ - @FlakyTest(bugId = 229735718) - @Test - override fun entireScreenCovered() = super.entireScreenCovered() + @Presubmit @Test override fun appLayerBecomesVisible() = super.appLayerBecomesVisible() /** {@inheritDoc} */ - @Postsubmit @Test override fun appWindowBecomesTopWindow() = super.appWindowBecomesTopWindow() + @Postsubmit + @Test + override fun visibleLayersShownMoreThanOneConsecutiveEntry() = + super.visibleLayersShownMoreThanOneConsecutiveEntry() companion object { /** diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt index 6802d7a5a372f..8dd94cd0ef15e 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt @@ -17,12 +17,17 @@ package com.android.server.wm.flicker.launch import android.platform.test.annotations.Postsubmit +import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDevice import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.dsl.FlickerBuilder +import com.android.server.wm.flicker.statusBarLayerPositionAtEnd +import com.android.server.wm.traces.common.ComponentNameMatcher import org.junit.FixMethodOrder +import org.junit.Ignore +import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.MethodSorters import org.junit.runners.Parameterized @@ -49,12 +54,55 @@ open class OpenAppFromNotificationCold(testSpec: FlickerTestParameter) : setup { // Close the app that posted the notification to trigger a cold start next time // it is open - can't just kill it because that would remove the notification. + tapl.setExpectedRotationCheckEnabled(false) tapl.goHome() tapl.workspace.switchToOverview() tapl.overview.dismissAllTasks() } } + @Postsubmit + @Test + override fun appWindowBecomesVisible() = appWindowBecomesVisible_coldStart() + + @Postsubmit + @Test + override fun appLayerBecomesVisible() = appLayerBecomesVisible_coldStart() + + /** {@inheritDoc} */ + @Test + @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end") + override fun navBarLayerPositionAtStartAndEnd() {} + + /** {@inheritDoc} */ + @Test + @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") + override fun statusBarLayerPositionAtStartAndEnd() {} + + /** {@inheritDoc} */ + @Test + @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") + override fun statusBarLayerIsVisibleAtStartAndEnd() = + super.statusBarLayerIsVisibleAtStartAndEnd() + + /** + * Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the + * transition + */ + @Presubmit + @Test + open fun statusBarLayerPositionAtEnd() = testSpec.statusBarLayerPositionAtEnd() + + /** {@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} */ + @Test + @Ignore("Not applicable to this CUJ. Display starts locked and app is full screen at the end") + override fun navBarWindowIsAlwaysVisible() {} + companion object { /** * Creates the test configurations. diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt index 1ae0d5374c593..db48b3f4a48c0 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt @@ -18,6 +18,7 @@ package com.android.server.wm.flicker.launch import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.Postsubmit +import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDevice import android.view.WindowInsets import android.view.WindowManager @@ -28,9 +29,11 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.helpers.NotificationAppHelper -import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen +import com.android.server.wm.flicker.navBarLayerIsVisibleAtEnd +import com.android.server.wm.flicker.navBarLayerPositionAtEnd +import com.android.server.wm.flicker.navBarWindowIsVisibleAtEnd import com.android.server.wm.flicker.taskBarLayerIsVisibleAtEnd import com.android.server.wm.flicker.taskBarWindowIsVisibleAtEnd import com.android.server.wm.traces.common.ComponentNameMatcher @@ -53,7 +56,6 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@Postsubmit open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) : OpenAppTransition(testSpec) { override val testApp: NotificationAppHelper = NotificationAppHelper(instrumentation) @@ -111,101 +113,35 @@ open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) : teardown { testApp.exit(wmHelper) } } - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd() + @FlakyTest @Test override fun appWindowBecomesVisible() = appWindowBecomesVisible_warmStart() - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun statusBarLayerIsVisibleAtStartAndEnd() = - super.statusBarLayerIsVisibleAtStartAndEnd() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun visibleLayersShownMoreThanOneConsecutiveEntry() = - super.visibleLayersShownMoreThanOneConsecutiveEntry() - - /** {@inheritDoc} */ - @Postsubmit @Test override fun appWindowBecomesVisible() = appWindowBecomesVisible_warmStart() - - /** {@inheritDoc} */ @Postsubmit @Test override fun appLayerBecomesVisible() = appLayerBecomesVisible_warmStart() - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible() - - /** {@inheritDoc} */ - @Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = - super.visibleWindowsShownMoreThanOneConsecutiveEntry() - - /** {@inheritDoc} */ - @Postsubmit @Test override fun appWindowIsTopWindowAtEnd() = super.appWindowIsTopWindowAtEnd() - - @Postsubmit + @Presubmit @Test open fun notificationAppWindowVisibleAtEnd() { testSpec.assertWmEnd { this.isAppWindowVisible(testApp) } } - @Postsubmit + @Presubmit @Test open fun notificationAppWindowOnTopAtEnd() { testSpec.assertWmEnd { this.isAppWindowOnTop(testApp) } } - @Postsubmit + @Presubmit @Test open fun notificationAppLayerVisibleAtEnd() { testSpec.assertLayersEnd { this.isVisible(testApp) } } - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun appWindowBecomesTopWindow() { - Assume.assumeFalse(isShellTransitionsEnabled) - super.appWindowBecomesTopWindow() - } - - @FlakyTest(bugId = 229738092) - @Test - open fun appWindowBecomesTopWindow_ShellTransit() { - Assume.assumeTrue(isShellTransitionsEnabled) - super.appWindowBecomesTopWindow() - } - /** * Checks that the [ComponentNameMatcher.TASK_BAR] window is visible at the end of the * transition * * Note: Large screen only */ - @Postsubmit + @Presubmit @Test open fun taskBarWindowIsVisibleAtEnd() { Assume.assumeTrue(testSpec.isTablet) @@ -217,22 +153,51 @@ open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) : * * Note: Large screen only */ - @Postsubmit + @Presubmit @Test open fun taskBarLayerIsVisibleAtEnd() { Assume.assumeTrue(testSpec.isTablet) testSpec.taskBarLayerIsVisibleAtEnd() } - /** {@inheritDoc} */ + /** Checks the position of the [ComponentNameMatcher.NAV_BAR] at the end of the transition */ + @Presubmit @Test - @Ignore("Display is locked at the start") - override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible() + open fun navBarLayerPositionAtEnd() { + Assume.assumeFalse(testSpec.isTablet) + testSpec.navBarLayerPositionAtEnd() + } + + /** {@inheritDoc} */ + @Presubmit + @Test + open fun navBarLayerIsVisibleAtEnd() { + Assume.assumeFalse(testSpec.isTablet) + testSpec.navBarLayerIsVisibleAtEnd() + } + + @Presubmit + @Test + open fun navBarWindowIsVisibleAtEnd() { + Assume.assumeFalse(testSpec.isTablet) + testSpec.navBarWindowIsVisibleAtEnd() + } /** {@inheritDoc} */ @Test - @Ignore("Display is locked at the start") - override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd() + @Ignore("Display is off at the start") + override fun taskBarLayerIsVisibleAtStartAndEnd() {} + + /** {@inheritDoc} */ + @Test + @Postsubmit + override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible() + + /** {@inheritDoc} */ + @Postsubmit + @Test + override fun visibleLayersShownMoreThanOneConsecutiveEntry() = + super.visibleLayersShownMoreThanOneConsecutiveEntry() companion object { /** 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 89e3b5fefcf74..1ecde46874c15 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 @@ -27,7 +27,6 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.FlickerServiceCompatible import com.android.server.wm.flicker.helpers.NonResizeableAppHelper -import com.android.server.wm.flicker.statusBarLayerPositionAtEnd import com.android.server.wm.traces.common.ComponentNameMatcher import org.junit.Assume import org.junit.FixMethodOrder @@ -69,7 +68,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : override val testApp = NonResizeableAppHelper(instrumentation) /** - * Checks that the [ComponentMatcher.NAV_BAR] layer starts invisible, becomes visible during + * Checks that the [ComponentNameMatcher.NAV_BAR] layer starts invisible, becomes visible during * unlocking animation and remains visible at the end */ @FlakyTest(bugId = 227083463) @@ -91,7 +90,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : } /** - * Checks that the [ComponentMatcher.NAV_BAR] starts the transition invisible, then becomes + * Checks that the [ComponentNameMatcher.NAV_BAR] starts the transition invisible, then becomes * visible during the unlocking animation and remains visible at the end of the transition */ @Presubmit @@ -106,7 +105,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : } /** - * Checks that the [ComponentMatcher.TASK_BAR] starts the transition invisible, then becomes + * Checks that the [ComponentNameMatcher.TASK_BAR] starts the transition invisible, then becomes * visible during the unlocking animation and remains visible at the end of the transition */ @Presubmit @@ -117,7 +116,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : } /** - * Checks that the [ComponentMatcher.STATUS_BAR] layer is visible at the end of the trace + * Checks that the [ComponentNameMatcher.STATUS_BAR] layer is visible at the end of the trace * * It is not possible to check at the start because the screen is off */ @@ -130,32 +129,34 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") - override fun taskBarLayerIsVisibleAtStartAndEnd() {} + override fun taskBarLayerIsVisibleAtStartAndEnd() { + } /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") - override fun navBarLayerIsVisibleAtStartAndEnd() {} + override fun navBarLayerIsVisibleAtStartAndEnd() { + } /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") - override fun taskBarWindowIsAlwaysVisible() {} + override fun taskBarWindowIsAlwaysVisible() { + } /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") - override fun navBarWindowIsAlwaysVisible() {} + override fun navBarWindowIsAlwaysVisible() { + } /** {@inheritDoc} */ @Test @Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end") - override fun statusBarWindowIsAlwaysVisible() {} + override fun statusBarWindowIsAlwaysVisible() { + } - /** Checks the position of the [ComponentMatcher.STATUS_BAR] at the end of the transition */ - @Presubmit @Test fun statusBarLayerPositionEnd() = testSpec.statusBarLayerPositionAtEnd() - - /** Checks the [ComponentMatcher.NAV_BAR] is visible at the end of the transition */ + /** Checks the [ComponentNameMatcher.NAV_BAR] is visible at the end of the transition */ @Postsubmit @Test fun navBarLayerIsVisibleAtEnd() { @@ -186,7 +187,9 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : } /** {@inheritDoc} */ - @FlakyTest @Test override fun entireScreenCovered() = super.entireScreenCovered() + @FlakyTest + @Test + override fun entireScreenCovered() = super.entireScreenCovered() @FlakyTest(bugId = 218470989) @Test