Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/fundamentals/CloseAllAppsWithBackNavigationTest.kt +5 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,10 @@ import org.junit.runners.Parameterized @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) class CloseAllAppsWithBackNavigationTest(flicker: LegacyFlickerTest) : DesktopModeBaseTest(flicker) { inner class CloseAllAppsWithBackNavigationScenario : CloseAllAppsWithBackNavigation(flicker.scenario.startRotation) CloseAllAppsWithBackNavigation( navigationMode = flicker.scenario.navBarMode, rotation = flicker.scenario.startRotation ) @Rule @JvmField Loading Loading @@ -83,9 +86,7 @@ class CloseAllAppsWithBackNavigationTest(flicker: LegacyFlickerTest) : DesktopMo @Parameterized.Parameters(name = "{0}") @JvmStatic fun getParams(): Collection<FlickerTest> { return LegacyFlickerTestFactory.nonRotationTests( supportedNavigationModes = listOf(NavBar.MODE_GESTURAL) ) return LegacyFlickerTestFactory.nonRotationTests() } } } No newline at end of file libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/CloseAllAppsWithBackNavigation.kt +11 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import org.junit.Test @Ignore("Base Test Class") abstract class CloseAllAppsWithBackNavigation( val navigationMode: NavBar = NavBar.MODE_GESTURAL, val rotation: Rotation = Rotation.ROTATION_0 ) : TestScenarioBase() { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() Loading @@ -52,7 +53,7 @@ abstract class CloseAllAppsWithBackNavigation( val appsInZOrder: ArrayList<DesktopModeAppHelper> = ArrayList() @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(navigationMode, rotation) @Before fun setup() { Loading @@ -78,10 +79,16 @@ abstract class CloseAllAppsWithBackNavigation( @Test open fun closeAllAppsInDesktop() { nonResizeableApp.closeDesktopApp(wmHelper, device, usingBackNavigation = true) mailApp.closeDesktopApp(wmHelper, device, usingBackNavigation = true) testApp.closeDesktopApp(wmHelper, device, usingBackNavigation = true) repeat(appsInZOrder.size) { useBackNavigation() } } private fun useBackNavigation() { tapl.pressBack() wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify() } @After fun teardown() { Loading tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/DesktopModeAppHelper.kt +6 −11 Original line number Diff line number Diff line Loading @@ -308,20 +308,15 @@ open class DesktopModeAppHelper(private val innerHelper: StandardAppHelper) : .waitForAndVerify() } /** Close a desktop app by clicking the close button on the app header for the given app or by * pressing back. */ /** Close a desktop app by clicking the close button on the app header for the given app. */ fun closeDesktopApp( wmHelper: WindowManagerStateHelper, device: UiDevice, usingBackNavigation: Boolean = false ) { if (usingBackNavigation) { device.pressBack() } else { val caption = getCaptionForTheApp(wmHelper, device) val closeButton = caption?.children?.find { it.resourceName.endsWith(CLOSE_BUTTON) } closeButton?.click() } wmHelper .StateSyncBuilder() .withAppTransitionIdle() Loading Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/fundamentals/CloseAllAppsWithBackNavigationTest.kt +5 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,10 @@ import org.junit.runners.Parameterized @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) class CloseAllAppsWithBackNavigationTest(flicker: LegacyFlickerTest) : DesktopModeBaseTest(flicker) { inner class CloseAllAppsWithBackNavigationScenario : CloseAllAppsWithBackNavigation(flicker.scenario.startRotation) CloseAllAppsWithBackNavigation( navigationMode = flicker.scenario.navBarMode, rotation = flicker.scenario.startRotation ) @Rule @JvmField Loading Loading @@ -83,9 +86,7 @@ class CloseAllAppsWithBackNavigationTest(flicker: LegacyFlickerTest) : DesktopMo @Parameterized.Parameters(name = "{0}") @JvmStatic fun getParams(): Collection<FlickerTest> { return LegacyFlickerTestFactory.nonRotationTests( supportedNavigationModes = listOf(NavBar.MODE_GESTURAL) ) return LegacyFlickerTestFactory.nonRotationTests() } } } No newline at end of file
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/CloseAllAppsWithBackNavigation.kt +11 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import org.junit.Test @Ignore("Base Test Class") abstract class CloseAllAppsWithBackNavigation( val navigationMode: NavBar = NavBar.MODE_GESTURAL, val rotation: Rotation = Rotation.ROTATION_0 ) : TestScenarioBase() { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() Loading @@ -52,7 +53,7 @@ abstract class CloseAllAppsWithBackNavigation( val appsInZOrder: ArrayList<DesktopModeAppHelper> = ArrayList() @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(navigationMode, rotation) @Before fun setup() { Loading @@ -78,10 +79,16 @@ abstract class CloseAllAppsWithBackNavigation( @Test open fun closeAllAppsInDesktop() { nonResizeableApp.closeDesktopApp(wmHelper, device, usingBackNavigation = true) mailApp.closeDesktopApp(wmHelper, device, usingBackNavigation = true) testApp.closeDesktopApp(wmHelper, device, usingBackNavigation = true) repeat(appsInZOrder.size) { useBackNavigation() } } private fun useBackNavigation() { tapl.pressBack() wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify() } @After fun teardown() { Loading
tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/DesktopModeAppHelper.kt +6 −11 Original line number Diff line number Diff line Loading @@ -308,20 +308,15 @@ open class DesktopModeAppHelper(private val innerHelper: StandardAppHelper) : .waitForAndVerify() } /** Close a desktop app by clicking the close button on the app header for the given app or by * pressing back. */ /** Close a desktop app by clicking the close button on the app header for the given app. */ fun closeDesktopApp( wmHelper: WindowManagerStateHelper, device: UiDevice, usingBackNavigation: Boolean = false ) { if (usingBackNavigation) { device.pressBack() } else { val caption = getCaptionForTheApp(wmHelper, device) val closeButton = caption?.children?.find { it.resourceName.endsWith(CLOSE_BUTTON) } closeButton?.click() } wmHelper .StateSyncBuilder() .withAppTransitionIdle() Loading