2/ Clear all recents tasks before running legacysplitscreen tests

Sometimes previous launched activity will affect the order of
current test activity in recents and cause the flicker test flaky.
Trigger openQuickStepAndClearRecentAppsFromOverview() in setup()
to ensure overview/recents is clear before the tests

Bug: 175728979
Test: atest com.android.wm.shell.flicker.legacysplitscreen
Change-Id: I6a6aae362617bb7948473aaafaab8f2c3eec0bc1
This commit is contained in:
Bill Lin
2020-12-17 16:01:31 +08:00
parent b69feaff0a
commit 21cfe8bb58
6 changed files with 24 additions and 12 deletions

View File

@@ -27,6 +27,7 @@ import com.android.server.wm.flicker.helpers.exitSplitScreen
import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.helpers.openQuickstep
import com.android.server.wm.flicker.helpers.openQuickStepAndClearRecentAppsFromOverview
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
import com.android.wm.shell.flicker.helpers.SplitScreenHelper.Companion.TEST_REPETITIONS
@@ -67,6 +68,7 @@ class EnterLegacySplitScreenTest(
setup {
eachRun {
uiDevice.wakeUpAndGoToHomeScreen()
uiDevice.openQuickStepAndClearRecentAppsFromOverview()
}
}
teardown {

View File

@@ -30,8 +30,11 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.dsl.runWithFlicker
import com.android.server.wm.flicker.helpers.exitSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.helpers.openQuickStepAndClearRecentAppsFromOverview
import com.android.server.wm.flicker.helpers.resizeSplitScreen
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
import com.android.wm.shell.flicker.helpers.SplitScreenHelper.Companion.TEST_REPETITIONS
import org.junit.FixMethodOrder
@@ -61,10 +64,9 @@ class ExitLegacySplitScreenTest(
setup {
eachRun {
uiDevice.wakeUpAndGoToHomeScreen()
secondaryApp.open()
uiDevice.pressHome()
splitScreenApp.open()
uiDevice.pressHome()
uiDevice.openQuickStepAndClearRecentAppsFromOverview()
secondaryApp.launchViaIntent()
splitScreenApp.launchViaIntent()
uiDevice.launchSplitScreen()
}
}
@@ -150,4 +152,4 @@ class ExitLegacySplitScreenTest(
return supportedRotations.map { arrayOf(Surface.rotationToString(it), it) }
}
}
}
}

View File

@@ -31,6 +31,7 @@ import com.android.server.wm.flicker.helpers.buildTestTag
import com.android.server.wm.flicker.helpers.exitSplitScreen
import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.helpers.openQuickStepAndClearRecentAppsFromOverview
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
@@ -82,6 +83,7 @@ class LegacySplitScreenToLauncherTest(
setup {
test {
device.wakeUpAndGoToHomeScreen()
device.openQuickStepAndClearRecentAppsFromOverview()
}
eachRun {
testApp.open()

View File

@@ -24,13 +24,14 @@ import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.Flicker
import com.android.server.wm.flicker.FlickerTestRunner
import com.android.server.wm.flicker.FlickerTestRunnerFactory
import com.android.server.wm.flicker.endRotation
import com.android.server.wm.flicker.helpers.StandardAppHelper
import com.android.server.wm.flicker.endRotation
import com.android.server.wm.flicker.focusChanges
import com.android.server.wm.flicker.helpers.buildTestTag
import com.android.server.wm.flicker.helpers.exitSplitScreen
import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.helpers.openQuickStepAndClearRecentAppsFromOverview
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
@@ -83,6 +84,7 @@ class OpenAppToLegacySplitScreenTest(
setup {
test {
device.wakeUpAndGoToHomeScreen()
device.openQuickStepAndClearRecentAppsFromOverview()
}
eachRun {
testApp.open()

View File

@@ -23,6 +23,7 @@ import com.android.server.wm.flicker.dsl.runWithFlicker
import com.android.server.wm.flicker.helpers.exitSplitScreen
import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.helpers.openQuickStepAndClearRecentAppsFromOverview
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
@@ -56,7 +57,8 @@ class RotateOneLaunchedAppTest(
}
setup {
test {
device.wakeUpAndGoToHomeScreen()
uiDevice.wakeUpAndGoToHomeScreen()
uiDevice.openQuickStepAndClearRecentAppsFromOverview()
}
}
teardown {
@@ -81,7 +83,7 @@ class RotateOneLaunchedAppTest(
}
transitions {
splitScreenApp.launchViaIntent()
device.launchSplitScreen()
uiDevice.launchSplitScreen()
setRotation(rotation)
}
assertions {
@@ -114,7 +116,7 @@ class RotateOneLaunchedAppTest(
transitions {
splitScreenApp.launchViaIntent()
setRotation(rotation)
device.launchSplitScreen()
uiDevice.launchSplitScreen()
}
assertions {
layersTrace {

View File

@@ -23,6 +23,7 @@ import com.android.server.wm.flicker.dsl.runWithFlicker
import com.android.server.wm.flicker.helpers.exitSplitScreen
import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.helpers.openQuickStepAndClearRecentAppsFromOverview
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
@@ -57,7 +58,8 @@ class RotateTwoLaunchedAppTest(
}
setup {
test {
device.wakeUpAndGoToHomeScreen()
uiDevice.wakeUpAndGoToHomeScreen()
uiDevice.openQuickStepAndClearRecentAppsFromOverview()
}
}
teardown {
@@ -83,7 +85,7 @@ class RotateTwoLaunchedAppTest(
transitions {
secondaryApp.launchViaIntent()
splitScreenApp.launchViaIntent()
device.launchSplitScreen()
uiDevice.launchSplitScreen()
splitScreenApp.reopenAppFromOverview()
setRotation(rotation)
}
@@ -121,7 +123,7 @@ class RotateTwoLaunchedAppTest(
secondaryApp.launchViaIntent()
splitScreenApp.launchViaIntent()
setRotation(rotation)
device.launchSplitScreen()
uiDevice.launchSplitScreen()
splitScreenApp.reopenAppFromOverview()
}
assertions {