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