Merge "Use tapl when possible"
This commit is contained in:
committed by
Android (Google) Code Review
commit
d8125b3e28
@@ -40,6 +40,7 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
testSpec.setIsTablet(
|
||||
WindowManagerStateHelper(instrumentation).currentState.wmState.isTablet
|
||||
)
|
||||
tapl.setExpectedRotationCheckEnabled(true)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,6 +49,9 @@ class OpenActivityEmbeddingPlaceholderSplit(
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
eachRun {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
@@ -58,7 +61,7 @@ class OpenActivityEmbeddingPlaceholderSplit(
|
||||
}
|
||||
teardown {
|
||||
test {
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
testApp.exit(wmHelper)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,12 +70,17 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
// Can't use TAPL at the moment because of rotation test issues
|
||||
// When pressing home, TAPL expects the orientation to remain constant
|
||||
// However, when closing a landscape app back to a portrait-only launcher
|
||||
// this causes an error in verifyActiveContainer();
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
|
||||
@@ -57,6 +57,9 @@ class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTes
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
eachRun {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
@@ -67,7 +70,7 @@ class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTes
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.withImeGone()
|
||||
|
||||
@@ -46,6 +46,9 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
eachRun {
|
||||
imeTestApp.launchViaIntent(wmHelper)
|
||||
imeTestApp.openIME(wmHelper)
|
||||
@@ -59,7 +62,7 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
|
||||
}
|
||||
teardown {
|
||||
eachRun {
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
|
||||
@@ -49,13 +49,16 @@ class CloseImeWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
eachRun {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
testApp.openIME(wmHelper)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.withImeGone()
|
||||
|
||||
@@ -54,13 +54,16 @@ class OpenImeWindowFromFixedOrientationAppTest(
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
test {
|
||||
// Launch the activity with expecting IME will be shown.
|
||||
imeTestApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
eachRun {
|
||||
// Swiping out the IME activity to home.
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentMatcher.Companion.LAUNCHER
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -68,6 +67,7 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
transitions {
|
||||
device.reopenAppFromOverview(wmHelper)
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withFullScreenApp(testApp)
|
||||
.withImeShown()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
@@ -111,9 +111,9 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Test
|
||||
fun launcherWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(LAUNCHER)
|
||||
this.isAppWindowVisible(ComponentMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isAppWindowInvisible(LAUNCHER)
|
||||
.isAppWindowInvisible(ComponentMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
@@ -65,6 +64,9 @@ open class SwitchImeWindowsFromGestureNavTest(
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
eachRun {
|
||||
this.setRotation(testSpec.startRotation)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
@@ -82,7 +84,7 @@ open class SwitchImeWindowsFromGestureNavTest(
|
||||
}
|
||||
teardown {
|
||||
eachRun {
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
@@ -93,12 +95,7 @@ open class SwitchImeWindowsFromGestureNavTest(
|
||||
transitions {
|
||||
// [Step1]: Swipe right from imeTestApp to testApp task
|
||||
createTag(TAG_IME_VISIBLE)
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
device.swipe(
|
||||
0, displayBounds.bounds.height,
|
||||
displayBounds.bounds.width, displayBounds.bounds.height, 50
|
||||
)
|
||||
|
||||
tapl.launchedAppState.quickSwitchToPreviousApp()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withFullScreenApp(testApp)
|
||||
.waitForAndVerify()
|
||||
@@ -106,11 +103,7 @@ open class SwitchImeWindowsFromGestureNavTest(
|
||||
}
|
||||
transitions {
|
||||
// [Step2]: Swipe left to back to imeTestApp task
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
device.swipe(
|
||||
displayBounds.bounds.width, displayBounds.bounds.height,
|
||||
0, displayBounds.bounds.height, 50
|
||||
)
|
||||
tapl.launchedAppState.quickSwitchToPreviousAppSwipeLeft()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withFullScreenApp(imeTestApp)
|
||||
.waitForAndVerify()
|
||||
|
||||
@@ -70,11 +70,11 @@ open class OpenAppFromOverviewTest(
|
||||
super.transition(this)
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
eachRun {
|
||||
// Can't use tapl.goHome() because of b/235841947
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
|
||||
@@ -66,10 +66,11 @@ open class OpenAppWarmTest(testSpec: FlickerTestParameter) :
|
||||
super.transition(this)
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
eachRun {
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
|
||||
@@ -59,13 +59,16 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
test {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
}
|
||||
test {
|
||||
tapl.setExpectedRotation(testSpec.startRotation)
|
||||
}
|
||||
|
||||
eachRun {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
device.pressHome()
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.withWindowSurfaceDisappeared(testApp)
|
||||
|
||||
Reference in New Issue
Block a user