Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,7 @@ class DesktopModeFlickerScenarios { TaggedCujTransitionMatcher(associatedTransitionRequired = false) TaggedCujTransitionMatcher(associatedTransitionRequired = false) ) ) .build(), .build(), // TODO(373638597) Add AppLayerIncreasesInSize assertion assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS ) ) Loading Loading @@ -208,7 +209,7 @@ class DesktopModeFlickerScenarios { assertions = assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + listOf( listOf( AppLayerIncreasesInSize(DESKTOP_MODE_APP), // TODO(373638597) Add AppLayerIncreasesInSize assertion AppWindowHasMaxDisplayHeight(DESKTOP_MODE_APP), AppWindowHasMaxDisplayHeight(DESKTOP_MODE_APP), AppWindowHasMaxDisplayWidth(DESKTOP_MODE_APP) AppWindowHasMaxDisplayWidth(DESKTOP_MODE_APP) ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -24,7 +24,7 @@ import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.scenarios.ResizeAppWithCornerResize import com.android.wm.shell.scenarios.MaximiseAppWithCornerResize import org.junit.Test import org.junit.Test import org.junit.runner.RunWith import org.junit.runner.RunWith Loading @@ -35,7 +35,7 @@ import org.junit.runner.RunWith * Assert that the maximum window size constraint is maintained. * Assert that the maximum window size constraint is maintained. */ */ @RunWith(FlickerServiceJUnit4ClassRunner::class) @RunWith(FlickerServiceJUnit4ClassRunner::class) class ResizeAppToMaximumWindowSizeLandscape : ResizeAppWithCornerResize( class ResizeAppToMaximumWindowSizeLandscape : MaximiseAppWithCornerResize( rotation = Rotation.ROTATION_90 rotation = Rotation.ROTATION_90 ) { ) { @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.scenarios.ResizeAppWithCornerResize import com.android.wm.shell.scenarios.MaximiseAppWithCornerResize import org.junit.Test import org.junit.Test import org.junit.runner.RunWith import org.junit.runner.RunWith Loading @@ -34,7 +34,7 @@ import org.junit.runner.RunWith * Assert that the maximum window size constraint is maintained. * Assert that the maximum window size constraint is maintained. */ */ @RunWith(FlickerServiceJUnit4ClassRunner::class) @RunWith(FlickerServiceJUnit4ClassRunner::class) class ResizeAppToMaximumWindowSizePortrait : ResizeAppWithCornerResize() { class ResizeAppToMaximumWindowSizePortrait : MaximiseAppWithCornerResize() { @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) @Test @Test override fun resizeAppWithCornerResizeToMaximumSize() = override fun resizeAppWithCornerResizeToMaximumSize() = Loading libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximiseAppWithCornerResize.kt 0 → 100644 +94 −0 Original line number Original line 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.tools.NavBar import android.tools.Rotation import android.tools.flicker.rules.ChangeDisplayOrientationRule 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.DesktopModeAppHelper.AppProperty 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.Ignore import org.junit.Rule import org.junit.Test @Ignore("Test Base Class") abstract class MaximiseAppWithCornerResize( val rotation: Rotation = Rotation.ROTATION_0, val appProperty: AppProperty = AppProperty.STANDARD ) { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() private val tapl = LauncherInstrumentation() private val wmHelper = WindowManagerStateHelper(instrumentation) private val device = UiDevice.getInstance(instrumentation) private val maxResizeChange = 3000 private val testApp = DesktopModeAppHelper( when (appProperty) { AppProperty.STANDARD -> SimpleAppHelper(instrumentation) AppProperty.NON_RESIZABLE -> NonResizeableAppHelper(instrumentation) } ) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation) @Before fun setup() { Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) tapl.setEnableRotation(true) tapl.setExpectedRotation(rotation.value) ChangeDisplayOrientationRule.setRotation(rotation) testApp.enterDesktopWithDrag(wmHelper, device) testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.RIGHT_TOP, maxResizeChange, -maxResizeChange ) } @Test open fun resizeAppWithCornerResizeToMaximumSize() { testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.LEFT_BOTTOM, -maxResizeChange, maxResizeChange ) } @After fun teardown() { testApp.exit(wmHelper) } } libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt +3 −26 Original line number Original line Diff line number Diff line Loading @@ -19,11 +19,13 @@ package com.android.wm.shell.scenarios import android.app.Instrumentation import android.app.Instrumentation import android.tools.NavBar import android.tools.NavBar import android.tools.Rotation import android.tools.Rotation import android.tools.flicker.rules.ChangeDisplayOrientationRule import android.tools.traces.parsers.WindowManagerStateHelper import android.tools.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.UiDevice import com.android.launcher3.tapl.LauncherInstrumentation import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.DesktopModeAppHelper.AppProperty import com.android.server.wm.flicker.helpers.NonResizeableAppHelper import com.android.server.wm.flicker.helpers.NonResizeableAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.window.flags.Flags import com.android.window.flags.Flags Loading Loading @@ -63,6 +65,7 @@ abstract class ResizeAppWithCornerResize( fun setup() { fun setup() { Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) tapl.setEnableRotation(true) tapl.setEnableRotation(true) ChangeDisplayOrientationRule.setRotation(rotation) tapl.setExpectedRotation(rotation.value) tapl.setExpectedRotation(rotation.value) testApp.enterDesktopWithDrag(wmHelper, device) testApp.enterDesktopWithDrag(wmHelper, device) } } Loading @@ -78,34 +81,8 @@ abstract class ResizeAppWithCornerResize( ) ) } } @Test open fun resizeAppWithCornerResizeToMaximumSize() { val maxResizeChange = 3000 testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.RIGHT_TOP, maxResizeChange, -maxResizeChange ) testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.LEFT_BOTTOM, -maxResizeChange, maxResizeChange ) } @After @After fun teardown() { fun teardown() { testApp.exit(wmHelper) testApp.exit(wmHelper) } } companion object { enum class AppProperty { STANDARD, NON_RESIZABLE } } } } Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,7 @@ class DesktopModeFlickerScenarios { TaggedCujTransitionMatcher(associatedTransitionRequired = false) TaggedCujTransitionMatcher(associatedTransitionRequired = false) ) ) .build(), .build(), // TODO(373638597) Add AppLayerIncreasesInSize assertion assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS ) ) Loading Loading @@ -208,7 +209,7 @@ class DesktopModeFlickerScenarios { assertions = assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + listOf( listOf( AppLayerIncreasesInSize(DESKTOP_MODE_APP), // TODO(373638597) Add AppLayerIncreasesInSize assertion AppWindowHasMaxDisplayHeight(DESKTOP_MODE_APP), AppWindowHasMaxDisplayHeight(DESKTOP_MODE_APP), AppWindowHasMaxDisplayWidth(DESKTOP_MODE_APP) AppWindowHasMaxDisplayWidth(DESKTOP_MODE_APP) ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -24,7 +24,7 @@ import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.scenarios.ResizeAppWithCornerResize import com.android.wm.shell.scenarios.MaximiseAppWithCornerResize import org.junit.Test import org.junit.Test import org.junit.runner.RunWith import org.junit.runner.RunWith Loading @@ -35,7 +35,7 @@ import org.junit.runner.RunWith * Assert that the maximum window size constraint is maintained. * Assert that the maximum window size constraint is maintained. */ */ @RunWith(FlickerServiceJUnit4ClassRunner::class) @RunWith(FlickerServiceJUnit4ClassRunner::class) class ResizeAppToMaximumWindowSizeLandscape : ResizeAppWithCornerResize( class ResizeAppToMaximumWindowSizeLandscape : MaximiseAppWithCornerResize( rotation = Rotation.ROTATION_90 rotation = Rotation.ROTATION_90 ) { ) { @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.tools.flicker.config.FlickerConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.config.FlickerServiceConfig import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE import com.android.wm.shell.scenarios.ResizeAppWithCornerResize import com.android.wm.shell.scenarios.MaximiseAppWithCornerResize import org.junit.Test import org.junit.Test import org.junit.runner.RunWith import org.junit.runner.RunWith Loading @@ -34,7 +34,7 @@ import org.junit.runner.RunWith * Assert that the maximum window size constraint is maintained. * Assert that the maximum window size constraint is maintained. */ */ @RunWith(FlickerServiceJUnit4ClassRunner::class) @RunWith(FlickerServiceJUnit4ClassRunner::class) class ResizeAppToMaximumWindowSizePortrait : ResizeAppWithCornerResize() { class ResizeAppToMaximumWindowSizePortrait : MaximiseAppWithCornerResize() { @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"]) @Test @Test override fun resizeAppWithCornerResizeToMaximumSize() = override fun resizeAppWithCornerResizeToMaximumSize() = Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximiseAppWithCornerResize.kt 0 → 100644 +94 −0 Original line number Original line 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.tools.NavBar import android.tools.Rotation import android.tools.flicker.rules.ChangeDisplayOrientationRule 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.DesktopModeAppHelper.AppProperty 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.Ignore import org.junit.Rule import org.junit.Test @Ignore("Test Base Class") abstract class MaximiseAppWithCornerResize( val rotation: Rotation = Rotation.ROTATION_0, val appProperty: AppProperty = AppProperty.STANDARD ) { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() private val tapl = LauncherInstrumentation() private val wmHelper = WindowManagerStateHelper(instrumentation) private val device = UiDevice.getInstance(instrumentation) private val maxResizeChange = 3000 private val testApp = DesktopModeAppHelper( when (appProperty) { AppProperty.STANDARD -> SimpleAppHelper(instrumentation) AppProperty.NON_RESIZABLE -> NonResizeableAppHelper(instrumentation) } ) @Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation) @Before fun setup() { Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) tapl.setEnableRotation(true) tapl.setExpectedRotation(rotation.value) ChangeDisplayOrientationRule.setRotation(rotation) testApp.enterDesktopWithDrag(wmHelper, device) testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.RIGHT_TOP, maxResizeChange, -maxResizeChange ) } @Test open fun resizeAppWithCornerResizeToMaximumSize() { testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.LEFT_BOTTOM, -maxResizeChange, maxResizeChange ) } @After fun teardown() { testApp.exit(wmHelper) } }
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt +3 −26 Original line number Original line Diff line number Diff line Loading @@ -19,11 +19,13 @@ package com.android.wm.shell.scenarios import android.app.Instrumentation import android.app.Instrumentation import android.tools.NavBar import android.tools.NavBar import android.tools.Rotation import android.tools.Rotation import android.tools.flicker.rules.ChangeDisplayOrientationRule import android.tools.traces.parsers.WindowManagerStateHelper import android.tools.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.UiDevice import com.android.launcher3.tapl.LauncherInstrumentation import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.DesktopModeAppHelper.AppProperty import com.android.server.wm.flicker.helpers.NonResizeableAppHelper import com.android.server.wm.flicker.helpers.NonResizeableAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.window.flags.Flags import com.android.window.flags.Flags Loading Loading @@ -63,6 +65,7 @@ abstract class ResizeAppWithCornerResize( fun setup() { fun setup() { Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet) tapl.setEnableRotation(true) tapl.setEnableRotation(true) ChangeDisplayOrientationRule.setRotation(rotation) tapl.setExpectedRotation(rotation.value) tapl.setExpectedRotation(rotation.value) testApp.enterDesktopWithDrag(wmHelper, device) testApp.enterDesktopWithDrag(wmHelper, device) } } Loading @@ -78,34 +81,8 @@ abstract class ResizeAppWithCornerResize( ) ) } } @Test open fun resizeAppWithCornerResizeToMaximumSize() { val maxResizeChange = 3000 testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.RIGHT_TOP, maxResizeChange, -maxResizeChange ) testApp.cornerResize( wmHelper, device, DesktopModeAppHelper.Corners.LEFT_BOTTOM, -maxResizeChange, maxResizeChange ) } @After @After fun teardown() { fun teardown() { testApp.exit(wmHelper) testApp.exit(wmHelper) } } companion object { enum class AppProperty { STANDARD, NON_RESIZABLE } } } }