Merge "Refactor the buildTransitions into overridable functions" into udc-dev

This commit is contained in:
Mateusz Cicheński
2023-06-01 17:59:03 +00:00
committed by Android (Google) Code Review
20 changed files with 245 additions and 250 deletions

View File

@@ -16,7 +16,6 @@
package com.android.wm.shell.flicker.pip package com.android.wm.shell.flicker.pip
import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit import android.platform.test.annotations.Presubmit
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerBuilder
@@ -55,19 +54,23 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
class AutoEnterPipOnGoToHomeTest(flicker: FlickerTest) : EnterPipViaAppUiButtonTest(flicker) { class AutoEnterPipOnGoToHomeTest(flicker: FlickerTest) : EnterPipViaAppUiButtonTest(flicker) {
/** Defines the transition used to run the test */ override val thisTransition: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit transitions { tapl.goHome() }
get() = { }
override val defaultEnterPip: FlickerBuilder.() -> Unit = {
setup { setup {
pipApp.launchViaIntent(wmHelper) pipApp.launchViaIntent(wmHelper)
pipApp.enableAutoEnterForPipActivity() pipApp.enableAutoEnterForPipActivity()
} }
}
override val defaultTeardown: FlickerBuilder.() -> Unit = {
teardown { teardown {
// close gracefully so that onActivityUnpinned() can be called before force exit // close gracefully so that onActivityUnpinned() can be called before force exit
pipApp.closePipWindow(wmHelper) pipApp.closePipWindow(wmHelper)
pipApp.exit(wmHelper) pipApp.exit(wmHelper)
} }
transitions { tapl.goHome() }
} }
@Presubmit @Presubmit

View File

@@ -54,9 +54,7 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class ClosePipBySwipingDownTest(flicker: FlickerTest) : ClosePipTransition(flicker) { open class ClosePipBySwipingDownTest(flicker: FlickerTest) : ClosePipTransition(flicker) {
override val transition: FlickerBuilder.() -> Unit override val thisTransition: FlickerBuilder.() -> Unit = {
get() = {
super.transition(this)
transitions { transitions {
val pipRegion = wmHelper.getWindowRegion(pipApp).bounds val pipRegion = wmHelper.getWindowRegion(pipApp).bounds
val pipCenterX = pipRegion.centerX() val pipCenterX = pipRegion.centerX()

View File

@@ -28,8 +28,7 @@ import org.junit.runners.Parameterized
/** Base class for exiting pip (closing pip window) without returning to the app */ /** Base class for exiting pip (closing pip window) without returning to the app */
abstract class ClosePipTransition(flicker: FlickerTest) : PipTransition(flicker) { abstract class ClosePipTransition(flicker: FlickerTest) : PipTransition(flicker) {
override val transition: FlickerBuilder.() -> Unit override val thisTransition: FlickerBuilder.() -> Unit = {
get() = buildTransition {
setup { this.setRotation(flicker.scenario.startRotation) } setup { this.setRotation(flicker.scenario.startRotation) }
teardown { this.setRotation(Rotation.ROTATION_0) } teardown { this.setRotation(Rotation.ROTATION_0) }
} }

View File

@@ -54,10 +54,7 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class ClosePipWithDismissButtonTest(flicker: FlickerTest) : ClosePipTransition(flicker) { open class ClosePipWithDismissButtonTest(flicker: FlickerTest) : ClosePipTransition(flicker) {
override val thisTransition: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit
get() = {
super.transition(this)
transitions { pipApp.closePipWindow(wmHelper) } transitions { pipApp.closePipWindow(wmHelper) }
} }

View File

@@ -45,19 +45,23 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTransition(flicker) { open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTransition(flicker) {
/** Defines the transition used to run the test */ override val thisTransition: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit transitions { tapl.goHome() }
get() = { }
override val defaultEnterPip: FlickerBuilder.() -> Unit = {
setup { setup {
pipApp.launchViaIntent(wmHelper) pipApp.launchViaIntent(wmHelper)
pipApp.enableEnterPipOnUserLeaveHint() pipApp.enableEnterPipOnUserLeaveHint()
} }
}
override val defaultTeardown: FlickerBuilder.() -> Unit = {
teardown { teardown {
// close gracefully so that onActivityUnpinned() can be called before force exit // close gracefully so that onActivityUnpinned() can be called before force exit
pipApp.closePipWindow(wmHelper) pipApp.closePipWindow(wmHelper)
pipApp.exit(wmHelper) pipApp.exit(wmHelper)
} }
transitions { tapl.goHome() }
} }
@Presubmit @Presubmit

View File

@@ -73,24 +73,8 @@ open class EnterPipToOtherOrientation(flicker: FlickerTest) : PipTransition(flic
private val startingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_90) private val startingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_90)
private val endingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_0) private val endingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_0)
/** Defines the transition used to run the test */ override val thisTransition: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit
get() = {
setup {
// Launch a portrait only app on the fullscreen stack
testApp.launchViaIntent(
wmHelper,
stringExtras = mapOf(EXTRA_FIXED_ORIENTATION to ORIENTATION_PORTRAIT.toString())
)
// Launch the PiP activity fixed as landscape
pipApp.launchViaIntent(
wmHelper,
stringExtras =
mapOf(EXTRA_FIXED_ORIENTATION to ORIENTATION_LANDSCAPE.toString())
)
}
teardown { teardown {
pipApp.exit(wmHelper)
testApp.exit(wmHelper) testApp.exit(wmHelper)
} }
transitions { transitions {
@@ -107,6 +91,22 @@ open class EnterPipToOtherOrientation(flicker: FlickerTest) : PipTransition(flic
} }
} }
override val defaultEnterPip: FlickerBuilder.() -> Unit = {
setup {
// Launch a portrait only app on the fullscreen stack
testApp.launchViaIntent(
wmHelper,
stringExtras = mapOf(EXTRA_FIXED_ORIENTATION to ORIENTATION_PORTRAIT.toString())
)
// Launch the PiP activity fixed as landscape, but don't enter PiP
pipApp.launchViaIntent(
wmHelper,
stringExtras =
mapOf(EXTRA_FIXED_ORIENTATION to ORIENTATION_LANDSCAPE.toString())
)
}
}
/** /**
* This test is not compatible with Tablets. When using [Activity.setRequestedOrientation] to * This test is not compatible with Tablets. When using [Activity.setRequestedOrientation] to
* fix a orientation, Tablets instead keep the same orientation and add letterboxes * fix a orientation, Tablets instead keep the same orientation and add letterboxes

View File

@@ -26,11 +26,10 @@ import org.junit.Test
import org.junit.runners.Parameterized import org.junit.runners.Parameterized
abstract class EnterPipTransition(flicker: FlickerTest) : PipTransition(flicker) { abstract class EnterPipTransition(flicker: FlickerTest) : PipTransition(flicker) {
/** {@inheritDoc} */ override val defaultEnterPip: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit setup {
get() = { pipApp.launchViaIntent(wmHelper)
setup { pipApp.launchViaIntent(wmHelper) } }
teardown { pipApp.exit(wmHelper) }
} }
/** Checks [pipApp] window remains visible throughout the animation */ /** Checks [pipApp] window remains visible throughout the animation */

View File

@@ -51,11 +51,7 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class EnterPipViaAppUiButtonTest(flicker: FlickerTest) : EnterPipTransition(flicker) { open class EnterPipViaAppUiButtonTest(flicker: FlickerTest) : EnterPipTransition(flicker) {
override val thisTransition: FlickerBuilder.() -> Unit = {
/** {@inheritDoc} */
override val transition: FlickerBuilder.() -> Unit
get() = {
super.transition(this)
transitions { pipApp.clickEnterPipButton(wmHelper) } transitions { pipApp.clickEnterPipButton(wmHelper) }
} }
} }

View File

@@ -53,10 +53,7 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class ExitPipToAppViaExpandButtonTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) { open class ExitPipToAppViaExpandButtonTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
override val thisTransition: FlickerBuilder.() -> Unit = {
/** Defines the transition used to run the test */
override val transition: FlickerBuilder.() -> Unit
get() = buildTransition {
setup { setup {
// launch an app behind the pip one // launch an app behind the pip one
testApp.launchViaIntent(wmHelper) testApp.launchViaIntent(wmHelper)

View File

@@ -52,10 +52,7 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class ExitPipToAppViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) { open class ExitPipToAppViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
override val thisTransition: FlickerBuilder.() -> Unit = {
/** Defines the transition used to run the test */
override val transition: FlickerBuilder.() -> Unit
get() = buildTransition {
setup { setup {
// launch an app behind the pip one // launch an app behind the pip one
testApp.launchViaIntent(wmHelper) testApp.launchViaIntent(wmHelper)

View File

@@ -56,8 +56,9 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class ExpandPipOnDoubleClickTest(flicker: FlickerTest) : PipTransition(flicker) { open class ExpandPipOnDoubleClickTest(flicker: FlickerTest) : PipTransition(flicker) {
override val transition: FlickerBuilder.() -> Unit override val thisTransition: FlickerBuilder.() -> Unit = {
get() = buildTransition { transitions { pipApp.doubleClickPipWindow(wmHelper) } } transitions { pipApp.doubleClickPipWindow(wmHelper) }
}
/** /**
* Checks that the pip app window remains inside the display bounds throughout the whole * Checks that the pip app window remains inside the display bounds throughout the whole

View File

@@ -35,8 +35,9 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class ExpandPipOnPinchOpenTest(flicker: FlickerTest) : PipTransition(flicker) { open class ExpandPipOnPinchOpenTest(flicker: FlickerTest) : PipTransition(flicker) {
override val transition: FlickerBuilder.() -> Unit override val thisTransition: FlickerBuilder.() -> Unit = {
get() = buildTransition { transitions { pipApp.pinchOpenPipWindow(wmHelper, 0.25f, 30) } } transitions { pipApp.pinchOpenPipWindow(wmHelper, 0.25f, 30) }
}
/** Checks that the visible region area of [pipApp] always increases during the animation. */ /** Checks that the visible region area of [pipApp] always increases during the animation. */
@Presubmit @Presubmit

View File

@@ -56,13 +56,8 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
class MovePipDownOnShelfHeightChange(flicker: FlickerTest) : MovePipShelfHeightTransition(flicker) { class MovePipDownOnShelfHeightChange(flicker: FlickerTest) : MovePipShelfHeightTransition(flicker) {
/** Defines the transition used to run the test */ override val thisTransition: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit teardown { testApp.exit(wmHelper) }
get() = buildTransition {
teardown {
tapl.pressHome()
testApp.exit(wmHelper)
}
transitions { testApp.launchViaIntent(wmHelper) } transitions { testApp.launchViaIntent(wmHelper) }
} }

View File

@@ -41,9 +41,7 @@ import org.junit.runners.Parameterized
open class MovePipOnImeVisibilityChangeTest(flicker: FlickerTest) : PipTransition(flicker) { open class MovePipOnImeVisibilityChangeTest(flicker: FlickerTest) : PipTransition(flicker) {
private val imeApp = ImeAppHelper(instrumentation) private val imeApp = ImeAppHelper(instrumentation)
/** {@inheritDoc} */ override val thisTransition: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit
get() = buildTransition {
setup { setup {
imeApp.launchViaIntent(wmHelper) imeApp.launchViaIntent(wmHelper)
setRotation(flicker.scenario.startRotation) setRotation(flicker.scenario.startRotation)

View File

@@ -57,10 +57,8 @@ import org.junit.runners.Parameterized
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
open class MovePipUpOnShelfHeightChangeTest(flicker: FlickerTest) : open class MovePipUpOnShelfHeightChangeTest(flicker: FlickerTest) :
MovePipShelfHeightTransition(flicker) { MovePipShelfHeightTransition(flicker) {
/** Defines the transition used to run the test */ override val thisTransition: FlickerBuilder.() -> Unit =
override val transition: FlickerBuilder.() -> Unit {
get() =
buildTransition() {
setup { testApp.launchViaIntent(wmHelper) } setup { testApp.launchViaIntent(wmHelper) }
transitions { tapl.pressHome() } transitions { tapl.pressHome() }
teardown { testApp.exit(wmHelper) } teardown { testApp.exit(wmHelper) }

View File

@@ -22,7 +22,6 @@ import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.FlickerBuilder
import android.tools.device.flicker.legacy.FlickerTest import android.tools.device.flicker.legacy.FlickerTest
import android.tools.device.flicker.legacy.FlickerTestFactory import android.tools.device.flicker.legacy.FlickerTestFactory
import android.tools.device.flicker.rules.RemoveAllTasksButHomeRule
import com.android.server.wm.flicker.testapp.ActivityOptions import com.android.server.wm.flicker.testapp.ActivityOptions
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Test import org.junit.Test
@@ -37,19 +36,23 @@ import org.junit.runners.Parameterized
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
class PipDragTest(flicker: FlickerTest) : PipTransition(flicker) { class PipDragTest(flicker: FlickerTest) : PipTransition(flicker) {
private var isDraggedLeft: Boolean = true private var isDraggedLeft: Boolean = true
override val transition: FlickerBuilder.() -> Unit
get() = {
val stringExtras = mapOf(ActivityOptions.Pip.EXTRA_ENTER_PIP to "true")
override val thisTransition: FlickerBuilder.() -> Unit = {
transitions { pipApp.dragPipWindowAwayFromEdgeWithoutRelease(wmHelper, 50) }
}
override val defaultEnterPip: FlickerBuilder.() -> Unit = {
val stringExtras = mapOf(ActivityOptions.Pip.EXTRA_ENTER_PIP to "true")
setup { setup {
tapl.setEnableRotation(true) tapl.setEnableRotation(true)
// Launch the PIP activity and wait for it to enter PiP mode
RemoveAllTasksButHomeRule.removeAllTasksButHome()
pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = stringExtras) pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = stringExtras)
// determine the direction of dragging to test for // determine the direction of dragging to test for
isDraggedLeft = pipApp.isCloserToRightEdge(wmHelper) isDraggedLeft = pipApp.isCloserToRightEdge(wmHelper)
} }
}
override val defaultTeardown: FlickerBuilder.() -> Unit = {
teardown { teardown {
// release the primary pointer after dragging without release // release the primary pointer after dragging without release
pipApp.releasePipAfterDragging() pipApp.releasePipAfterDragging()
@@ -57,7 +60,6 @@ class PipDragTest(flicker: FlickerTest) : PipTransition(flicker) {
pipApp.exit(wmHelper) pipApp.exit(wmHelper)
tapl.setEnableRotation(false) tapl.setEnableRotation(false)
} }
transitions { pipApp.dragPipWindowAwayFromEdgeWithoutRelease(wmHelper, 50) }
} }
@Postsubmit @Postsubmit

View File

@@ -37,8 +37,9 @@ import org.junit.runners.Parameterized
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@FlakyTest(bugId = 270677470) @FlakyTest(bugId = 270677470)
class PipPinchInTest(flicker: FlickerTest) : PipTransition(flicker) { class PipPinchInTest(flicker: FlickerTest) : PipTransition(flicker) {
override val transition: FlickerBuilder.() -> Unit override val thisTransition: FlickerBuilder.() -> Unit = {
get() = buildTransition { transitions { pipApp.pinchInPipWindow(wmHelper, 0.4f, 30) } } transitions { pipApp.pinchInPipWindow(wmHelper, 0.4f, 30) }
}
/** Checks that the visible region area of [pipApp] always decreases during the animation. */ /** Checks that the visible region area of [pipApp] always decreases during the animation. */
@Postsubmit @Postsubmit

View File

@@ -56,27 +56,37 @@ abstract class PipTransition(flicker: FlickerTest) : BaseTest(flicker) {
} }
} }
/** /** Defines the transition used to run the test */
* Gets a configuration that handles basic setup and teardown of pip tests and that launches the protected open val thisTransition: FlickerBuilder.() -> Unit = {}
* Pip app for test
* override val transition: FlickerBuilder.() -> Unit
* @param stringExtras Arguments to pass to the PIP launch intent get() = {
* @param extraSpec Additional segment of flicker specification defaultSetup(this)
*/ defaultEnterPip(this)
@JvmOverloads thisTransition(this)
protected open fun buildTransition( defaultTeardown(this)
stringExtras: Map<String, String> = mapOf(ActivityOptions.Pip.EXTRA_ENTER_PIP to "true"), }
extraSpec: FlickerBuilder.() -> Unit = {}
): FlickerBuilder.() -> Unit { /** Defines the default setup steps required by the test */
return { protected open val defaultSetup: FlickerBuilder.() -> Unit = {
setup { setup {
setRotation(Rotation.ROTATION_0) setRotation(Rotation.ROTATION_0)
removeAllTasksButHome() removeAllTasksButHome()
pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = stringExtras)
} }
teardown { pipApp.exit(wmHelper) } }
extraSpec(this) /** Defines the default method of entering PiP */
protected open val defaultEnterPip: FlickerBuilder.() -> Unit = {
setup {
pipApp.launchViaIntentAndWaitForPip(wmHelper,
stringExtras = mapOf(ActivityOptions.Pip.EXTRA_ENTER_PIP to "true"))
}
}
/** Defines the default teardown required to clean up after the test */
protected open val defaultTeardown: FlickerBuilder.() -> Unit = {
teardown {
pipApp.exit(wmHelper)
} }
} }

View File

@@ -50,9 +50,22 @@ open class SetRequestedOrientationWhilePinned(flicker: FlickerTest) : PipTransit
private val startingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_0) private val startingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_0)
private val endingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_90) private val endingBounds = WindowUtils.getDisplayBounds(Rotation.ROTATION_90)
/** {@inheritDoc} */ override val thisTransition: FlickerBuilder.() -> Unit = {
override val transition: FlickerBuilder.() -> Unit transitions {
get() = { // Launch the activity back into fullscreen and ensure that it is now in landscape
pipApp.launchViaIntent(wmHelper)
// System bar may fade out during fixed rotation.
wmHelper
.StateSyncBuilder()
.withFullScreenApp(pipApp)
.withRotation(Rotation.ROTATION_90)
.withNavOrTaskBarVisible()
.withStatusBarVisible()
.waitForAndVerify()
}
}
override val defaultEnterPip: FlickerBuilder.() -> Unit = {
setup { setup {
// Launch the PiP activity fixed as landscape. // Launch the PiP activity fixed as landscape.
pipApp.launchViaIntent( pipApp.launchViaIntent(
@@ -71,19 +84,6 @@ open class SetRequestedOrientationWhilePinned(flicker: FlickerTest) : PipTransit
.withStatusBarVisible() .withStatusBarVisible()
.waitForAndVerify() .waitForAndVerify()
} }
teardown { pipApp.exit(wmHelper) }
transitions {
// Launch the activity back into fullscreen and ensure that it is now in landscape
pipApp.launchViaIntent(wmHelper)
// System bar may fade out during fixed rotation.
wmHelper
.StateSyncBuilder()
.withFullScreenApp(pipApp)
.withRotation(Rotation.ROTATION_90)
.withNavOrTaskBarVisible()
.withStatusBarVisible()
.waitForAndVerify()
}
} }
/** /**

View File

@@ -63,8 +63,7 @@ open class ShowPipAndRotateDisplay(flicker: FlickerTest) : PipTransition(flicker
private val screenBoundsStart = WindowUtils.getDisplayBounds(flicker.scenario.startRotation) private val screenBoundsStart = WindowUtils.getDisplayBounds(flicker.scenario.startRotation)
private val screenBoundsEnd = WindowUtils.getDisplayBounds(flicker.scenario.endRotation) private val screenBoundsEnd = WindowUtils.getDisplayBounds(flicker.scenario.endRotation)
override val transition: FlickerBuilder.() -> Unit override val thisTransition: FlickerBuilder.() -> Unit = {
get() = buildTransition {
setup { setup {
testApp.launchViaIntent(wmHelper) testApp.launchViaIntent(wmHelper)
setRotation(flicker.scenario.startRotation) setRotation(flicker.scenario.startRotation)