Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestSupportPairNonResizeableApps.kt +14 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.flicker.apppairs import android.platform.test.annotations.Presubmit import android.view.Display import androidx.test.filters.FlakyTest import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerParametersRunnerFactory Loading @@ -24,6 +25,7 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group1 import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.traces.common.WindowManagerConditionsFactory import com.android.wm.shell.flicker.appPairsDividerIsVisibleAtEnd import com.android.wm.shell.flicker.helpers.AppPairsHelper import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig Loading Loading @@ -60,7 +62,18 @@ class AppPairsTestSupportPairNonResizeableApps( // TODO pair apps through normal UX flow executeShellCommand( composePairsCommand(primaryTaskId, nonResizeableTaskId, pair = true)) nonResizeableApp?.run { wmHelper.waitForFullScreenApp(nonResizeableApp.component) } val waitConditions = mutableListOf( WindowManagerConditionsFactory.isWindowVisible(primaryApp.component), WindowManagerConditionsFactory.isLayerVisible(primaryApp.component), WindowManagerConditionsFactory.isAppTransitionIdle(Display.DEFAULT_DISPLAY)) nonResizeableApp?.let { waitConditions.add( WindowManagerConditionsFactory.isWindowVisible(nonResizeableApp.component)) waitConditions.add( WindowManagerConditionsFactory.isLayerVisible(nonResizeableApp.component)) } wmHelper.waitFor(*waitConditions.toTypedArray()) } } Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/ImeAppHelper.kt +2 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ open class ImeAppHelper(instrumentation: Instrumentation) : BaseAppHelper( if (wmHelper == null) { device.waitForIdle() } else { require(wmHelper.waitImeShown()) { "IME did not appear" } wmHelper.waitImeShown() } } Loading @@ -79,7 +79,7 @@ open class ImeAppHelper(instrumentation: Instrumentation) : BaseAppHelper( if (wmHelper == null) { uiDevice.waitForIdle() } else { require(wmHelper.waitImeGone()) { "IME did did not close" } wmHelper.waitImeGone() } } else { // While pressing the back button should close the IME on TV as well, it may also lead Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt +16 −6 Original line number Diff line number Diff line Loading @@ -58,17 +58,27 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( } } /** {@inheritDoc} */ override fun launchViaIntent( /** * Launches the app through an intent instead of interacting with the launcher and waits * until the app window is in PIP mode */ @JvmOverloads fun launchViaIntentAndWaitForPip( wmHelper: WindowManagerStateHelper, expectedWindowName: String, action: String?, expectedWindowName: String = "", action: String? = null, stringExtras: Map<String, String> ) { super.launchViaIntent(wmHelper, expectedWindowName, action, stringExtras) wmHelper.waitPipShown() launchViaIntentAndWaitShown(wmHelper, expectedWindowName, action, stringExtras, waitConditions = arrayOf(WindowManagerStateHelper.pipShownCondition)) } /** * Expand the PIP window back to full screen via intent and wait until the app is visible */ fun exitPipToFullScreenViaIntent(wmHelper: WindowManagerStateHelper) = launchViaIntentAndWaitShown(wmHelper) private fun focusOnObject(selector: BySelector): Boolean { // We expect all the focusable UI elements to be arranged in a way so that it is possible // to "cycle" over all them by clicking the D-Pad DOWN button, going back up to "the top" Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt +12 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,18 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) { * Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit get() = buildTransition(eachRun = true, stringExtras = emptyMap()) { get() = { setupAndTeardown(this) setup { eachRun { pipApp.launchViaIntent(wmHelper) } } teardown { eachRun { pipApp.exit(wmHelper) } } transitions { pipApp.clickEnterPipButton(wmHelper) } Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ class ExitPipViaExpandButtonClickTest( // This will bring PipApp to fullscreen pipApp.expandPipWindowToApp(wmHelper) // Wait until the other app is no longer visible wmHelper.waitForSurfaceAppeared(testApp.component.toWindowName()) wmHelper.waitForSurfaceAppeared(testApp.component) } } Loading Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestSupportPairNonResizeableApps.kt +14 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.flicker.apppairs import android.platform.test.annotations.Presubmit import android.view.Display import androidx.test.filters.FlakyTest import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerParametersRunnerFactory Loading @@ -24,6 +25,7 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group1 import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.traces.common.WindowManagerConditionsFactory import com.android.wm.shell.flicker.appPairsDividerIsVisibleAtEnd import com.android.wm.shell.flicker.helpers.AppPairsHelper import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig Loading Loading @@ -60,7 +62,18 @@ class AppPairsTestSupportPairNonResizeableApps( // TODO pair apps through normal UX flow executeShellCommand( composePairsCommand(primaryTaskId, nonResizeableTaskId, pair = true)) nonResizeableApp?.run { wmHelper.waitForFullScreenApp(nonResizeableApp.component) } val waitConditions = mutableListOf( WindowManagerConditionsFactory.isWindowVisible(primaryApp.component), WindowManagerConditionsFactory.isLayerVisible(primaryApp.component), WindowManagerConditionsFactory.isAppTransitionIdle(Display.DEFAULT_DISPLAY)) nonResizeableApp?.let { waitConditions.add( WindowManagerConditionsFactory.isWindowVisible(nonResizeableApp.component)) waitConditions.add( WindowManagerConditionsFactory.isLayerVisible(nonResizeableApp.component)) } wmHelper.waitFor(*waitConditions.toTypedArray()) } } Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/ImeAppHelper.kt +2 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ open class ImeAppHelper(instrumentation: Instrumentation) : BaseAppHelper( if (wmHelper == null) { device.waitForIdle() } else { require(wmHelper.waitImeShown()) { "IME did not appear" } wmHelper.waitImeShown() } } Loading @@ -79,7 +79,7 @@ open class ImeAppHelper(instrumentation: Instrumentation) : BaseAppHelper( if (wmHelper == null) { uiDevice.waitForIdle() } else { require(wmHelper.waitImeGone()) { "IME did did not close" } wmHelper.waitImeGone() } } else { // While pressing the back button should close the IME on TV as well, it may also lead Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt +16 −6 Original line number Diff line number Diff line Loading @@ -58,17 +58,27 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( } } /** {@inheritDoc} */ override fun launchViaIntent( /** * Launches the app through an intent instead of interacting with the launcher and waits * until the app window is in PIP mode */ @JvmOverloads fun launchViaIntentAndWaitForPip( wmHelper: WindowManagerStateHelper, expectedWindowName: String, action: String?, expectedWindowName: String = "", action: String? = null, stringExtras: Map<String, String> ) { super.launchViaIntent(wmHelper, expectedWindowName, action, stringExtras) wmHelper.waitPipShown() launchViaIntentAndWaitShown(wmHelper, expectedWindowName, action, stringExtras, waitConditions = arrayOf(WindowManagerStateHelper.pipShownCondition)) } /** * Expand the PIP window back to full screen via intent and wait until the app is visible */ fun exitPipToFullScreenViaIntent(wmHelper: WindowManagerStateHelper) = launchViaIntentAndWaitShown(wmHelper) private fun focusOnObject(selector: BySelector): Boolean { // We expect all the focusable UI elements to be arranged in a way so that it is possible // to "cycle" over all them by clicking the D-Pad DOWN button, going back up to "the top" Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt +12 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,18 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) { * Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit get() = buildTransition(eachRun = true, stringExtras = emptyMap()) { get() = { setupAndTeardown(this) setup { eachRun { pipApp.launchViaIntent(wmHelper) } } teardown { eachRun { pipApp.exit(wmHelper) } } transitions { pipApp.clickEnterPipButton(wmHelper) } Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ class ExitPipViaExpandButtonClickTest( // This will bring PipApp to fullscreen pipApp.expandPipWindowToApp(wmHelper) // Wait until the other app is no longer visible wmHelper.waitForSurfaceAppeared(testApp.component.toWindowName()) wmHelper.waitForSurfaceAppeared(testApp.component) } } Loading