Merge "Fix PiP Flicker test transitions"
This commit is contained in:
@@ -30,7 +30,7 @@ import org.junit.Test
|
||||
*/
|
||||
abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = true) {
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
this.setRotation(testSpec.startRotation)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class ExitPipViaExpandButtonClickTest(
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = true) {
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
// launch an app behind the pip one
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
|
||||
@@ -62,7 +62,7 @@ class ExitPipViaIntentTest(testSpec: FlickerTestParameter) : ExitPipToAppTransit
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = true) {
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
// launch an app behind the pip one
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.junit.runners.Parameterized
|
||||
@Group3
|
||||
class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = true) {
|
||||
get() = buildTransition {
|
||||
transitions {
|
||||
pipApp.doubleClickPipWindow(wmHelper)
|
||||
}
|
||||
|
||||
@@ -60,14 +60,16 @@ open class MovePipDownShelfHeightChangeTest(
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = false) {
|
||||
teardown {
|
||||
get() = buildTransition() {
|
||||
setup {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
testApp.exit(wmHelper)
|
||||
}
|
||||
transitions {
|
||||
tapl.pressHome()
|
||||
}
|
||||
teardown {
|
||||
testApp.exit(wmHelper)
|
||||
}
|
||||
}
|
||||
|
||||
override fun assertRegionMovement(previous: RegionSubject, current: RegionSubject) {
|
||||
|
||||
@@ -68,7 +68,7 @@ class MovePipUpShelfHeightChangeTest(
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = false) {
|
||||
get() = buildTransition {
|
||||
teardown {
|
||||
tapl.pressHome()
|
||||
testApp.exit(wmHelper)
|
||||
|
||||
@@ -56,7 +56,7 @@ open class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = false) {
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
imeApp.launchViaIntent(wmHelper)
|
||||
setRotation(testSpec.startRotation)
|
||||
|
||||
@@ -72,7 +72,7 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = false) {
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
fixedApp.launchViaIntent(wmHelper)
|
||||
setRotation(testSpec.startRotation)
|
||||
|
||||
@@ -65,7 +65,6 @@ abstract class PipTransition(testSpec: FlickerTestParameter) : BaseTest(testSpec
|
||||
*/
|
||||
@JvmOverloads
|
||||
protected open fun buildTransition(
|
||||
eachRun: Boolean,
|
||||
stringExtras: Map<String, String> = mapOf(Components.PipActivity.EXTRA_ENTER_PIP to "true"),
|
||||
extraSpec: FlickerBuilder.() -> Unit = {}
|
||||
): FlickerBuilder.() -> Unit {
|
||||
@@ -73,25 +72,12 @@ abstract class PipTransition(testSpec: FlickerTestParameter) : BaseTest(testSpec
|
||||
setup {
|
||||
setRotation(Surface.ROTATION_0)
|
||||
removeAllTasksButHome()
|
||||
|
||||
if (!eachRun) {
|
||||
pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = stringExtras)
|
||||
}
|
||||
if (eachRun) {
|
||||
pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = stringExtras)
|
||||
}
|
||||
pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = stringExtras)
|
||||
}
|
||||
teardown {
|
||||
setRotation(Surface.ROTATION_0)
|
||||
removeAllTasksButHome()
|
||||
pipApp.exit(wmHelper)
|
||||
|
||||
if (eachRun) {
|
||||
pipApp.exit(wmHelper)
|
||||
}
|
||||
if (!eachRun) {
|
||||
pipApp.exit(wmHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extraSpec(this)
|
||||
|
||||
Reference in New Issue
Block a user