Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/Android.bp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,7 @@ test_module_config { base: "WMShellFlickerTestsDesktopMode", base: "WMShellFlickerTestsDesktopMode", test_suites: ["device-tests"], test_suites: ["device-tests"], exclude_filters: [ exclude_filters: [ "com.android.wm.shell.flicker.appcompat.ShowAppDialogInDesktopModeFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToSplitScreenWithAppHeaderMenuFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToSplitScreenWithAppHeaderMenuFlickerTest", Loading Loading @@ -103,6 +104,13 @@ test_module_config { ], ], } } test_module_config { name: "WMShellFlickerTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeFlickerTest", base: "WMShellFlickerTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.flicker.appcompat.ShowAppDialogInDesktopModeFlickerTest"], } test_module_config { test_module_config { name: "WMShellFlickerTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", name: "WMShellFlickerTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", base: "WMShellFlickerTestsDesktopMode", base: "WMShellFlickerTestsDesktopMode", Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/appcompat/ShowAppDialogInDesktopModeFlickerTest.kt 0 → 100644 +91 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.wm.shell.flicker.appcompat import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.RequiresDesktopDevice import android.tools.NavBar import android.tools.flicker.FlickerBuilder import android.tools.flicker.FlickerTest import android.tools.flicker.FlickerTestFactory import android.tools.flicker.assertions.FlickerChecker import android.tools.flicker.junit.FlickerParametersRunnerFactory import android.tools.traces.component.ComponentNameMatcher import android.tools.traces.component.IComponentNameMatcher import com.android.wm.shell.Utils import com.android.wm.shell.flicker.DesktopModeBaseTest import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd import com.android.wm.shell.flicker.utils.appWindowKeepVisible import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.layerCoversFullScreenAtEnd import com.android.wm.shell.scenarios.ShowAppDialogInDesktopMode import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized /** * Test for showing a dialog inside an app in desktop mode. * * Assert that dialog activity windows appear on top and cover the full screen at end. */ @RequiresDesktopDevice @Postsubmit @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) class ShowAppDialogInDesktopModeFlickerTest(flicker: FlickerTest) : DesktopModeBaseTest(flicker) { inner class ShowAppDialogInDesktopModeScenario : ShowAppDialogInDesktopMode(flicker.scenario.startRotation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation) val scenario = ShowAppDialogInDesktopModeScenario() private val browserApp = scenario.browserAppHelper private val appDialogMatcher: IComponentNameMatcher = ComponentNameMatcher.ADD_ITEM_ACTIVITY override val transition: FlickerBuilder.() -> Unit get() = { setup { scenario.setup() } transitions { scenario.addAppShortcutToHomeScreen() } teardown { scenario.teardown() } } @Test fun appDialogWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(appDialogMatcher) @Test fun appDialogInsideDisplayBoundsAtEnd() = flicker.appWindowInsideDisplayBoundsAtEnd(appDialogMatcher) @Test fun appDialogCoversFullScreenAtEnd() = flicker.layerCoversFullScreenAtEnd(appDialogMatcher) @Test fun appWindowKeepVisible() = flicker.appWindowKeepVisible(browserApp) companion object { @Parameterized.Parameters(name = "{0}") @JvmStatic fun getParams(): Collection<FlickerChecker> { return FlickerTestFactory.nonRotationTests( supportedNavigationModes = listOf(NavBar.MODE_GESTURAL) ) } } } libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/Android.bp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,7 @@ test_module_config { "com.android.wm.shell.functional.UnmaximizeAppWindowTest", "com.android.wm.shell.functional.UnmaximizeAppWindowTest", "com.android.wm.shell.functional.UnminimizeAppFromAllAppsTest", "com.android.wm.shell.functional.UnminimizeAppFromAllAppsTest", "com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest", "com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest", "com.android.wm.shell.functional.appcompat.ShowAppDialogInDesktopModeTest", "com.android.wm.shell.functional.exit.ExitDesktopToFullScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopToFullScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopToSplitScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopToSplitScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopWithDragToTopDragZoneTest", "com.android.wm.shell.functional.exit.ExitDesktopWithDragToTopDragZoneTest", Loading Loading @@ -296,6 +297,13 @@ test_module_config { include_filters: ["com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest"], include_filters: ["com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest"], } } test_module_config { name: "FunctionalTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeTest", base: "FunctionalTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.functional.appcompat.ShowAppDialogInDesktopModeTest"], } test_module_config { test_module_config { name: "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest", name: "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest", base: "FunctionalTestsDesktopMode", base: "FunctionalTestsDesktopMode", Loading libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/TEST_MAPPING +3 −0 Original line number Original line Diff line number Diff line Loading @@ -72,6 +72,9 @@ { { "name": "FunctionalTestsDesktopMode-UnminimizeAppFromTaskbarTest" "name": "FunctionalTestsDesktopMode-UnminimizeAppFromTaskbarTest" }, }, { "name": "FunctionalTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeTest" }, { { "name": "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest" "name": "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest" }, }, Loading libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/appcompat/ShowAppDialogInDesktopModeTest.kt 0 → 100644 +32 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.wm.shell.functional.appcompat import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDesktopDevice import android.platform.test.rule.ScreenRecordRule import com.android.wm.shell.scenarios.ShowAppDialogInDesktopMode import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner /* Functional test for [ShowAppDialogInDesktopMode]. */ @RunWith(BlockJUnit4ClassRunner::class) @RequiresDesktopDevice @Presubmit @ScreenRecordRule.ScreenRecord class ShowAppDialogInDesktopModeTest : ShowAppDialogInDesktopMode() Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/Android.bp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,7 @@ test_module_config { base: "WMShellFlickerTestsDesktopMode", base: "WMShellFlickerTestsDesktopMode", test_suites: ["device-tests"], test_suites: ["device-tests"], exclude_filters: [ exclude_filters: [ "com.android.wm.shell.flicker.appcompat.ShowAppDialogInDesktopModeFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToSplitScreenWithAppHeaderMenuFlickerTest", "com.android.wm.shell.flicker.exit.ExitDesktopToSplitScreenWithAppHeaderMenuFlickerTest", Loading Loading @@ -103,6 +104,13 @@ test_module_config { ], ], } } test_module_config { name: "WMShellFlickerTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeFlickerTest", base: "WMShellFlickerTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.flicker.appcompat.ShowAppDialogInDesktopModeFlickerTest"], } test_module_config { test_module_config { name: "WMShellFlickerTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", name: "WMShellFlickerTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest", base: "WMShellFlickerTestsDesktopMode", base: "WMShellFlickerTestsDesktopMode", Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/appcompat/ShowAppDialogInDesktopModeFlickerTest.kt 0 → 100644 +91 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.wm.shell.flicker.appcompat import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.RequiresDesktopDevice import android.tools.NavBar import android.tools.flicker.FlickerBuilder import android.tools.flicker.FlickerTest import android.tools.flicker.FlickerTestFactory import android.tools.flicker.assertions.FlickerChecker import android.tools.flicker.junit.FlickerParametersRunnerFactory import android.tools.traces.component.ComponentNameMatcher import android.tools.traces.component.IComponentNameMatcher import com.android.wm.shell.Utils import com.android.wm.shell.flicker.DesktopModeBaseTest import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd import com.android.wm.shell.flicker.utils.appWindowKeepVisible import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.layerCoversFullScreenAtEnd import com.android.wm.shell.scenarios.ShowAppDialogInDesktopMode import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized /** * Test for showing a dialog inside an app in desktop mode. * * Assert that dialog activity windows appear on top and cover the full screen at end. */ @RequiresDesktopDevice @Postsubmit @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) class ShowAppDialogInDesktopModeFlickerTest(flicker: FlickerTest) : DesktopModeBaseTest(flicker) { inner class ShowAppDialogInDesktopModeScenario : ShowAppDialogInDesktopMode(flicker.scenario.startRotation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation) val scenario = ShowAppDialogInDesktopModeScenario() private val browserApp = scenario.browserAppHelper private val appDialogMatcher: IComponentNameMatcher = ComponentNameMatcher.ADD_ITEM_ACTIVITY override val transition: FlickerBuilder.() -> Unit get() = { setup { scenario.setup() } transitions { scenario.addAppShortcutToHomeScreen() } teardown { scenario.teardown() } } @Test fun appDialogWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(appDialogMatcher) @Test fun appDialogInsideDisplayBoundsAtEnd() = flicker.appWindowInsideDisplayBoundsAtEnd(appDialogMatcher) @Test fun appDialogCoversFullScreenAtEnd() = flicker.layerCoversFullScreenAtEnd(appDialogMatcher) @Test fun appWindowKeepVisible() = flicker.appWindowKeepVisible(browserApp) companion object { @Parameterized.Parameters(name = "{0}") @JvmStatic fun getParams(): Collection<FlickerChecker> { return FlickerTestFactory.nonRotationTests( supportedNavigationModes = listOf(NavBar.MODE_GESTURAL) ) } } }
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/Android.bp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,7 @@ test_module_config { "com.android.wm.shell.functional.UnmaximizeAppWindowTest", "com.android.wm.shell.functional.UnmaximizeAppWindowTest", "com.android.wm.shell.functional.UnminimizeAppFromAllAppsTest", "com.android.wm.shell.functional.UnminimizeAppFromAllAppsTest", "com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest", "com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest", "com.android.wm.shell.functional.appcompat.ShowAppDialogInDesktopModeTest", "com.android.wm.shell.functional.exit.ExitDesktopToFullScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopToFullScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopToSplitScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopToSplitScreenWithAppHeaderMenuTest", "com.android.wm.shell.functional.exit.ExitDesktopWithDragToTopDragZoneTest", "com.android.wm.shell.functional.exit.ExitDesktopWithDragToTopDragZoneTest", Loading Loading @@ -296,6 +297,13 @@ test_module_config { include_filters: ["com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest"], include_filters: ["com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest"], } } test_module_config { name: "FunctionalTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeTest", base: "FunctionalTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.functional.appcompat.ShowAppDialogInDesktopModeTest"], } test_module_config { test_module_config { name: "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest", name: "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest", base: "FunctionalTestsDesktopMode", base: "FunctionalTestsDesktopMode", Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/TEST_MAPPING +3 −0 Original line number Original line Diff line number Diff line Loading @@ -72,6 +72,9 @@ { { "name": "FunctionalTestsDesktopMode-UnminimizeAppFromTaskbarTest" "name": "FunctionalTestsDesktopMode-UnminimizeAppFromTaskbarTest" }, }, { "name": "FunctionalTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeTest" }, { { "name": "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest" "name": "FunctionalTestsDesktopMode-exit-ExitDesktopToFullScreenWithAppHeaderMenuTest" }, }, Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/appcompat/ShowAppDialogInDesktopModeTest.kt 0 → 100644 +32 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.wm.shell.functional.appcompat import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDesktopDevice import android.platform.test.rule.ScreenRecordRule import com.android.wm.shell.scenarios.ShowAppDialogInDesktopMode import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner /* Functional test for [ShowAppDialogInDesktopMode]. */ @RunWith(BlockJUnit4ClassRunner::class) @RequiresDesktopDevice @Presubmit @ScreenRecordRule.ScreenRecord class ShowAppDialogInDesktopModeTest : ShowAppDialogInDesktopMode()