Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt +25 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.tools.flicker.assertors.assertions.AppLayerIsInvisibleAtEnd import android.tools.flicker.assertors.assertions.AppLayerIsVisibleAlways import android.tools.flicker.assertors.assertions.AppLayerIsVisibleAtStart import android.tools.flicker.assertors.assertions.AppWindowBecomesVisible import android.tools.flicker.assertors.assertions.AppWindowAlignsWithOnlyOneDisplayCornerAtEnd import android.tools.flicker.assertors.assertions.AppWindowCoversLeftHalfScreenAtEnd import android.tools.flicker.assertors.assertions.AppWindowCoversRightHalfScreenAtEnd import android.tools.flicker.assertors.assertions.AppWindowHasDesktopModeInitialBoundsAtTheEnd Loading @@ -31,6 +32,7 @@ import android.tools.flicker.assertors.assertions.AppWindowHasMaxBoundsInOnlyOne import android.tools.flicker.assertors.assertions.AppWindowHasMaxDisplayHeight import android.tools.flicker.assertors.assertions.AppWindowHasMaxDisplayWidth import android.tools.flicker.assertors.assertions.AppWindowHasSizeOfAtLeast import android.tools.flicker.assertors.assertions.AppWindowInsideDisplayBoundsAtEnd import android.tools.flicker.assertors.assertions.AppWindowIsInvisibleAtEnd import android.tools.flicker.assertors.assertions.AppWindowIsVisibleAlways import android.tools.flicker.assertors.assertions.AppWindowMaintainsAspectRatioAlways Loading Loading @@ -308,5 +310,28 @@ class DesktopModeFlickerScenarios { AppWindowHasMaxBoundsInOnlyOneDimension(DESKTOP_MODE_APP) ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ) val CASCADE_APP = FlickerConfigEntry( scenarioId = ScenarioId("CASCADE_APP"), extractor = ShellTransitionScenarioExtractor( transitionMatcher = object : ITransitionMatcher { override fun findAll( transitions: Collection<Transition> ): Collection<Transition> { return transitions.filter { it.type == TransitionType.OPEN } } } ), assertions = listOf( AppWindowInsideDisplayBoundsAtEnd(DESKTOP_MODE_APP), AppWindowOnTopAtEnd(DESKTOP_MODE_APP), AppWindowBecomesVisible(DESKTOP_MODE_APP), AppWindowAlignsWithOnlyOneDisplayCornerAtEnd(DESKTOP_MODE_APP) ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ) } } libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/OpenAppsInDesktopModeLandscape.kt 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 import android.tools.Rotation.ROTATION_90 import android.tools.flicker.FlickerConfig import android.tools.flicker.annotation.ExpectedScenarios import android.tools.flicker.annotation.FlickerConfigProvider import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CASCADE_APP import com.android.wm.shell.scenarios.OpenAppsInDesktopMode import org.junit.Test import org.junit.runner.RunWith @RunWith(FlickerServiceJUnit4ClassRunner::class) class OpenAppsInDesktopModeLandscape : OpenAppsInDesktopMode(rotation = ROTATION_90) { @ExpectedScenarios(["CASCADE_APP"]) @Test override fun openApps() = super.openApps() companion object { @JvmStatic @FlickerConfigProvider fun flickerConfigProvider(): FlickerConfig = FlickerConfig().use(FlickerServiceConfig.DEFAULT).use(CASCADE_APP) } } No newline at end of file libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/OpenAppsInDesktopModePortrait.kt 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 import android.tools.flicker.FlickerConfig import android.tools.flicker.annotation.ExpectedScenarios import android.tools.flicker.annotation.FlickerConfigProvider import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CASCADE_APP import com.android.wm.shell.scenarios.OpenAppsInDesktopMode import org.junit.Test import org.junit.runner.RunWith @RunWith(FlickerServiceJUnit4ClassRunner::class) class OpenAppsInDesktopModePortrait : OpenAppsInDesktopMode() { @ExpectedScenarios(["CASCADE_APP"]) @Test override fun openApps() = super.openApps() companion object { @JvmStatic @FlickerConfigProvider fun flickerConfigProvider(): FlickerConfig = FlickerConfig().use(FlickerServiceConfig.DEFAULT).use(CASCADE_APP) } } No newline at end of file libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/OpenAppsInDesktopMode.kt 0 → 100644 +86 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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.scenarios import android.app.Instrumentation import android.platform.test.annotations.Postsubmit import android.tools.flicker.rules.ChangeDisplayOrientationRule import android.tools.NavBar import android.tools.Rotation import android.tools.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.ImeAppHelper import com.android.server.wm.flicker.helpers.MailAppHelper import com.android.server.wm.flicker.helpers.NewTasksAppHelper import com.android.server.wm.flicker.helpers.NonResizeableAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.window.flags.Flags import com.android.wm.shell.Utils import org.junit.After import org.junit.Assume import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner @RunWith(BlockJUnit4ClassRunner::class) @Postsubmit open class OpenAppsInDesktopMode(val rotation: Rotation = Rotation.ROTATION_0) { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() private val tapl = LauncherInstrumentation() private val wmHelper = WindowManagerStateHelper(instrumentation) private val device = UiDevice.getInstance(instrumentation) private val firstApp = DesktopModeAppHelper(SimpleAppHelper(instrumentation)) private val secondApp = MailAppHelper(instrumentation) private val thirdApp = NewTasksAppHelper(instrumentation) private val fourthApp = ImeAppHelper(instrumentation) private val fifthApp = NonResizeableAppHelper(instrumentation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_3BUTTON, rotation) @Before fun setup() { Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) tapl.setEnableRotation(true) tapl.setExpectedRotation(rotation.value) tapl.enableTransientTaskbar(false) ChangeDisplayOrientationRule.setRotation(rotation) firstApp.enterDesktopWithDrag(wmHelper, device) } @Test open fun openApps() { secondApp.launchViaIntent(wmHelper) thirdApp.launchViaIntent(wmHelper) fourthApp.launchViaIntent(wmHelper) fifthApp.launchViaIntent(wmHelper) } @After fun teardown() { fifthApp.exit(wmHelper) fourthApp.exit(wmHelper) thirdApp.exit(wmHelper) secondApp.exit(wmHelper) firstApp.exit(wmHelper) } } No newline at end of file Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt +25 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.tools.flicker.assertors.assertions.AppLayerIsInvisibleAtEnd import android.tools.flicker.assertors.assertions.AppLayerIsVisibleAlways import android.tools.flicker.assertors.assertions.AppLayerIsVisibleAtStart import android.tools.flicker.assertors.assertions.AppWindowBecomesVisible import android.tools.flicker.assertors.assertions.AppWindowAlignsWithOnlyOneDisplayCornerAtEnd import android.tools.flicker.assertors.assertions.AppWindowCoversLeftHalfScreenAtEnd import android.tools.flicker.assertors.assertions.AppWindowCoversRightHalfScreenAtEnd import android.tools.flicker.assertors.assertions.AppWindowHasDesktopModeInitialBoundsAtTheEnd Loading @@ -31,6 +32,7 @@ import android.tools.flicker.assertors.assertions.AppWindowHasMaxBoundsInOnlyOne import android.tools.flicker.assertors.assertions.AppWindowHasMaxDisplayHeight import android.tools.flicker.assertors.assertions.AppWindowHasMaxDisplayWidth import android.tools.flicker.assertors.assertions.AppWindowHasSizeOfAtLeast import android.tools.flicker.assertors.assertions.AppWindowInsideDisplayBoundsAtEnd import android.tools.flicker.assertors.assertions.AppWindowIsInvisibleAtEnd import android.tools.flicker.assertors.assertions.AppWindowIsVisibleAlways import android.tools.flicker.assertors.assertions.AppWindowMaintainsAspectRatioAlways Loading Loading @@ -308,5 +310,28 @@ class DesktopModeFlickerScenarios { AppWindowHasMaxBoundsInOnlyOneDimension(DESKTOP_MODE_APP) ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ) val CASCADE_APP = FlickerConfigEntry( scenarioId = ScenarioId("CASCADE_APP"), extractor = ShellTransitionScenarioExtractor( transitionMatcher = object : ITransitionMatcher { override fun findAll( transitions: Collection<Transition> ): Collection<Transition> { return transitions.filter { it.type == TransitionType.OPEN } } } ), assertions = listOf( AppWindowInsideDisplayBoundsAtEnd(DESKTOP_MODE_APP), AppWindowOnTopAtEnd(DESKTOP_MODE_APP), AppWindowBecomesVisible(DESKTOP_MODE_APP), AppWindowAlignsWithOnlyOneDisplayCornerAtEnd(DESKTOP_MODE_APP) ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ) } }
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/OpenAppsInDesktopModeLandscape.kt 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 import android.tools.Rotation.ROTATION_90 import android.tools.flicker.FlickerConfig import android.tools.flicker.annotation.ExpectedScenarios import android.tools.flicker.annotation.FlickerConfigProvider import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CASCADE_APP import com.android.wm.shell.scenarios.OpenAppsInDesktopMode import org.junit.Test import org.junit.runner.RunWith @RunWith(FlickerServiceJUnit4ClassRunner::class) class OpenAppsInDesktopModeLandscape : OpenAppsInDesktopMode(rotation = ROTATION_90) { @ExpectedScenarios(["CASCADE_APP"]) @Test override fun openApps() = super.openApps() companion object { @JvmStatic @FlickerConfigProvider fun flickerConfigProvider(): FlickerConfig = FlickerConfig().use(FlickerServiceConfig.DEFAULT).use(CASCADE_APP) } } No newline at end of file
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/OpenAppsInDesktopModePortrait.kt 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 import android.tools.flicker.FlickerConfig import android.tools.flicker.annotation.ExpectedScenarios import android.tools.flicker.annotation.FlickerConfigProvider import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CASCADE_APP import com.android.wm.shell.scenarios.OpenAppsInDesktopMode import org.junit.Test import org.junit.runner.RunWith @RunWith(FlickerServiceJUnit4ClassRunner::class) class OpenAppsInDesktopModePortrait : OpenAppsInDesktopMode() { @ExpectedScenarios(["CASCADE_APP"]) @Test override fun openApps() = super.openApps() companion object { @JvmStatic @FlickerConfigProvider fun flickerConfigProvider(): FlickerConfig = FlickerConfig().use(FlickerServiceConfig.DEFAULT).use(CASCADE_APP) } } No newline at end of file
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/OpenAppsInDesktopMode.kt 0 → 100644 +86 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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.scenarios import android.app.Instrumentation import android.platform.test.annotations.Postsubmit import android.tools.flicker.rules.ChangeDisplayOrientationRule import android.tools.NavBar import android.tools.Rotation import android.tools.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.ImeAppHelper import com.android.server.wm.flicker.helpers.MailAppHelper import com.android.server.wm.flicker.helpers.NewTasksAppHelper import com.android.server.wm.flicker.helpers.NonResizeableAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.window.flags.Flags import com.android.wm.shell.Utils import org.junit.After import org.junit.Assume import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner @RunWith(BlockJUnit4ClassRunner::class) @Postsubmit open class OpenAppsInDesktopMode(val rotation: Rotation = Rotation.ROTATION_0) { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() private val tapl = LauncherInstrumentation() private val wmHelper = WindowManagerStateHelper(instrumentation) private val device = UiDevice.getInstance(instrumentation) private val firstApp = DesktopModeAppHelper(SimpleAppHelper(instrumentation)) private val secondApp = MailAppHelper(instrumentation) private val thirdApp = NewTasksAppHelper(instrumentation) private val fourthApp = ImeAppHelper(instrumentation) private val fifthApp = NonResizeableAppHelper(instrumentation) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_3BUTTON, rotation) @Before fun setup() { Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) tapl.setEnableRotation(true) tapl.setExpectedRotation(rotation.value) tapl.enableTransientTaskbar(false) ChangeDisplayOrientationRule.setRotation(rotation) firstApp.enterDesktopWithDrag(wmHelper, device) } @Test open fun openApps() { secondApp.launchViaIntent(wmHelper) thirdApp.launchViaIntent(wmHelper) fourthApp.launchViaIntent(wmHelper) fifthApp.launchViaIntent(wmHelper) } @After fun teardown() { fifthApp.exit(wmHelper) fourthApp.exit(wmHelper) thirdApp.exit(wmHelper) secondApp.exit(wmHelper) firstApp.exit(wmHelper) } } No newline at end of file