Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/Android.bp +8 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ test_module_config { "com.android.wm.shell.flicker.fundamentals.SwitchFocusBetweenAppsTest", "com.android.wm.shell.flicker.fundamentals.SwitchToHomeFromDesktopTest", "com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest", "com.android.wm.shell.flicker.immersive.EnterImmersiveViaHeaderMenuFlickerTest", "com.android.wm.shell.flicker.keyboardshortcuts.EnterDesktopFromKeyboardShortcutFlickerTest", "com.android.wm.shell.flicker.keyboardshortcuts.ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest", "com.android.wm.shell.flicker.keyboardshortcuts.MaximizeAppWithKeyboardFlickerTest", Loading Loading @@ -221,6 +222,13 @@ test_module_config { include_filters: ["com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest"], } test_module_config { name: "WMShellFlickerTestsDesktopMode-immersive-EnterImmersiveViaHeaderMenuFlickerTest", base: "WMShellFlickerTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.flicker.immersive.EnterImmersiveViaHeaderMenuFlickerTest"], } test_module_config { name: "WMShellFlickerTestsDesktopMode-keyboardshortcuts-AltTabSwitchInDesktopModeFlickerTest", base: "WMShellFlickerTestsDesktopMode", Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/immersive/EnterImmersiveViaHeaderMenuFlickerTest.kt 0 → 100644 +106 −0 Original line number 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.immersive import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.RequiresDesktopDevice import android.tools.NavBar import android.tools.flicker.assertions.FlickerChecker import android.tools.flicker.junit.FlickerParametersRunnerFactory import android.tools.flicker.FlickerBuilder import android.tools.flicker.FlickerTest import android.tools.flicker.FlickerTestFactory 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.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.appWindowKeepVisible import com.android.wm.shell.flicker.utils.layerBecomesInvisible import com.android.wm.shell.flicker.utils.resizeVeilKeepsIncreasingInSize import com.android.wm.shell.scenarios.EnterImmersiveViaHeaderMenu import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized /** * Enter immersive mode via long click on maximize button. * * Assert that the status bar and task bar are not visible. */ @RequiresDesktopDevice @Postsubmit @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) class EnterImmersiveViaHeaderMenuFlickerTest(flicker: FlickerTest) : DesktopModeBaseTest(flicker) { override val excludedTests: Set<String> get() = setOf( "taskBarLayerIsVisibleAtStartAndEnd", "taskBarWindowIsAlwaysVisible", "statusBarLayerIsVisibleAtStartAndEnd", "statusBarLayerPositionAtStartAndEnd", "statusBarWindowIsAlwaysVisible" ) inner class EnterImmersiveViaHeaderMenuScenario : EnterImmersiveViaHeaderMenu(flicker.scenario.startRotation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation) val scenario = EnterImmersiveViaHeaderMenuScenario() private val gameApp = scenario.gameApp private val navBarMatcher: IComponentNameMatcher = ComponentNameMatcher.NAV_BAR private val statusBarMatcher: IComponentNameMatcher = ComponentNameMatcher.STATUS_BAR override val transition: FlickerBuilder.() -> Unit get() = { setup { scenario.setup() } transitions { scenario.enterImmersiveViaHeaderMenu() } teardown { scenario.teardown() } } @Test fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(gameApp) @Test fun appWindowKeepVisible() = flicker.appWindowKeepVisible(gameApp) @Test fun resizeVeilKeepsIncreasingInSize() = flicker.resizeVeilKeepsIncreasingInSize(gameApp) @Test fun statusBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(statusBarMatcher) @Test @Ignore("TODO: Reinstate this test once b/435359906 is fixed") fun taskBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(navBarMatcher) 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 Diff line number Diff line Loading @@ -140,6 +140,7 @@ test_module_config { "com.android.wm.shell.functional.fundamentals.focus.DragAndKeepFocusTest", "com.android.wm.shell.functional.fundamentals.focus.MoveToNextDisplayAndFocusTest", "com.android.wm.shell.functional.fundamentals.focus.OpenAndFocusTest", "com.android.wm.shell.functional.immersive.EnterImmersiveViaHeaderMenuTest", "com.android.wm.shell.functional.keyboardshortcuts.EnterDesktopFromKeyboardShortcutTest", "com.android.wm.shell.functional.keyboardshortcuts.ExitDesktopFromKeyboardShortcutTest", "com.android.wm.shell.functional.keyboardshortcuts.OpenAppFromAllAppsUsingKeyboardTest", Loading Loading @@ -501,6 +502,13 @@ test_module_config { include_filters: ["com.android.wm.shell.functional.fundamentals.focus.OpenAndFocusTest"], } test_module_config { name: "FunctionalTestsDesktopMode-immersive-EnterImmersiveViaHeaderMenuTest", base: "FunctionalTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.functional.immersive.EnterImmersiveViaHeaderMenuTest"], } test_module_config { name: "FunctionalTestsDesktopMode-keyboardshortcuts-EnterDesktopFromKeyboardShortcutTest", base: "FunctionalTestsDesktopMode", Loading libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/TEST_MAPPING +3 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ { "name": "FunctionalTestsDesktopMode-fundamentals-focus-OpenAndFocusTest" }, { "name": "FunctionalTestsDesktopMode-immersive-EnterImmersiveViaHeaderMenuTest" }, { "name": "FunctionalTestsDesktopMode-keyboardshortcuts-EnterDesktopFromKeyboardShortcutTest" }, Loading libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/immersive/EnterImmersiveViaHeaderMenuTest.kt 0 → 100644 +31 −0 Original line number 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.immersive import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDesktopDevice import android.platform.test.rule.ScreenRecordRule import com.android.wm.shell.scenarios.EnterImmersiveViaHeaderMenu import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner /* Functional test for [EnterImmersiveViaHeaderMenuTest]. */ @RunWith(BlockJUnit4ClassRunner::class) @RequiresDesktopDevice @Presubmit @ScreenRecordRule.ScreenRecord class EnterImmersiveViaHeaderMenuTest : EnterImmersiveViaHeaderMenu() Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/Android.bp +8 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ test_module_config { "com.android.wm.shell.flicker.fundamentals.SwitchFocusBetweenAppsTest", "com.android.wm.shell.flicker.fundamentals.SwitchToHomeFromDesktopTest", "com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest", "com.android.wm.shell.flicker.immersive.EnterImmersiveViaHeaderMenuFlickerTest", "com.android.wm.shell.flicker.keyboardshortcuts.EnterDesktopFromKeyboardShortcutFlickerTest", "com.android.wm.shell.flicker.keyboardshortcuts.ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest", "com.android.wm.shell.flicker.keyboardshortcuts.MaximizeAppWithKeyboardFlickerTest", Loading Loading @@ -221,6 +222,13 @@ test_module_config { include_filters: ["com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest"], } test_module_config { name: "WMShellFlickerTestsDesktopMode-immersive-EnterImmersiveViaHeaderMenuFlickerTest", base: "WMShellFlickerTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.flicker.immersive.EnterImmersiveViaHeaderMenuFlickerTest"], } test_module_config { name: "WMShellFlickerTestsDesktopMode-keyboardshortcuts-AltTabSwitchInDesktopModeFlickerTest", base: "WMShellFlickerTestsDesktopMode", Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/immersive/EnterImmersiveViaHeaderMenuFlickerTest.kt 0 → 100644 +106 −0 Original line number 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.immersive import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.RequiresDesktopDevice import android.tools.NavBar import android.tools.flicker.assertions.FlickerChecker import android.tools.flicker.junit.FlickerParametersRunnerFactory import android.tools.flicker.FlickerBuilder import android.tools.flicker.FlickerTest import android.tools.flicker.FlickerTestFactory 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.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.appWindowKeepVisible import com.android.wm.shell.flicker.utils.layerBecomesInvisible import com.android.wm.shell.flicker.utils.resizeVeilKeepsIncreasingInSize import com.android.wm.shell.scenarios.EnterImmersiveViaHeaderMenu import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized /** * Enter immersive mode via long click on maximize button. * * Assert that the status bar and task bar are not visible. */ @RequiresDesktopDevice @Postsubmit @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) class EnterImmersiveViaHeaderMenuFlickerTest(flicker: FlickerTest) : DesktopModeBaseTest(flicker) { override val excludedTests: Set<String> get() = setOf( "taskBarLayerIsVisibleAtStartAndEnd", "taskBarWindowIsAlwaysVisible", "statusBarLayerIsVisibleAtStartAndEnd", "statusBarLayerPositionAtStartAndEnd", "statusBarWindowIsAlwaysVisible" ) inner class EnterImmersiveViaHeaderMenuScenario : EnterImmersiveViaHeaderMenu(flicker.scenario.startRotation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation) val scenario = EnterImmersiveViaHeaderMenuScenario() private val gameApp = scenario.gameApp private val navBarMatcher: IComponentNameMatcher = ComponentNameMatcher.NAV_BAR private val statusBarMatcher: IComponentNameMatcher = ComponentNameMatcher.STATUS_BAR override val transition: FlickerBuilder.() -> Unit get() = { setup { scenario.setup() } transitions { scenario.enterImmersiveViaHeaderMenu() } teardown { scenario.teardown() } } @Test fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(gameApp) @Test fun appWindowKeepVisible() = flicker.appWindowKeepVisible(gameApp) @Test fun resizeVeilKeepsIncreasingInSize() = flicker.resizeVeilKeepsIncreasingInSize(gameApp) @Test fun statusBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(statusBarMatcher) @Test @Ignore("TODO: Reinstate this test once b/435359906 is fixed") fun taskBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(navBarMatcher) 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 Diff line number Diff line Loading @@ -140,6 +140,7 @@ test_module_config { "com.android.wm.shell.functional.fundamentals.focus.DragAndKeepFocusTest", "com.android.wm.shell.functional.fundamentals.focus.MoveToNextDisplayAndFocusTest", "com.android.wm.shell.functional.fundamentals.focus.OpenAndFocusTest", "com.android.wm.shell.functional.immersive.EnterImmersiveViaHeaderMenuTest", "com.android.wm.shell.functional.keyboardshortcuts.EnterDesktopFromKeyboardShortcutTest", "com.android.wm.shell.functional.keyboardshortcuts.ExitDesktopFromKeyboardShortcutTest", "com.android.wm.shell.functional.keyboardshortcuts.OpenAppFromAllAppsUsingKeyboardTest", Loading Loading @@ -501,6 +502,13 @@ test_module_config { include_filters: ["com.android.wm.shell.functional.fundamentals.focus.OpenAndFocusTest"], } test_module_config { name: "FunctionalTestsDesktopMode-immersive-EnterImmersiveViaHeaderMenuTest", base: "FunctionalTestsDesktopMode", test_suites: ["device-tests"], include_filters: ["com.android.wm.shell.functional.immersive.EnterImmersiveViaHeaderMenuTest"], } test_module_config { name: "FunctionalTestsDesktopMode-keyboardshortcuts-EnterDesktopFromKeyboardShortcutTest", base: "FunctionalTestsDesktopMode", Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/TEST_MAPPING +3 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ { "name": "FunctionalTestsDesktopMode-fundamentals-focus-OpenAndFocusTest" }, { "name": "FunctionalTestsDesktopMode-immersive-EnterImmersiveViaHeaderMenuTest" }, { "name": "FunctionalTestsDesktopMode-keyboardshortcuts-EnterDesktopFromKeyboardShortcutTest" }, Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/immersive/EnterImmersiveViaHeaderMenuTest.kt 0 → 100644 +31 −0 Original line number 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.immersive import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDesktopDevice import android.platform.test.rule.ScreenRecordRule import com.android.wm.shell.scenarios.EnterImmersiveViaHeaderMenu import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner /* Functional test for [EnterImmersiveViaHeaderMenuTest]. */ @RunWith(BlockJUnit4ClassRunner::class) @RequiresDesktopDevice @Presubmit @ScreenRecordRule.ScreenRecord class EnterImmersiveViaHeaderMenuTest : EnterImmersiveViaHeaderMenu()