Update app pairs tests to new DSL format
Move the existing assertions into presubmit and flaky blocks Bug: 162923992 Test: atest FlickerTests Change-Id: I08071058fdaec33f65e03bd97d41c4bc91125040
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.os.SystemClock
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
@@ -40,7 +39,6 @@ import org.junit.runners.Parameterized
|
||||
* Test cold launch app from launcher.
|
||||
* To run this test: `atest WMShellFlickerTests:AppPairsTestCannotPairNonResizeableApps`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -51,10 +49,9 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<Array<Any>> {
|
||||
val testTag = "testAppPairs_cannotPairNonResizeableApps"
|
||||
val testSpec: FlickerBuilder.(Bundle) -> Unit = { configuration ->
|
||||
withTestName {
|
||||
buildTestTag(testTag, configuration)
|
||||
buildTestTag(configuration)
|
||||
}
|
||||
transitions {
|
||||
nonResizeableApp?.launchViaIntent(wmHelper)
|
||||
@@ -64,17 +61,20 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
}
|
||||
assertions {
|
||||
layersTrace {
|
||||
appPairsDividerIsInvisible()
|
||||
}
|
||||
windowManagerTrace {
|
||||
end("onlyResizeableAppWindowVisible") {
|
||||
presubmit {
|
||||
layersTrace {
|
||||
appPairsDividerIsInvisible()
|
||||
}
|
||||
windowManagerTrace {
|
||||
val nonResizeableApp = nonResizeableApp
|
||||
require(nonResizeableApp != null) {
|
||||
"Non resizeable app not initialized"
|
||||
}
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isInvisible(primaryApp.defaultWindowName)
|
||||
|
||||
end("onlyResizeableAppWindowVisible") {
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isInvisible(primaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
|
||||
@@ -38,7 +37,6 @@ import org.junit.runners.Parameterized
|
||||
* Test cold launch app from launcher.
|
||||
* To run this test: `atest WMShellFlickerTests:AppPairsTestPairPrimaryAndSecondaryApps`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -49,10 +47,9 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<Array<Any>> {
|
||||
val testTag = "testAppPairs_pairPrimaryAndSecondaryApps"
|
||||
val testSpec: FlickerBuilder.(Bundle) -> Unit = { configuration ->
|
||||
withTestName {
|
||||
buildTestTag(testTag, configuration)
|
||||
buildTestTag(configuration)
|
||||
}
|
||||
transitions {
|
||||
// TODO pair apps through normal UX flow
|
||||
@@ -61,20 +58,27 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
}
|
||||
assertions {
|
||||
layersTrace {
|
||||
appPairsDividerIsVisible()
|
||||
end("appsEndingBounds", enabled = false) {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.hasVisibleRegion(primaryApp.defaultWindowName,
|
||||
appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
.hasVisibleRegion(secondaryApp.defaultWindowName,
|
||||
appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
presubmit {
|
||||
layersTrace {
|
||||
appPairsDividerIsVisible()
|
||||
}
|
||||
windowManagerTrace {
|
||||
end("bothAppWindowsVisible") {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
}
|
||||
windowManagerTrace {
|
||||
end("bothAppWindowsVisible") {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(secondaryApp.defaultWindowName)
|
||||
|
||||
flaky {
|
||||
layersTrace {
|
||||
end("appsEndingBounds") {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.hasVisibleRegion(primaryApp.defaultWindowName,
|
||||
appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
.hasVisibleRegion(secondaryApp.defaultWindowName,
|
||||
appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
|
||||
@@ -38,7 +37,6 @@ import org.junit.runners.Parameterized
|
||||
* Test cold launch app from launcher.
|
||||
* To run this test: `atest WMShellFlickerTests:AppPairsTestUnpairPrimaryAndSecondaryApps`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -49,10 +47,9 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<Array<Any>> {
|
||||
val testTag = "testAppPairs_unpairPrimaryAndSecondaryApps"
|
||||
val testSpec: FlickerBuilder.(Bundle) -> Unit = { configuration ->
|
||||
withTestName {
|
||||
buildTestTag(testTag, configuration)
|
||||
buildTestTag(configuration)
|
||||
}
|
||||
setup {
|
||||
executeShellCommand(
|
||||
@@ -66,24 +63,31 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
}
|
||||
assertions {
|
||||
layersTrace {
|
||||
appPairsDividerIsInvisible()
|
||||
start("appsStartingBounds", enabled = false) {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.hasVisibleRegion(primaryApp.defaultWindowName,
|
||||
appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
.hasVisibleRegion(secondaryApp.defaultWindowName,
|
||||
appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
presubmit {
|
||||
layersTrace {
|
||||
appPairsDividerIsInvisible()
|
||||
}
|
||||
end("appsEndingBounds", enabled = false) {
|
||||
this.notExists(primaryApp.defaultWindowName)
|
||||
.notExists(secondaryApp.defaultWindowName)
|
||||
windowManagerTrace {
|
||||
end("bothAppWindowsInvisible") {
|
||||
isInvisible(primaryApp.defaultWindowName)
|
||||
isInvisible(secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
}
|
||||
windowManagerTrace {
|
||||
end("bothAppWindowsInvisible") {
|
||||
isInvisible(primaryApp.defaultWindowName)
|
||||
isInvisible(secondaryApp.defaultWindowName)
|
||||
|
||||
flaky {
|
||||
layersTrace {
|
||||
start("appsStartingBounds") {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.hasVisibleRegion(primaryApp.defaultWindowName,
|
||||
appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
.hasVisibleRegion(secondaryApp.defaultWindowName,
|
||||
appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
}
|
||||
end("appsEndingBounds") {
|
||||
this.notExists(primaryApp.defaultWindowName)
|
||||
.notExists(secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
@@ -46,7 +45,6 @@ import org.junit.runners.Parameterized
|
||||
* Test open apps to app pairs and rotate.
|
||||
* To run this test: `atest WMShellFlickerTests:RotateTwoLaunchedAppsInAppPairsMode`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -60,7 +58,7 @@ class RotateTwoLaunchedAppsInAppPairsMode(
|
||||
fun getParams(): Collection<Array<Any>> {
|
||||
val testSpec: FlickerBuilder.(Bundle) -> Unit = { configuration ->
|
||||
withTestName {
|
||||
buildTestTag("testRotateTwoLaunchedAppsInAppPairsMode", configuration)
|
||||
buildTestTag(configuration)
|
||||
}
|
||||
transitions {
|
||||
executeShellCommand(composePairsCommand(
|
||||
@@ -69,23 +67,28 @@ class RotateTwoLaunchedAppsInAppPairsMode(
|
||||
setRotation(configuration.endRotation)
|
||||
}
|
||||
assertions {
|
||||
layersTrace {
|
||||
navBarLayerRotatesAndScales(Surface.ROTATION_0, configuration.endRotation,
|
||||
enabled = false)
|
||||
statusBarLayerRotatesScales(Surface.ROTATION_0, configuration.endRotation,
|
||||
enabled = false)
|
||||
appPairsDividerIsVisible(enabled = false)
|
||||
appPairsPrimaryBoundsIsVisible(configuration.endRotation,
|
||||
primaryApp.defaultWindowName, bugId = 172776659)
|
||||
appPairsSecondaryBoundsIsVisible(configuration.endRotation,
|
||||
secondaryApp.defaultWindowName, bugId = 172776659)
|
||||
presubmit {
|
||||
windowManagerTrace {
|
||||
navBarWindowIsAlwaysVisible()
|
||||
statusBarWindowIsAlwaysVisible()
|
||||
end("bothAppWindowsVisible") {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
.isVisible(secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
}
|
||||
windowManagerTrace {
|
||||
navBarWindowIsAlwaysVisible()
|
||||
statusBarWindowIsAlwaysVisible()
|
||||
end("bothAppWindowsVisible") {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
.isVisible(secondaryApp.defaultWindowName)
|
||||
|
||||
flaky {
|
||||
layersTrace {
|
||||
appPairsDividerIsVisible()
|
||||
navBarLayerRotatesAndScales(Surface.ROTATION_0,
|
||||
configuration.endRotation)
|
||||
statusBarLayerRotatesScales(Surface.ROTATION_0,
|
||||
configuration.endRotation)
|
||||
appPairsPrimaryBoundsIsVisible(configuration.endRotation,
|
||||
primaryApp.defaultWindowName, bugId = 172776659)
|
||||
appPairsSecondaryBoundsIsVisible(configuration.endRotation,
|
||||
secondaryApp.defaultWindowName, bugId = 172776659)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
|
||||
fun getParams(): Collection<Array<Any>> {
|
||||
val testSpec: FlickerBuilder.(Bundle) -> Unit = { configuration ->
|
||||
withTestName {
|
||||
buildTestTag("testRotateAndEnterAppPairsMode", configuration)
|
||||
buildTestTag(configuration)
|
||||
}
|
||||
transitions {
|
||||
this.setRotation(configuration.endRotation)
|
||||
@@ -71,22 +71,37 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
}
|
||||
assertions {
|
||||
layersTrace {
|
||||
navBarLayerRotatesAndScales(Surface.ROTATION_0, configuration.endRotation,
|
||||
enabled = !configuration.startRotation.isRotated())
|
||||
statusBarLayerRotatesScales(Surface.ROTATION_0, configuration.endRotation)
|
||||
appPairsDividerIsVisible()
|
||||
appPairsPrimaryBoundsIsVisible(configuration.endRotation,
|
||||
primaryApp.defaultWindowName, 172776659)
|
||||
appPairsSecondaryBoundsIsVisible(configuration.endRotation,
|
||||
secondaryApp.defaultWindowName, 172776659)
|
||||
val isRotated = configuration.startRotation.isRotated()
|
||||
presubmit {
|
||||
layersTrace {
|
||||
statusBarLayerRotatesScales(Surface.ROTATION_0,
|
||||
configuration.endRotation)
|
||||
appPairsDividerIsVisible()
|
||||
if (!isRotated) {
|
||||
navBarLayerRotatesAndScales(Surface.ROTATION_0,
|
||||
configuration.endRotation)
|
||||
}
|
||||
}
|
||||
windowManagerTrace {
|
||||
navBarWindowIsAlwaysVisible()
|
||||
statusBarWindowIsAlwaysVisible()
|
||||
end("bothAppWindowsVisible") {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
}
|
||||
windowManagerTrace {
|
||||
navBarWindowIsAlwaysVisible()
|
||||
statusBarWindowIsAlwaysVisible()
|
||||
end("bothAppWindowsVisible") {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(secondaryApp.defaultWindowName)
|
||||
flaky {
|
||||
layersTrace {
|
||||
appPairsPrimaryBoundsIsVisible(configuration.endRotation,
|
||||
primaryApp.defaultWindowName, 172776659)
|
||||
appPairsSecondaryBoundsIsVisible(configuration.endRotation,
|
||||
secondaryApp.defaultWindowName, 172776659)
|
||||
|
||||
if (isRotated) {
|
||||
navBarLayerRotatesAndScales(Surface.ROTATION_0,
|
||||
configuration.endRotation)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user