Merge "Updates flicker documentation and improve naming" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a32ef5bd2a
@@ -18,8 +18,6 @@ package com.android.wm.shell.flicker
|
||||
|
||||
import android.graphics.Region
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
|
||||
import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.traces.layers.getVisibleBounds
|
||||
@@ -32,15 +30,15 @@ fun FlickerTestParameter.appPairsDividerIsVisible() {
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerIsInvisible() {
|
||||
assertLayersEnd {
|
||||
this.notExists(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.notContains(APP_PAIR_SPLIT_DIVIDER)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.hidesLayer(DOCKED_STACK_DIVIDER)
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER)
|
||||
.then()
|
||||
.showsLayer(DOCKED_STACK_DIVIDER)
|
||||
.isVisible(DOCKED_STACK_DIVIDER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,30 +50,30 @@ fun FlickerTestParameter.dockedStackDividerIsVisible() {
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.hidesLayer(DOCKED_STACK_DIVIDER)
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER)
|
||||
.then()
|
||||
.showsLayer(DOCKED_STACK_DIVIDER)
|
||||
.isVisible(DOCKED_STACK_DIVIDER)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.showsLayer(DOCKED_STACK_DIVIDER)
|
||||
this.isVisible(DOCKED_STACK_DIVIDER)
|
||||
.then()
|
||||
.hidesLayer(DOCKED_STACK_DIVIDER)
|
||||
.isInvisible(DOCKED_STACK_DIVIDER)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerIsInvisible() {
|
||||
assertLayersEnd {
|
||||
this.notExists(DOCKED_STACK_DIVIDER)
|
||||
this.notContains(DOCKED_STACK_DIVIDER)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsPrimaryBoundsIsVisible(rotation: Int, primaryLayerName: String) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.hasVisibleRegion(primaryLayerName, getPrimaryRegion(dividerRegion, rotation))
|
||||
this.coversExactly(getPrimaryRegion(dividerRegion, rotation), primaryLayerName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +83,7 @@ fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisible(
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER)
|
||||
this.hasVisibleRegion(primaryLayerName, getPrimaryRegion(dividerRegion, rotation))
|
||||
this.coversExactly(getPrimaryRegion(dividerRegion, rotation), primaryLayerName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +93,7 @@ fun FlickerTestParameter.appPairsSecondaryBoundsIsVisible(
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.hasVisibleRegion(secondaryLayerName, getSecondaryRegion(dividerRegion, rotation))
|
||||
this.coversExactly(getSecondaryRegion(dividerRegion, rotation), secondaryLayerName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +103,7 @@ fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisible(
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER)
|
||||
this.hasVisibleRegion(secondaryLayerName, getSecondaryRegion(dividerRegion, rotation))
|
||||
this.coversExactly(getSecondaryRegion(dividerRegion, rotation), secondaryLayerName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,3 +18,5 @@ package com.android.wm.shell.flicker
|
||||
|
||||
const val IME_WINDOW_NAME = "InputMethod"
|
||||
const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui"
|
||||
const val APP_PAIR_SPLIT_DIVIDER = "AppPairSplitDivider"
|
||||
const val DOCKED_STACK_DIVIDER = "DockedStackDivider"
|
||||
@@ -16,7 +16,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
|
||||
@@ -48,7 +47,7 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
testSpec: FlickerTestParameter
|
||||
) : AppPairsTransition(testSpec) {
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
transitions {
|
||||
|
||||
@@ -16,17 +16,16 @@
|
||||
|
||||
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.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.traces.layers.getVisibleBounds
|
||||
import com.android.wm.shell.flicker.APP_PAIR_SPLIT_DIVIDER
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisible
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -46,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
testSpec: FlickerTestParameter
|
||||
) : AppPairsTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
transitions {
|
||||
@@ -75,10 +74,10 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
fun appsEndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.hasVisibleRegion(primaryApp.defaultWindowName,
|
||||
appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
.hasVisibleRegion(secondaryApp.defaultWindowName,
|
||||
appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
this.coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion),
|
||||
primaryApp.defaultWindowName)
|
||||
.coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion),
|
||||
secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,17 +16,16 @@
|
||||
|
||||
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.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.APP_PAIR_SPLIT_DIVIDER
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.traces.layers.getVisibleBounds
|
||||
import com.android.wm.shell.flicker.APP_PAIR_SPLIT_DIVIDER
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsInvisible
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -46,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
testSpec: FlickerTestParameter
|
||||
) : AppPairsTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
setup {
|
||||
@@ -80,10 +79,10 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
fun appsStartingBounds() {
|
||||
testSpec.assertLayersStart {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
hasVisibleRegion(primaryApp.defaultWindowName,
|
||||
appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
hasVisibleRegion(secondaryApp.defaultWindowName,
|
||||
appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion),
|
||||
primaryApp.defaultWindowName)
|
||||
coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion),
|
||||
secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,8 +90,8 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
@Test
|
||||
fun appsEndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
notExists(primaryApp.defaultWindowName)
|
||||
notExists(secondaryApp.defaultWindowName)
|
||||
notContains(primaryApp.defaultWindowName)
|
||||
notContains(secondaryApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.system.helpers.ActivityHelper
|
||||
import android.util.Log
|
||||
@@ -66,7 +65,7 @@ abstract class AppPairsTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
internal open val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
internal open val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
setup {
|
||||
test {
|
||||
|
||||
@@ -16,7 +16,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
|
||||
@@ -52,7 +51,7 @@ import org.junit.runners.Parameterized
|
||||
class RotateTwoLaunchedAppsInAppPairsMode(
|
||||
testSpec: FlickerTestParameter
|
||||
) : RotateTwoLaunchedAppsTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
transitions {
|
||||
|
||||
@@ -16,7 +16,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
|
||||
@@ -55,7 +54,7 @@ import org.junit.runners.Parameterized
|
||||
class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
|
||||
testSpec: FlickerTestParameter
|
||||
) : RotateTwoLaunchedAppsTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
transitions {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
@@ -30,7 +29,7 @@ abstract class RotateTwoLaunchedAppsTransition(
|
||||
override val nonResizeableApp: SplitScreenHelper?
|
||||
get() = null
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
setup {
|
||||
test {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -50,11 +49,10 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
// @FlakyTest(bugId = 179116910)
|
||||
class EnterSplitScreenDockActivity(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
transitions {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -54,7 +53,7 @@ import org.junit.runners.Parameterized
|
||||
class EnterSplitScreenLaunchToSide(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
transitions {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -50,7 +49,7 @@ import org.junit.runners.Parameterized
|
||||
class EnterSplitScreenNonResizableNotDock(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
teardown {
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
@@ -34,6 +32,7 @@ import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
|
||||
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -52,7 +51,7 @@ import org.junit.runners.Parameterized
|
||||
class ExitLegacySplitScreenFromBottom(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
setup {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -53,7 +52,7 @@ import org.junit.runners.Parameterized
|
||||
class ExitPrimarySplitScreenShowSecondaryFullscreen(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
teardown {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
@@ -27,7 +26,7 @@ import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
abstract class LegacySplitScreenRotateTransition(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
setup {
|
||||
eachRun {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import android.view.Surface
|
||||
@@ -66,7 +65,7 @@ class LegacySplitScreenToLauncher(
|
||||
.launcherStrategy.supportedLauncherPackage
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
setup {
|
||||
test {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.os.Bundle
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import android.view.Surface
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
@@ -41,7 +40,7 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
protected val LAUNCHER_PACKAGE_NAME = LauncherStrategyFactory.getInstance(instrumentation)
|
||||
.launcherStrategy.supportedLauncherPackage
|
||||
|
||||
protected open val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
protected open val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
setup {
|
||||
eachRun {
|
||||
@@ -70,7 +69,7 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
}
|
||||
}
|
||||
|
||||
internal open val cleanSetup: FlickerBuilder.(Bundle) -> Unit
|
||||
internal open val cleanSetup: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
setup {
|
||||
eachRun {
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
@@ -34,6 +32,7 @@ import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
import com.android.server.wm.flicker.layerBecomesVisible
|
||||
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
|
||||
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -53,7 +52,7 @@ import org.junit.runners.Parameterized
|
||||
class NonResizableDismissInLegacySplitScreen(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
cleanSetup(this, configuration)
|
||||
setup {
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
@@ -33,6 +31,7 @@ import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
import com.android.server.wm.flicker.layerBecomesVisible
|
||||
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
|
||||
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -53,7 +52,7 @@ import org.junit.runners.Parameterized
|
||||
class NonResizableLaunchInLegacySplitScreen(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
cleanSetup(this, configuration)
|
||||
setup {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -53,7 +52,7 @@ import org.junit.runners.Parameterized
|
||||
class OpenAppToLegacySplitScreen(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
transitions {
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.graphics.Region
|
||||
import android.os.Bundle
|
||||
import android.util.Rational
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.uiautomator.By
|
||||
import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
@@ -46,6 +44,7 @@ import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEn
|
||||
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.traces.layers.getVisibleBounds
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.helpers.SimpleAppHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -70,7 +69,7 @@ class ResizeLegacySplitScreen(
|
||||
private val testAppTop = SimpleAppHelper(instrumentation)
|
||||
private val testAppBottom = ImeAppHelper(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
setup {
|
||||
eachRun {
|
||||
@@ -151,21 +150,21 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun topAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.showsLayer(sSimpleActivity)
|
||||
this.isVisible(sSimpleActivity)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.showsLayer(sImeActivity)
|
||||
this.isVisible(sImeActivity)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dividerLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.showsLayer(DOCKED_STACK_DIVIDER)
|
||||
this.isVisible(DOCKED_STACK_DIVIDER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,8 +182,8 @@ class ResizeLegacySplitScreen(
|
||||
dividerBounds.bottom - WindowUtils.dockedStackDividerInset,
|
||||
displayBounds.right,
|
||||
displayBounds.bottom - WindowUtils.navigationBarHeight)
|
||||
this.hasVisibleRegion("SimpleActivity", topAppBounds)
|
||||
.hasVisibleRegion("ImeActivity", bottomAppBounds)
|
||||
this.coversExactly(topAppBounds, "SimpleActivity")
|
||||
.coversExactly(bottomAppBounds, "ImeActivity")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,8 +202,8 @@ class ResizeLegacySplitScreen(
|
||||
displayBounds.right,
|
||||
displayBounds.bottom - WindowUtils.navigationBarHeight)
|
||||
|
||||
this.hasVisibleRegion(sSimpleActivity, topAppBounds)
|
||||
.hasVisibleRegion(sImeActivity, bottomAppBounds)
|
||||
this.coversExactly(topAppBounds, sSimpleActivity)
|
||||
.coversExactly(bottomAppBounds, sImeActivity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -54,7 +53,7 @@ import org.junit.runners.Parameterized
|
||||
class RotateOneLaunchedAppAndEnterSplitScreen(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenRotateTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
transitions {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -54,7 +53,7 @@ import org.junit.runners.Parameterized
|
||||
class RotateOneLaunchedAppInSplitScreenMode(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenRotateTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
transitions {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -56,7 +55,7 @@ import org.junit.runners.Parameterized
|
||||
class RotateTwoLaunchedAppAndEnterSplitScreen(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenRotateTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
transitions {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -56,7 +55,7 @@ import org.junit.runners.Parameterized
|
||||
class RotateTwoLaunchedAppInSplitScreenMode(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenRotateTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
super.transition(this, configuration)
|
||||
setup {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -51,7 +50,7 @@ class EnterExitPipTest(
|
||||
private val testApp = FixedAppHelper(instrumentation)
|
||||
private val displayBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = buildTransition(eachRun = true) {
|
||||
setup {
|
||||
eachRun {
|
||||
@@ -68,7 +67,7 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun pipAppRemainInsideVisibleBounds() {
|
||||
testSpec.assertWm {
|
||||
coversAtMostRegion(pipApp.defaultWindowName, displayBounds)
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,10 +94,10 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun showBothAppLayersThenHidePip() {
|
||||
testSpec.assertLayers {
|
||||
showsLayer(testApp.defaultWindowName)
|
||||
.showsLayer(pipApp.defaultWindowName)
|
||||
isVisible(testApp.defaultWindowName)
|
||||
.isVisible(pipApp.defaultWindowName)
|
||||
.then()
|
||||
.hidesLayer(testApp.defaultWindowName)
|
||||
.isInvisible(testApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +105,8 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun testAppCoversFullScreenWithPipOnDisplay() {
|
||||
testSpec.assertLayersStart {
|
||||
hasVisibleRegion(testApp.defaultWindowName, displayBounds)
|
||||
coversAtMostRegion(displayBounds, pipApp.defaultWindowName)
|
||||
coversExactly(displayBounds, testApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +114,7 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun pipAppCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
hasVisibleRegion(pipApp.defaultWindowName, displayBounds)
|
||||
coversExactly(displayBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -48,7 +47,7 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = buildTransition(eachRun = true, stringExtras = emptyMap()) {
|
||||
transitions {
|
||||
pipApp.clickEnterPipButton()
|
||||
@@ -85,7 +84,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun pipLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.showsLayer(pipApp.launcherName)
|
||||
this.isVisible(pipApp.launcherName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -56,7 +55,7 @@ class EnterPipToOtherOrientationTest(
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_90)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_0)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
setupAndTeardown(this, configuration)
|
||||
|
||||
@@ -121,7 +120,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun pipAppLayerHidesTestApp() {
|
||||
testSpec.assertLayersStart {
|
||||
hasVisibleRegion(pipApp.defaultWindowName, startingBounds)
|
||||
coversExactly(startingBounds, pipApp.defaultWindowName)
|
||||
isInvisible(testApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
@@ -130,7 +129,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun testAppLayerCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
hasVisibleRegion(testApp.defaultWindowName, endingBounds)
|
||||
coversExactly(endingBounds, testApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ fun WindowManagerStateSubject.isInPipMode(
|
||||
activity: ComponentName
|
||||
): WindowManagerStateSubject = apply {
|
||||
val windowName = activity.toWindowName()
|
||||
hasWindow(windowName)
|
||||
contains(windowName)
|
||||
val pinnedWindows = wmState.pinnedWindows
|
||||
.map { it.title }
|
||||
Truth.assertWithMessage("Window not in PIP mode")
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -46,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
private val imeApp = ImeAppHelper(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = buildTransition(eachRun = false) { configuration ->
|
||||
setup {
|
||||
test {
|
||||
@@ -78,7 +77,7 @@ class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
fun pipInVisibleBounds() {
|
||||
testSpec.assertWm {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
coversAtMostRegion(pipApp.defaultWindowName, displayBounds)
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -58,7 +57,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
private val testApp = FixedAppHelper(instrumentation)
|
||||
private val displayBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
withTestName { testSpec.name }
|
||||
repeat { testSpec.config.repetitions }
|
||||
@@ -90,7 +89,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun pipWindowInsideDisplayBounds() {
|
||||
testSpec.assertWm {
|
||||
coversAtMostRegion(pipApp.defaultWindowName, displayBounds)
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(testApp.defaultWindowName)
|
||||
isVisible(imeApp.defaultWindowName)
|
||||
noWindowsOverlap(setOf(testApp.defaultWindowName, imeApp.defaultWindowName))
|
||||
noWindowsOverlap(testApp.defaultWindowName, imeApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +115,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun pipLayerInsideDisplayBounds() {
|
||||
testSpec.assertLayers {
|
||||
coversAtMostRegion(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,8 +123,8 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun bothAppLayersVisible() {
|
||||
testSpec.assertLayersEnd {
|
||||
coversAtMostRegion(displayBounds, testApp.defaultWindowName)
|
||||
coversAtMostRegion(displayBounds, imeApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, testApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, imeApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -56,7 +55,7 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(testSpec.config.endRotation)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = buildTransition(eachRun = false) { configuration ->
|
||||
setup {
|
||||
test {
|
||||
@@ -113,8 +112,8 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
@Test
|
||||
fun appLayerRotates_StartingBounds() {
|
||||
testSpec.assertLayersStart {
|
||||
hasVisibleRegion(fixedApp.defaultWindowName, startingBounds)
|
||||
coversAtMostRegion(startingBounds, pipApp.defaultWindowName)
|
||||
coversExactly(startingBounds, fixedApp.defaultWindowName)
|
||||
coversAtMost(startingBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,8 +121,8 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
@Test
|
||||
fun appLayerRotates_EndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
hasVisibleRegion(fixedApp.defaultWindowName, endingBounds)
|
||||
coversAtMostRegion(endingBounds, pipApp.defaultWindowName)
|
||||
coversExactly(endingBounds, fixedApp.defaultWindowName)
|
||||
coversAtMost(endingBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -50,7 +49,7 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class PipToAppTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = buildTransition(eachRun = true) { configuration ->
|
||||
setup {
|
||||
eachRun {
|
||||
@@ -102,9 +101,9 @@ class PipToAppTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun appReplacesPipLayer() {
|
||||
testSpec.assertLayers {
|
||||
this.showsLayer(PIP_WINDOW_TITLE)
|
||||
this.isVisible(PIP_WINDOW_TITLE)
|
||||
.then()
|
||||
.showsLayer(pipApp.launcherName)
|
||||
.isVisible(pipApp.launcherName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
@@ -29,6 +28,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.focusChanges
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
@@ -50,7 +50,7 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class PipToHomeTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = buildTransition(eachRun = true) { configuration ->
|
||||
setup {
|
||||
eachRun {
|
||||
@@ -97,9 +97,9 @@ class PipToHomeTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun pipLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.showsLayer(PIP_WINDOW_TITLE)
|
||||
this.isVisible(PIP_WINDOW_TITLE)
|
||||
.then()
|
||||
.hidesLayer(PIP_WINDOW_TITLE)
|
||||
.isInvisible(PIP_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class PipToHomeTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() =
|
||||
testSpec.noUncoveredRegions(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
|
||||
@FlakyTest(bugId = 151179149)
|
||||
@Test
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Surface
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
@@ -38,7 +37,7 @@ abstract class PipTransition(protected val testSpec: FlickerTestParameter) {
|
||||
protected val isRotated = testSpec.config.startRotation.isRotated()
|
||||
protected val pipApp = PipAppHelper(instrumentation)
|
||||
protected val broadcastActionTrigger = BroadcastActionTrigger(instrumentation)
|
||||
protected abstract val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
protected abstract val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
|
||||
// Helper class to process test actions by broadcast.
|
||||
protected class BroadcastActionTrigger(private val instrumentation: Instrumentation) {
|
||||
@@ -81,7 +80,7 @@ abstract class PipTransition(protected val testSpec: FlickerTestParameter) {
|
||||
/**
|
||||
* Gets a configuration that handles basic setup and teardown of pip tests
|
||||
*/
|
||||
protected val setupAndTeardown: FlickerBuilder.(Bundle) -> Unit
|
||||
protected val setupAndTeardown: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
setup {
|
||||
test {
|
||||
@@ -112,8 +111,8 @@ abstract class PipTransition(protected val testSpec: FlickerTestParameter) {
|
||||
protected open fun buildTransition(
|
||||
eachRun: Boolean,
|
||||
stringExtras: Map<String, String> = mapOf(Components.PipActivity.EXTRA_ENTER_PIP to "true"),
|
||||
extraSpec: FlickerBuilder.(Bundle) -> Unit = {}
|
||||
): FlickerBuilder.(Bundle) -> Unit {
|
||||
extraSpec: FlickerBuilder.(Map<String, Any?>) -> Unit = {}
|
||||
): FlickerBuilder.(Map<String, Any?>) -> Unit {
|
||||
return { configuration ->
|
||||
setupAndTeardown(this, configuration)
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -54,7 +53,7 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_0)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_90)
|
||||
|
||||
override val transition: FlickerBuilder.(Bundle) -> Unit
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
setupAndTeardown(this, configuration)
|
||||
|
||||
@@ -88,7 +87,7 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
@Test
|
||||
fun pipWindowInsideDisplay() {
|
||||
testSpec.assertWmStart {
|
||||
coversAtMostRegion(pipApp.defaultWindowName, startingBounds)
|
||||
coversAtMost(startingBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +111,7 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
@Test
|
||||
fun pipLayerInsideDisplay() {
|
||||
testSpec.assertLayersStart {
|
||||
coversAtMostRegion(startingBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(startingBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +119,7 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
@Test
|
||||
fun pipAppLayerCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
hasVisibleRegion(pipApp.defaultWindowName, endingBounds)
|
||||
coversExactly(endingBounds, pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.NAV_BAR_LAYER_NAME
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.STATUS_BAR_WINDOW_NAME
|
||||
|
||||
const val APP_PAIR_SPLIT_DIVIDER = "AppPairSplitDivider"
|
||||
const val DOCKED_STACK_DIVIDER = "DockedStackDivider"
|
||||
const val WALLPAPER_TITLE = "Wallpaper"
|
||||
|
||||
fun FlickerTestParameter.statusBarWindowIsAlwaysVisible() {
|
||||
@@ -64,9 +62,9 @@ fun FlickerTestParameter.wallpaperWindowBecomesVisible() {
|
||||
|
||||
fun FlickerTestParameter.wallpaperWindowBecomesInvisible() {
|
||||
assertWm {
|
||||
this.showsBelowAppWindow("Wallpaper")
|
||||
this.showsBelowAppWindow(WALLPAPER_TITLE)
|
||||
.then()
|
||||
.hidesBelowAppWindow("Wallpaper")
|
||||
.hidesBelowAppWindow(WALLPAPER_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,19 +101,19 @@ fun FlickerTestParameter.noUncoveredRegions(
|
||||
if (allStates) {
|
||||
assertLayers {
|
||||
if (startingBounds == endingBounds) {
|
||||
this.coversAtLeastRegion(startingBounds)
|
||||
this.coversAtLeast(startingBounds)
|
||||
} else {
|
||||
this.coversAtLeastRegion(startingBounds)
|
||||
this.coversAtLeast(startingBounds)
|
||||
.then()
|
||||
.coversAtLeastRegion(endingBounds)
|
||||
.coversAtLeast(endingBounds)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assertLayersStart {
|
||||
this.coversAtLeastRegion(startingBounds)
|
||||
this.coversAtLeast(startingBounds)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.coversAtLeastRegion(endingBounds)
|
||||
this.coversAtLeast(endingBounds)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,15 +122,15 @@ fun FlickerTestParameter.noUncoveredRegions(
|
||||
fun FlickerTestParameter.navBarLayerIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertLayers {
|
||||
this.showsLayer(NAV_BAR_LAYER_NAME)
|
||||
this.isVisible(NAV_BAR_LAYER_NAME)
|
||||
.then()
|
||||
.hidesLayer(NAV_BAR_LAYER_NAME)
|
||||
.isInvisible(NAV_BAR_LAYER_NAME)
|
||||
.then()
|
||||
.showsLayer(NAV_BAR_LAYER_NAME)
|
||||
.isVisible(NAV_BAR_LAYER_NAME)
|
||||
}
|
||||
} else {
|
||||
assertLayers {
|
||||
this.showsLayer(NAV_BAR_LAYER_NAME)
|
||||
this.isVisible(NAV_BAR_LAYER_NAME)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,15 +139,15 @@ fun FlickerTestParameter.navBarLayerIsAlwaysVisible(rotatesScreen: Boolean = fal
|
||||
fun FlickerTestParameter.statusBarLayerIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertLayers {
|
||||
this.showsLayer(STATUS_BAR_WINDOW_NAME)
|
||||
this.isVisible(STATUS_BAR_WINDOW_NAME)
|
||||
.then()
|
||||
hidesLayer(STATUS_BAR_WINDOW_NAME)
|
||||
.isInvisible(STATUS_BAR_WINDOW_NAME)
|
||||
.then()
|
||||
.showsLayer(STATUS_BAR_WINDOW_NAME)
|
||||
.isVisible(STATUS_BAR_WINDOW_NAME)
|
||||
}
|
||||
} else {
|
||||
assertLayers {
|
||||
this.showsLayer(STATUS_BAR_WINDOW_NAME)
|
||||
this.isVisible(STATUS_BAR_WINDOW_NAME)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,10 +161,10 @@ fun FlickerTestParameter.navBarLayerRotatesAndScales(
|
||||
val endingPos = WindowUtils.getNavigationBarPosition(endRotation)
|
||||
|
||||
assertLayersStart {
|
||||
this.hasVisibleRegion(NAV_BAR_LAYER_NAME, startingPos)
|
||||
this.coversExactly(startingPos, NAV_BAR_LAYER_NAME)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.hasVisibleRegion(NAV_BAR_LAYER_NAME, endingPos)
|
||||
this.coversExactly(endingPos, NAV_BAR_LAYER_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,10 +177,10 @@ fun FlickerTestParameter.statusBarLayerRotatesScales(
|
||||
val endingPos = WindowUtils.getStatusBarPosition(endRotation)
|
||||
|
||||
assertLayersStart {
|
||||
this.hasVisibleRegion(STATUS_BAR_WINDOW_NAME, startingPos)
|
||||
this.coversExactly(startingPos, STATUS_BAR_WINDOW_NAME)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.hasVisibleRegion(STATUS_BAR_WINDOW_NAME, endingPos)
|
||||
this.coversExactly(endingPos, STATUS_BAR_WINDOW_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,39 +195,41 @@ fun FlickerTestParameter.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
|
||||
fun FlickerTestParameter.appLayerReplacesWallpaperLayer(appName: String) {
|
||||
assertLayers {
|
||||
this.showsLayer("Wallpaper")
|
||||
this.isVisible(WALLPAPER_TITLE)
|
||||
.then()
|
||||
.replaceVisibleLayer("Wallpaper", appName)
|
||||
.isInvisible(WALLPAPER_TITLE)
|
||||
.isVisible(appName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.wallpaperLayerReplacesAppLayer(testApp: IAppHelper) {
|
||||
assertLayers {
|
||||
this.showsLayer(testApp.getPackage())
|
||||
this.isVisible(testApp.getPackage())
|
||||
.then()
|
||||
.replaceVisibleLayer(testApp.getPackage(), WALLPAPER_TITLE)
|
||||
.isInvisible(testApp.getPackage())
|
||||
.isVisible(WALLPAPER_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerAlwaysVisible(packageName: String) {
|
||||
assertLayers {
|
||||
this.showsLayer(packageName)
|
||||
this.isVisible(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerBecomesVisible(packageName: String) {
|
||||
assertLayers {
|
||||
this.hidesLayer(packageName)
|
||||
this.isInvisible(packageName)
|
||||
.then()
|
||||
.showsLayer(packageName)
|
||||
.isVisible(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerBecomesInvisible(packageName: String) {
|
||||
assertLayers {
|
||||
this.showsLayer(packageName)
|
||||
this.isVisible(packageName)
|
||||
.then()
|
||||
.hidesLayer(packageName)
|
||||
.isInvisible(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,23 +23,23 @@ const val IME_WINDOW_TITLE = "InputMethod"
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.hidesLayer(IME_WINDOW_TITLE)
|
||||
this.isInvisible(IME_WINDOW_TITLE)
|
||||
.then()
|
||||
.showsLayer(IME_WINDOW_TITLE)
|
||||
.isVisible(IME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.showsLayer(IME_WINDOW_TITLE)
|
||||
this.isVisible(IME_WINDOW_TITLE)
|
||||
.then()
|
||||
.hidesLayer(IME_WINDOW_TITLE)
|
||||
.isInvisible(IME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeAppLayerIsAlwaysVisible(testApp: IAppHelper) {
|
||||
assertLayers {
|
||||
this.showsLayer(testApp.getPackage())
|
||||
this.isVisible(testApp.getPackage())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,9 +83,8 @@ fun FlickerTestParameter.imeAppWindowBecomesInvisible(testApp: IAppHelper) {
|
||||
|
||||
fun FlickerTestParameter.imeAppLayerBecomesInvisible(testApp: IAppHelper) {
|
||||
assertLayers {
|
||||
this.skipUntilFirstAssertion()
|
||||
.showsLayer(testApp.getPackage())
|
||||
this.isVisible(testApp.getPackage())
|
||||
.then()
|
||||
.hidesLayer(testApp.getPackage())
|
||||
.isInvisible(testApp.getPackage())
|
||||
}
|
||||
}
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
package com.android.server.wm.flicker.rotation
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.focusDoesNotChange
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
@@ -54,7 +54,15 @@ class ChangeAppRotationTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : RotationTransition(testSpec) {
|
||||
override val testApp = SimpleAppHelper(instrumentation)
|
||||
override fun getAppLaunchParams(configuration: Bundle): Map<String, String> = emptyMap()
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
setup {
|
||||
test {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -78,11 +86,11 @@ class ChangeAppRotationTest(
|
||||
@Test
|
||||
fun screenshotLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.showsLayer(testApp.getPackage())
|
||||
this.isVisible(testApp.getPackage())
|
||||
.then()
|
||||
.showsLayer(SCREENSHOT_LAYER)
|
||||
.isVisible(SCREENSHOT_LAYER)
|
||||
.then()
|
||||
.showsLayer(testApp.getPackage())
|
||||
.isVisible(testApp.getPackage())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +121,7 @@ class ChangeAppRotationTest(
|
||||
@Test
|
||||
fun appLayerRotates_StartingPos() {
|
||||
testSpec.assertLayersStart {
|
||||
this.hasVisibleRegion(testApp.getPackage(), startingPos)
|
||||
this.coversExactly(startingPos, testApp.getPackage())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +129,7 @@ class ChangeAppRotationTest(
|
||||
@Test
|
||||
fun appLayerRotates_EndingPos() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.hasVisibleRegion(testApp.getPackage(), endingPos)
|
||||
this.coversExactly(endingPos, testApp.getPackage())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.server.wm.flicker.rotation
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.os.Bundle
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
@@ -31,36 +30,37 @@ import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
|
||||
abstract class RotationTransition(protected val testSpec: FlickerTestParameter) {
|
||||
protected abstract val testApp: StandardAppHelper
|
||||
|
||||
protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
protected val startingPos get() = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
protected val endingPos get() = WindowUtils.getDisplayBounds(testSpec.config.endRotation)
|
||||
|
||||
protected abstract val testApp: StandardAppHelper
|
||||
protected abstract fun getAppLaunchParams(configuration: Bundle): Map<String, String>
|
||||
protected open val transition: FlickerBuilder.(Map<String, Any?>) -> Unit = {
|
||||
withTestName { testSpec.name }
|
||||
repeat { testSpec.config.repetitions }
|
||||
setup {
|
||||
test {
|
||||
device.wakeUpAndGoToHomeScreen()
|
||||
}
|
||||
eachRun {
|
||||
this.setRotation(testSpec.config.startRotation)
|
||||
}
|
||||
}
|
||||
teardown {
|
||||
test {
|
||||
testApp.exit()
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
this.setRotation(testSpec.config.endRotation)
|
||||
}
|
||||
}
|
||||
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
withTestName { testSpec.name }
|
||||
repeat { testSpec.config.repetitions }
|
||||
setup {
|
||||
test {
|
||||
device.wakeUpAndGoToHomeScreen()
|
||||
val extras = getAppLaunchParams(testSpec.config)
|
||||
testApp.launchViaIntent(wmHelper, stringExtras = extras)
|
||||
}
|
||||
eachRun {
|
||||
this.setRotation(testSpec.config.startRotation)
|
||||
}
|
||||
}
|
||||
teardown {
|
||||
test {
|
||||
testApp.exit()
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
this.setRotation(testSpec.config.endRotation)
|
||||
}
|
||||
transition(testSpec.config)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.server.wm.flicker.rotation
|
||||
|
||||
import android.os.Bundle
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -24,6 +23,7 @@ import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.appWindowAlwaysVisibleOnTop
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.focusDoesNotChange
|
||||
import com.android.server.wm.flicker.helpers.SeamlessRotationAppHelper
|
||||
@@ -58,9 +58,18 @@ class SeamlessAppRotationTest(
|
||||
) : RotationTransition(testSpec) {
|
||||
override val testApp = SeamlessRotationAppHelper(instrumentation)
|
||||
|
||||
override fun getAppLaunchParams(configuration: Bundle): Map<String, String> = mapOf(
|
||||
ActivityOptions.EXTRA_STARVE_UI_THREAD to configuration.starveUiThread.toString()
|
||||
)
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
setup {
|
||||
test {
|
||||
testApp.launchViaIntent(wmHelper,
|
||||
stringExtras = mapOf(
|
||||
ActivityOptions.EXTRA_STARVE_UI_THREAD to it.starveUiThread.toString())
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -115,7 +124,7 @@ class SeamlessAppRotationTest(
|
||||
@Test
|
||||
fun appLayerRotates() {
|
||||
testSpec.assertLayers {
|
||||
this.hasVisibleRegion(testApp.`package`, startingPos)
|
||||
this.coversExactly(startingPos, testApp.`package`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,12 +135,14 @@ class SeamlessAppRotationTest(
|
||||
companion object {
|
||||
private val testFactory = FlickerTestParameterFactory.getInstance()
|
||||
|
||||
private val Bundle.starveUiThread
|
||||
get() = this.getBoolean(ActivityOptions.EXTRA_STARVE_UI_THREAD, false)
|
||||
private val Map<String, Any?>.starveUiThread
|
||||
get() = this.getOrDefault(ActivityOptions.EXTRA_STARVE_UI_THREAD, false) as Boolean
|
||||
|
||||
private fun FlickerTestParameter.createConfig(starveUiThread: Boolean): Bundle {
|
||||
val config = this.config.deepCopy()
|
||||
config.putBoolean(ActivityOptions.EXTRA_STARVE_UI_THREAD, starveUiThread)
|
||||
private fun FlickerTestParameter.createConfig(
|
||||
starveUiThread: Boolean
|
||||
): MutableMap<String, Any?> {
|
||||
val config = this.config.toMutableMap()
|
||||
config[ActivityOptions.EXTRA_STARVE_UI_THREAD] = starveUiThread
|
||||
return config
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user