Use generic way to enter split-screen
Let the tests to enter split by generic method: split from overview. Bug: 231399940 Test: atest WMShellFlickerTests:com.android.wm.shell.flicker.splitscreen Change-Id: I71df41c5b62928f3d36294651afcee7c0d19a540
This commit is contained in:
@@ -151,15 +151,15 @@ fun FlickerTestParameter.splitAppLayerBoundsChanges(
|
||||
assertLayers {
|
||||
if (landscapePosLeft) {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
component, landscapePosLeft, portraitPosTop, endRotation)
|
||||
component, landscapePosLeft, portraitPosTop, endRotation)
|
||||
} else {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
component, landscapePosLeft, portraitPosTop, endRotation)
|
||||
.then()
|
||||
.isInvisible(component)
|
||||
.then()
|
||||
.splitAppLayerBoundsSnapToDivider(
|
||||
component, landscapePosLeft, portraitPosTop, endRotation)
|
||||
} else {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
component, landscapePosLeft, portraitPosTop, endRotation)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,13 +98,29 @@ class SplitScreenHelper(
|
||||
secondaryApp: IComponentMatcher,
|
||||
) {
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withWindowSurfaceAppeared(primaryApp)
|
||||
.withWindowSurfaceAppeared(secondaryApp)
|
||||
.withSplitDividerVisible()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
|
||||
fun enterSplit(
|
||||
wmHelper: WindowManagerStateHelper,
|
||||
tapl: LauncherInstrumentation,
|
||||
primaryApp: SplitScreenHelper,
|
||||
secondaryApp: SplitScreenHelper
|
||||
) {
|
||||
tapl.workspace.switchToOverview().dismissAllTasks()
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
secondaryApp.launchViaIntent(wmHelper)
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
splitFromOverview(tapl)
|
||||
waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
|
||||
fun splitFromOverview(tapl: LauncherInstrumentation) {
|
||||
// Note: The initial split position in landscape is different between tablet and phone.
|
||||
// In landscape, tablet will let the first app split to right side, and phone will
|
||||
@@ -268,24 +284,35 @@ class SplitScreenHelper(
|
||||
?.layerStackSpace
|
||||
?: error("Display not found")
|
||||
val dividerBar = device.wait(Until.findObject(dividerBarSelector), TIMEOUT_MS)
|
||||
dividerBar.drag(Point(displayBounds.width * 2 / 3, displayBounds.height * 2 / 3))
|
||||
dividerBar.drag(Point(displayBounds.width * 1 / 3, displayBounds.height * 2 / 3))
|
||||
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withWindowSurfaceDisappeared(SPLIT_DECOR_MANAGER)
|
||||
.waitForAndVerify()
|
||||
}
|
||||
|
||||
fun dragDividerToDismissSplit(
|
||||
device: UiDevice,
|
||||
wmHelper: WindowManagerStateHelper
|
||||
wmHelper: WindowManagerStateHelper,
|
||||
dragToRight: Boolean,
|
||||
dragToBottom: Boolean
|
||||
) {
|
||||
val displayBounds = wmHelper.currentState.layerState
|
||||
.displays.firstOrNull { !it.isVirtual }
|
||||
?.layerStackSpace
|
||||
?: error("Display not found")
|
||||
val dividerBar = device.wait(Until.findObject(dividerBarSelector), TIMEOUT_MS)
|
||||
dividerBar.drag(Point(displayBounds.width * 4 / 5, displayBounds.height * 4 / 5))
|
||||
dividerBar.drag(Point(
|
||||
if (dragToRight) {
|
||||
displayBounds.width * 4 / 5
|
||||
} else {
|
||||
displayBounds.width * 1 / 5
|
||||
},
|
||||
if (dragToBottom) {
|
||||
displayBounds.height * 4 / 5
|
||||
} else {
|
||||
displayBounds.height * 1 / 5
|
||||
}))
|
||||
}
|
||||
|
||||
fun doubleTapDividerToSwitch(device: UiDevice) {
|
||||
@@ -297,7 +324,7 @@ class SplitScreenHelper(
|
||||
dividerBar.click()
|
||||
}
|
||||
|
||||
fun copyContentFromLeftToRight(
|
||||
fun copyContentInSplit(
|
||||
instrumentation: Instrumentation,
|
||||
device: UiDevice,
|
||||
sourceApp: IComponentNameMatcher,
|
||||
|
||||
@@ -30,8 +30,6 @@ import com.android.wm.shell.flicker.appWindowKeepVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerKeepVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsKeepVisible
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -49,30 +47,18 @@ import org.junit.runners.Parameterized
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
protected val textEditApp = SplitScreenHelper.getIme(instrumentation)
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
private val textEditApp = SplitScreenHelper.getIme(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
textEditApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(primaryApp.appName)
|
||||
.dragToSplitscreen(primaryApp.`package`, textEditApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, textEditApp, primaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, textEditApp)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
SplitScreenHelper.copyContentFromLeftToRight(
|
||||
SplitScreenHelper.copyContentInSplit(
|
||||
instrumentation, device, primaryApp, textEditApp)
|
||||
}
|
||||
}
|
||||
@@ -92,12 +78,12 @@ class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsKeepVisible() = testSpec.splitAppLayerBoundsKeepVisible(
|
||||
primaryApp, landscapePosLeft = true, portraitPosTop = true)
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun textEditAppBoundsKeepVisible() = testSpec.splitAppLayerBoundsKeepVisible(
|
||||
textEditApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
textEditApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -26,6 +26,7 @@ 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.flicker.helpers.WindowUtils
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesInvisible
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -33,14 +34,11 @@ import com.android.wm.shell.flicker.layerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesInvisible
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesInvisible
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test dismiss split screen by dragging the divider bar.
|
||||
*
|
||||
@@ -53,31 +51,23 @@ import org.junit.runners.Parameterized
|
||||
@Group1
|
||||
class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
tapl.goHome()
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
SplitScreenHelper.dragDividerToDismissSplit(device, wmHelper)
|
||||
if (tapl.isTablet) {
|
||||
SplitScreenHelper.dragDividerToDismissSplit(device, wmHelper,
|
||||
dragToRight = false, dragToBottom = true)
|
||||
} else {
|
||||
SplitScreenHelper.dragDividerToDismissSplit(device, wmHelper,
|
||||
dragToRight = true, dragToBottom = true)
|
||||
}
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withFullScreenApp(secondaryApp)
|
||||
.waitForAndVerify()
|
||||
}
|
||||
@@ -98,17 +88,23 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsFullscreenAtEnd() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(secondaryApp)
|
||||
.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(secondaryApp)
|
||||
.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(secondaryApp, isOptional = true)
|
||||
.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT, isOptional = true)
|
||||
.then()
|
||||
.contains(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(secondaryApp)
|
||||
.invoke("secondaryAppBoundsIsFullscreenAtEnd") {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.endRotation)
|
||||
it.visibleRegion(secondaryApp).coversExactly(displayBounds)
|
||||
|
||||
@@ -30,8 +30,6 @@ import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesInvisible
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesInvisible
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -52,30 +50,17 @@ class DismissSplitScreenByGoHome(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SplitScreenBase(testSpec) {
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
@@ -96,12 +81,12 @@ class DismissSplitScreenByGoHome(
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible(
|
||||
secondaryApp, landscapePosLeft = true, portraitPosTop = true)
|
||||
secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -31,8 +31,6 @@ import com.android.wm.shell.flicker.appWindowKeepVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerKeepVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsChanges
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -51,25 +49,12 @@ import org.junit.runners.Parameterized
|
||||
@Group1
|
||||
class DragDividerToResize (testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
tapl.goHome()
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
@@ -108,12 +93,12 @@ class DragDividerToResize (testSpec: FlickerTestParameter) : SplitScreenBase(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsChanges() = testSpec.splitAppLayerBoundsChanges(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
primaryApp, landscapePosLeft = true, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsChanges() = testSpec.splitAppLayerBoundsChanges(
|
||||
secondaryApp, landscapePosLeft = true, portraitPosTop = true)
|
||||
secondaryApp, landscapePosLeft = false, portraitPosTop = true)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -189,7 +174,7 @@ class DragDividerToResize (testSpec: FlickerTestParameter) : SplitScreenBase(tes
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY))
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,6 @@ import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.layerKeepVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -51,24 +49,12 @@ import org.junit.runners.Parameterized
|
||||
@Group1
|
||||
class SwitchAppByDoubleTapDivider (testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
@@ -94,12 +80,12 @@ class SwitchAppByDoubleTapDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = true, portraitPosTop = true)
|
||||
primaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
secondaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -30,8 +30,6 @@ import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -51,28 +49,15 @@ import org.junit.runners.Parameterized
|
||||
class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
val thirdApp = SplitScreenHelper.getNonResizeable(instrumentation)
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
|
||||
thirdApp.launchViaIntent(wmHelper)
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withWindowSurfaceAppeared(thirdApp)
|
||||
.waitForAndVerify()
|
||||
}
|
||||
@@ -98,12 +83,12 @@ class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScr
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp, landscapePosLeft = true, portraitPosTop = true)
|
||||
secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -30,8 +30,6 @@ import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -50,28 +48,15 @@ import org.junit.runners.Parameterized
|
||||
@Group1
|
||||
class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
@@ -97,12 +82,12 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp, landscapePosLeft = true, portraitPosTop = true)
|
||||
secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -30,8 +30,6 @@ import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -50,28 +48,15 @@ import org.junit.runners.Parameterized
|
||||
@Group1
|
||||
class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
|
||||
// TODO(b/231399940): Remove this once we can use recent shortcut to enter split.
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
eachRun {
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
// TODO(b/231399940): Use recent shortcut to enter split.
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
@@ -99,12 +84,12 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp, landscapePosLeft = true, portraitPosTop = true)
|
||||
secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user