From e74d47839ab4747ae7d125bc147c5dbbb520edce Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Thu, 24 Feb 2022 10:21:28 +0100 Subject: Fix wait condition for SetRequestedOrientationWhilePinnedTest The setup waited for a ROTATION_0, but this test starts at ROTATION_90 Bug: 219773854 Bug: 220977327 Test: atest WMShellFlickerTests:SetRequestedOrientationWhilePinnedTest Change-Id: Ib2bde1f66f248adbe69acf5c344322e32b364eb2 --- .../flicker/pip/SetRequestedOrientationWhilePinnedTest.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libs/WindowManager/Shell') diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt index 159caee506f0..f7384e742a04 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt @@ -25,8 +25,11 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group4 import com.android.server.wm.flicker.dsl.FlickerBuilder +import com.android.server.wm.flicker.helpers.setRotation +import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled +import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE import com.android.wm.shell.flicker.testapp.Components import com.android.wm.shell.flicker.testapp.Components.FixedActivity.EXTRA_FIXED_ORIENTATION @@ -61,9 +64,11 @@ open class SetRequestedOrientationWhilePinnedTest( override val transition: FlickerBuilder.() -> Unit get() = { - setupAndTeardown(this) - setup { + test { + removeAllTasksButHome() + device.wakeUpAndGoToHomeScreen() + } eachRun { // Launch the PiP activity fixed as landscape. pipApp.launchViaIntent(wmHelper, stringExtras = mapOf( @@ -80,6 +85,10 @@ open class SetRequestedOrientationWhilePinnedTest( teardown { eachRun { pipApp.exit(wmHelper) + setRotation(Surface.ROTATION_0) + } + test { + removeAllTasksButHome() } } transitions { -- cgit v1.2.3-59-g8ed1b