Merge "[DO NOT MERGE] Full - Compatibilize winscope with master" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0b7f506aa9
@@ -25,11 +25,17 @@ package {
|
||||
|
||||
android_test {
|
||||
name: "WMShellFlickerTests",
|
||||
srcs: ["src/**/*.java", "src/**/*.kt"],
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
],
|
||||
manifest: "AndroidManifest.xml",
|
||||
test_config: "AndroidTest.xml",
|
||||
platform_apis: true,
|
||||
certificate: "platform",
|
||||
optimize: {
|
||||
enabled: false,
|
||||
},
|
||||
test_suites: ["device-tests"],
|
||||
libs: ["android.test.runner"],
|
||||
static_libs: [
|
||||
|
||||
@@ -16,97 +16,100 @@
|
||||
|
||||
package com.android.wm.shell.flicker
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.graphics.Region
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.traces.layers.getVisibleBounds
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerIsVisible() {
|
||||
fun FlickerTestParameter.appPairsDividerIsVisibleAtEnd() {
|
||||
assertLayersEnd {
|
||||
this.isVisible(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.isVisible(APP_PAIR_SPLIT_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerIsInvisible() {
|
||||
fun FlickerTestParameter.appPairsDividerIsInvisibleAtEnd() {
|
||||
assertLayersEnd {
|
||||
this.notContains(APP_PAIR_SPLIT_DIVIDER)
|
||||
this.notContains(APP_PAIR_SPLIT_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER)
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(DOCKED_STACK_DIVIDER)
|
||||
.isVisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerIsVisible() {
|
||||
fun FlickerTestParameter.dockedStackDividerIsVisibleAtEnd() {
|
||||
assertLayersEnd {
|
||||
this.isVisible(DOCKED_STACK_DIVIDER)
|
||||
this.isVisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER)
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(DOCKED_STACK_DIVIDER)
|
||||
.isVisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(DOCKED_STACK_DIVIDER)
|
||||
this.isVisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(DOCKED_STACK_DIVIDER)
|
||||
.isInvisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerIsInvisible() {
|
||||
fun FlickerTestParameter.dockedStackDividerNotExistsAtEnd() {
|
||||
assertLayersEnd {
|
||||
this.notContains(DOCKED_STACK_DIVIDER)
|
||||
this.notContains(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsPrimaryBoundsIsVisible(rotation: Int, primaryLayerName: String) {
|
||||
fun FlickerTestParameter.appPairsPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
primaryComponent: ComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
visibleRegion(primaryLayerName)
|
||||
val dividerRegion = layer(APP_PAIR_SPLIT_DIVIDER_COMPONENT).visibleRegion.region
|
||||
visibleRegion(primaryComponent)
|
||||
.coversExactly(getPrimaryRegion(dividerRegion, rotation))
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisible(
|
||||
fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
primaryLayerName: String
|
||||
primaryComponent: ComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER)
|
||||
visibleRegion(primaryLayerName)
|
||||
val dividerRegion = layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region
|
||||
visibleRegion(primaryComponent)
|
||||
.coversExactly(getPrimaryRegion(dividerRegion, rotation))
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsSecondaryBoundsIsVisible(
|
||||
fun FlickerTestParameter.appPairsSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
secondaryLayerName: String
|
||||
secondaryComponent: ComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
visibleRegion(secondaryLayerName)
|
||||
val dividerRegion = layer(APP_PAIR_SPLIT_DIVIDER_COMPONENT).visibleRegion.region
|
||||
visibleRegion(secondaryComponent)
|
||||
.coversExactly(getSecondaryRegion(dividerRegion, rotation))
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisible(
|
||||
fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
secondaryLayerName: String
|
||||
secondaryComponent: ComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER)
|
||||
visibleRegion(secondaryLayerName)
|
||||
val dividerRegion = layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region
|
||||
visibleRegion(secondaryComponent)
|
||||
.coversExactly(getSecondaryRegion(dividerRegion, rotation))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("CommonConstants")
|
||||
package com.android.wm.shell.flicker
|
||||
|
||||
const val IME_WINDOW_NAME = "InputMethod"
|
||||
import android.content.ComponentName
|
||||
|
||||
const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui"
|
||||
const val APP_PAIR_SPLIT_DIVIDER = "AppPairSplitDivider"
|
||||
const val DOCKED_STACK_DIVIDER = "DockedStackDivider"
|
||||
val APP_PAIR_SPLIT_DIVIDER_COMPONENT = ComponentName("", "AppPairSplitDivider#")
|
||||
val DOCKED_STACK_DIVIDER_COMPONENT = ComponentName("", "DockedStackDivider#")
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -25,7 +24,7 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsInvisible
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsInvisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
@@ -61,7 +60,7 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
// TODO pair apps through normal UX flow
|
||||
executeShellCommand(
|
||||
composePairsCommand(primaryTaskId, nonResizeableTaskId, pair = true))
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
nonResizeableApp?.run { wmHelper.waitForFullScreenApp(nonResizeableApp.component) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,15 +84,13 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
@Test
|
||||
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() {
|
||||
super.navBarLayerIsAlwaysVisible()
|
||||
}
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsInvisible() = testSpec.appPairsDividerIsInvisible()
|
||||
fun appPairsDividerIsInvisibleAtEnd() = testSpec.appPairsDividerIsInvisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -103,8 +100,8 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
"Non resizeable app not initialized"
|
||||
}
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isInvisible(primaryApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isInvisible(primaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -25,10 +24,10 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.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.APP_PAIR_SPLIT_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.waitAppsShown
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -54,10 +53,14 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
// TODO pair apps through normal UX flow
|
||||
executeShellCommand(
|
||||
composePairsCommand(primaryTaskId, secondaryTaskId, pair = true))
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
waitAppsShown(primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
@@ -68,14 +71,14 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsVisible() = testSpec.appPairsDividerIsVisible()
|
||||
fun appPairsDividerIsVisibleAtEnd() = testSpec.appPairsDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(secondaryApp.defaultWindowName)
|
||||
isVisible(primaryApp.component)
|
||||
isVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,10 +86,10 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
@Test
|
||||
fun appsEndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
visibleRegion(primaryApp.defaultWindowName)
|
||||
val dividerRegion = layer(APP_PAIR_SPLIT_DIVIDER_COMPONENT).visibleRegion.region
|
||||
visibleRegion(primaryApp.component)
|
||||
.coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
visibleRegion(secondaryApp.defaultWindowName)
|
||||
visibleRegion(secondaryApp.component)
|
||||
.coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -25,7 +24,7 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisible
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
@@ -61,7 +60,7 @@ class AppPairsTestSupportPairNonResizeableApps(
|
||||
// TODO pair apps through normal UX flow
|
||||
executeShellCommand(
|
||||
composePairsCommand(primaryTaskId, nonResizeableTaskId, pair = true))
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
nonResizeableApp?.run { wmHelper.waitForFullScreenApp(nonResizeableApp.component) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +76,10 @@ class AppPairsTestSupportPairNonResizeableApps(
|
||||
resetMultiWindowConfig(instrumentation)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
@@ -87,7 +90,7 @@ class AppPairsTestSupportPairNonResizeableApps(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsVisible() = testSpec.appPairsDividerIsVisible()
|
||||
fun appPairsDividerIsVisibleAtEnd() = testSpec.appPairsDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -97,8 +100,8 @@ class AppPairsTestSupportPairNonResizeableApps(
|
||||
"Non resizeable app not initialized"
|
||||
}
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isVisible(primaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.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.APP_PAIR_SPLIT_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsInvisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.waitAppsShown
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -51,9 +51,11 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
get() = {
|
||||
super.transition(this, it)
|
||||
setup {
|
||||
executeShellCommand(
|
||||
composePairsCommand(primaryTaskId, secondaryTaskId, pair = true))
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
eachRun {
|
||||
executeShellCommand(
|
||||
composePairsCommand(primaryTaskId, secondaryTaskId, pair = true))
|
||||
waitAppsShown(primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
// TODO pair apps through normal UX flow
|
||||
@@ -73,14 +75,14 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsInvisible() = testSpec.appPairsDividerIsInvisible()
|
||||
fun appPairsDividerIsInvisibleAtEnd() = testSpec.appPairsDividerIsInvisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun bothAppWindowsInvisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isInvisible(primaryApp.defaultWindowName)
|
||||
isInvisible(secondaryApp.defaultWindowName)
|
||||
isInvisible(primaryApp.component)
|
||||
isInvisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,10 +90,10 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
@Test
|
||||
fun appsStartingBounds() {
|
||||
testSpec.assertLayersStart {
|
||||
val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER)
|
||||
visibleRegion(primaryApp.defaultWindowName)
|
||||
val dividerRegion = layer(APP_PAIR_SPLIT_DIVIDER_COMPONENT).visibleRegion.region
|
||||
visibleRegion(primaryApp.component)
|
||||
.coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion))
|
||||
visibleRegion(secondaryApp.defaultWindowName)
|
||||
visibleRegion(secondaryApp.component)
|
||||
.coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion))
|
||||
}
|
||||
}
|
||||
@@ -100,16 +102,14 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
@Test
|
||||
fun appsEndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
notContains(primaryApp.defaultWindowName)
|
||||
notContains(secondaryApp.defaultWindowName)
|
||||
notContains(primaryApp.component)
|
||||
notContains(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() {
|
||||
super.navBarLayerIsAlwaysVisible()
|
||||
}
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -30,14 +30,14 @@ import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.isRotated
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.helpers.BaseAppHelper
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.getDevEnableNonResizableMultiWindow
|
||||
@@ -154,26 +154,26 @@ abstract class AppPairsTransition(protected val testSpec: FlickerTestParameter)
|
||||
|
||||
@FlakyTest(bugId = 186510496)
|
||||
@Test
|
||||
open fun navBarLayerIsAlwaysVisible() {
|
||||
testSpec.navBarLayerIsAlwaysVisible()
|
||||
open fun navBarLayerIsVisible() {
|
||||
testSpec.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsAlwaysVisible() {
|
||||
testSpec.statusBarLayerIsAlwaysVisible()
|
||||
open fun statusBarLayerIsVisible() {
|
||||
testSpec.statusBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsAlwaysVisible() {
|
||||
testSpec.navBarWindowIsAlwaysVisible()
|
||||
open fun navBarWindowIsVisible() {
|
||||
testSpec.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsAlwaysVisible() {
|
||||
testSpec.statusBarWindowIsAlwaysVisible()
|
||||
open fun statusBarWindowIsVisible() {
|
||||
testSpec.statusBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -28,10 +27,10 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisible
|
||||
import com.android.wm.shell.flicker.appPairsPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.appPairsSecondaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.appPairsPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.appPairsSecondaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.waitAppsShown
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -57,41 +56,43 @@ class RotateTwoLaunchedAppsInAppPairsMode(
|
||||
transitions {
|
||||
executeShellCommand(composePairsCommand(
|
||||
primaryTaskId, secondaryTaskId, true /* pair */))
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
waitAppsShown(primaryApp, secondaryApp)
|
||||
setRotation(testSpec.config.endRotation)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() {
|
||||
super.statusBarLayerIsAlwaysVisible()
|
||||
}
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsVisible() = super.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
.isVisible(secondaryApp.defaultWindowName)
|
||||
isVisible(primaryApp.component)
|
||||
.isVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsVisible() = testSpec.appPairsDividerIsVisible()
|
||||
fun appPairsDividerIsVisibleAtEnd() = testSpec.appPairsDividerIsVisibleAtEnd()
|
||||
|
||||
@FlakyTest(bugId = 172776659)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsPrimaryBoundsIsVisible() =
|
||||
testSpec.appPairsPrimaryBoundsIsVisible(testSpec.config.endRotation,
|
||||
primaryApp.defaultWindowName)
|
||||
fun appPairsPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.appPairsPrimaryBoundsIsVisibleAtEnd(testSpec.config.endRotation,
|
||||
primaryApp.component)
|
||||
|
||||
@FlakyTest(bugId = 172776659)
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appPairsSecondaryBoundsIsVisible() =
|
||||
testSpec.appPairsSecondaryBoundsIsVisible(testSpec.config.endRotation,
|
||||
secondaryApp.defaultWindowName)
|
||||
fun appPairsSecondaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.appPairsSecondaryBoundsIsVisibleAtEnd(testSpec.config.endRotation,
|
||||
secondaryApp.component)
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.apppairs
|
||||
|
||||
import android.os.SystemClock
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -28,12 +27,10 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisible
|
||||
import com.android.wm.shell.flicker.appPairsPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.appPairsSecondaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.appPairsDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.appPairsPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.appPairsSecondaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.waitAppsShown
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -60,48 +57,50 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
|
||||
this.setRotation(testSpec.config.endRotation)
|
||||
executeShellCommand(
|
||||
composePairsCommand(primaryTaskId, secondaryTaskId, pair = true))
|
||||
SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
|
||||
waitAppsShown(primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsVisible() = testSpec.appPairsDividerIsVisible()
|
||||
fun appPairsDividerIsVisibleAtEnd() = testSpec.appPairsDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsVisible() = super.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() {
|
||||
super.statusBarLayerIsAlwaysVisible()
|
||||
}
|
||||
override fun statusBarWindowIsVisible() = super.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsVisible() = super.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(secondaryApp.defaultWindowName)
|
||||
isVisible(primaryApp.component)
|
||||
isVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 172776659)
|
||||
@Test
|
||||
fun appPairsPrimaryBoundsIsVisible() =
|
||||
testSpec.appPairsPrimaryBoundsIsVisible(testSpec.config.endRotation,
|
||||
primaryApp.defaultWindowName)
|
||||
fun appPairsPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.appPairsPrimaryBoundsIsVisibleAtEnd(testSpec.config.endRotation,
|
||||
primaryApp.component)
|
||||
|
||||
@FlakyTest(bugId = 172776659)
|
||||
@Test
|
||||
fun appPairsSecondaryBoundsIsVisible() =
|
||||
testSpec.appPairsSecondaryBoundsIsVisible(testSpec.config.endRotation,
|
||||
secondaryApp.defaultWindowName)
|
||||
fun appPairsSecondaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.appPairsSecondaryBoundsIsVisibleAtEnd(testSpec.config.endRotation,
|
||||
secondaryApp.component)
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -40,8 +40,8 @@ abstract class RotateTwoLaunchedAppsTransition(
|
||||
test {
|
||||
device.wakeUpAndGoToHomeScreen()
|
||||
this.setRotation(Surface.ROTATION_0)
|
||||
primaryApp.launchViaIntent()
|
||||
secondaryApp.launchViaIntent()
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
secondaryApp.launchViaIntent(wmHelper)
|
||||
updateTasksId()
|
||||
}
|
||||
}
|
||||
@@ -64,8 +64,8 @@ abstract class RotateTwoLaunchedAppsTransition(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() {
|
||||
super.navBarLayerIsAlwaysVisible()
|
||||
override fun navBarLayerIsVisible() {
|
||||
super.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.helpers
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.graphics.Region
|
||||
import com.android.server.wm.flicker.Flicker
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
|
||||
class AppPairsHelper(
|
||||
@@ -43,5 +44,17 @@ class AppPairsHelper(
|
||||
companion object {
|
||||
const val TEST_REPETITIONS = 1
|
||||
const val TIMEOUT_MS = 3_000L
|
||||
|
||||
fun Flicker.waitAppsShown(app1: SplitScreenHelper?, app2: SplitScreenHelper?) {
|
||||
wmHelper.waitFor("primaryAndSecondaryAppsVisible") { dump ->
|
||||
val primaryAppVisible = app1?.let {
|
||||
dump.wmState.isWindowSurfaceShown(app1.defaultWindowName)
|
||||
} ?: false
|
||||
val secondaryAppVisible = app2?.let {
|
||||
dump.wmState.isWindowSurfaceShown(app2.defaultWindowName)
|
||||
} ?: false
|
||||
primaryAppVisible && secondaryAppVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ open class ImeAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
if (wmHelper == null) {
|
||||
device.waitForIdle()
|
||||
} else {
|
||||
require(wmHelper.waitImeWindowShown()) { "IME did not appear" }
|
||||
require(wmHelper.waitImeShown()) { "IME did not appear" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ open class ImeAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
if (wmHelper == null) {
|
||||
uiDevice.waitForIdle()
|
||||
} else {
|
||||
require(wmHelper.waitImeWindowGone()) { "IME did did not close" }
|
||||
require(wmHelper.waitImeGone()) { "IME did did not close" }
|
||||
}
|
||||
} else {
|
||||
// While pressing the back button should close the IME on TV as well, it may also lead
|
||||
|
||||
@@ -62,7 +62,7 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
stringExtras: Map<String, String>
|
||||
) {
|
||||
super.launchViaIntent(wmHelper, expectedWindowName, action, stringExtras)
|
||||
wmHelper.waitFor { it.wmState.hasPipWindow() }
|
||||
wmHelper.waitFor("hasPipWindow") { it.wmState.hasPipWindow() }
|
||||
}
|
||||
|
||||
private fun focusOnObject(selector: BySelector): Boolean {
|
||||
@@ -84,7 +84,7 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
clickObject(ENTER_PIP_BUTTON_ID)
|
||||
|
||||
// Wait on WMHelper or simply wait for 3 seconds
|
||||
wmHelper?.waitFor { it.wmState.hasPipWindow() } ?: SystemClock.sleep(3_000)
|
||||
wmHelper?.waitFor("hasPipWindow") { it.wmState.hasPipWindow() } ?: SystemClock.sleep(3_000)
|
||||
}
|
||||
|
||||
fun clickStartMediaSessionButton() {
|
||||
@@ -137,7 +137,7 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
}
|
||||
|
||||
// Wait for animation to complete.
|
||||
wmHelper.waitFor { !it.wmState.hasPipWindow() }
|
||||
wmHelper.waitFor("!hasPipWindow") { !it.wmState.hasPipWindow() }
|
||||
wmHelper.waitForHomeActivityVisible()
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
val windowRect = windowRegion.bounds
|
||||
uiDevice.click(windowRect.centerX(), windowRect.centerY())
|
||||
uiDevice.click(windowRect.centerX(), windowRect.centerY())
|
||||
wmHelper.waitFor { !it.wmState.hasPipWindow() }
|
||||
wmHelper.waitFor("!hasPipWindow") { !it.wmState.hasPipWindow() }
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
}
|
||||
|
||||
|
||||
@@ -16,22 +16,24 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
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.HOME_WINDOW_TITLE
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -60,16 +62,16 @@ class EnterSplitScreenDockActivity(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME, LIVE_WALLPAPER_PACKAGE_NAME,
|
||||
splitScreenApp.defaultWindowName, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME, *HOME_WINDOW_TITLE)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, LIVE_WALLPAPER_COMPONENT,
|
||||
splitScreenApp.component, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT, LAUNCHER_COMPONENT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackPrimaryBoundsIsVisible() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
splitScreenApp.defaultWindowName)
|
||||
fun dockedStackPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -77,27 +79,39 @@ class EnterSplitScreenDockActivity(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.defaultWindowName)
|
||||
isVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
repetitions = SplitScreenHelper.TEST_REPETITIONS,
|
||||
supportedRotations = listOf(Surface.ROTATION_0) // bugId = 179116910
|
||||
supportedRotations = listOf(Surface.ROTATION_0), // bugId = 179116910
|
||||
supportedNavigationModes = listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -25,7 +26,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -61,24 +62,34 @@ class EnterSplitScreenFromDetachedRecentTask(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME,
|
||||
splitScreenApp.defaultWindowName)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.defaultWindowName)
|
||||
isVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -23,17 +24,16 @@ 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.annotation.Group1
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -62,22 +62,22 @@ class EnterSplitScreenLaunchToSide(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
|
||||
secondaryApp.defaultWindowName, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, splitScreenApp.component,
|
||||
secondaryApp.component, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackPrimaryBoundsIsVisible() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
splitScreenApp.defaultWindowName)
|
||||
fun dockedStackPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackSecondaryBoundsIsVisible() =
|
||||
testSpec.dockedStackSecondaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
secondaryApp.defaultWindowName)
|
||||
fun dockedStackSecondaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackSecondaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
secondaryApp.component)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -85,15 +85,35 @@ class EnterSplitScreenLaunchToSide(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
// when the app is launched, first the activity becomes visible, then the
|
||||
// SnapshotStartingWindow appears and then the app window becomes visible.
|
||||
// Because we log WM once per frame, sometimes the activity and the window
|
||||
// become visible in the same entry, sometimes not, thus it is not possible to
|
||||
// assert the visibility of the activity here
|
||||
this.isAppWindowInvisible(secondaryApp.component, ignoreActivity = true)
|
||||
.then()
|
||||
// during re-parenting, the window may disappear and reappear from the
|
||||
// trace, this occurs because we log only 1x per frame
|
||||
.notContains(secondaryApp.component, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -26,7 +27,7 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.canSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -70,12 +71,12 @@ class EnterSplitScreenNotSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME,
|
||||
nonResizeableApp.defaultWindowName,
|
||||
splitScreenApp.defaultWindowName)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
nonResizeableApp.component,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -91,7 +92,12 @@ class EnterSplitScreenNotSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsInvisible() = testSpec.dockedStackDividerIsInvisible()
|
||||
fun dockedStackDividerNotExistsAtEnd() = testSpec.dockedStackDividerNotExistsAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -26,7 +27,7 @@ import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -67,12 +68,12 @@ class EnterSplitScreenSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME,
|
||||
nonResizeableApp.defaultWindowName,
|
||||
splitScreenApp.defaultWindowName)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
nonResizeableApp.component,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -88,16 +89,21 @@ class EnterSplitScreenSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -24,15 +25,13 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesInVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.exitSplitScreenFromBottom
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -67,31 +66,52 @@ class ExitLegacySplitScreenFromBottom(
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
device.exitSplitScreenFromBottom()
|
||||
device.exitSplitScreenFromBottom(wmHelper)
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
splitScreenApp.defaultWindowName, secondaryApp.defaultWindowName,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
splitScreenApp.component, secondaryApp.component,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Presubmit
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun layerBecomesInvisible() = testSpec.layerBecomesInvisible(DOCKED_STACK_DIVIDER)
|
||||
fun layerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesInVisible() =
|
||||
testSpec.appWindowBecomesInVisible(secondaryApp.defaultWindowName)
|
||||
fun appWindowBecomesInVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(secondaryApp.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -24,15 +26,13 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesInVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -71,31 +71,52 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
splitScreenApp.defaultWindowName, secondaryApp.defaultWindowName,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
|
||||
@FlakyTest(bugId = 175687842)
|
||||
@Test
|
||||
fun dockedStackDividerIsInvisible() = testSpec.dockedStackDividerIsInvisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun layerBecomesInvisible() = testSpec.layerBecomesInvisible(splitScreenApp.defaultWindowName)
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesInVisible() =
|
||||
testSpec.appWindowBecomesInVisible(splitScreenApp.defaultWindowName)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
splitScreenApp.component, secondaryApp.component,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun dockedStackDividerNotExistsAtEnd() = testSpec.dockedStackDividerNotExistsAtEnd()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun layerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesInVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -23,15 +24,11 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesInVisible
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
import com.android.server.wm.flicker.layerBecomesVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -72,11 +69,11 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER, LAUNCHER_PACKAGE_NAME, LETTERBOX_NAME,
|
||||
nonResizeableApp.defaultWindowName, splitScreenApp.defaultWindowName,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
nonResizeableApp.component, splitScreenApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -92,44 +89,110 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun resizableAppLayerBecomesInvisible() =
|
||||
testSpec.layerBecomesInvisible(splitScreenApp.defaultWindowName)
|
||||
fun resizableAppLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppLayerBecomesVisible() =
|
||||
testSpec.layerBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
fun nonResizableAppLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.notContains(nonResizeableApp.component)
|
||||
.then()
|
||||
.isInvisible(nonResizeableApp.component)
|
||||
.then()
|
||||
.isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assets that [splitScreenApp] exists at the start of the trace and, once it becomes
|
||||
* invisible, it remains invisible until the end of the trace.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun resizableAppWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
// when the activity gets PAUSED the window may still be marked as visible
|
||||
// it will be updated in the next log entry. This occurs because we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
this.isAppWindowVisible(splitScreenApp.component, ignoreActivity = true)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowInvisible(splitScreenApp.component, ignoreActivity = true)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assets that [nonResizeableApp] doesn't exist at the start of the trace, then
|
||||
* [nonResizeableApp] is created (visible or not) and, once [nonResizeableApp] becomes
|
||||
* visible, it remains visible until the end of the trace.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.notContains(nonResizeableApp.component)
|
||||
.then()
|
||||
// we log once per frame, upon logging, window may be visible or not depending
|
||||
// on what was processed until that moment. Both behaviors are correct
|
||||
.isAppWindowInvisible(nonResizeableApp.component,
|
||||
ignoreActivity = true, isOptional = true)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowVisible(nonResizeableApp.component, ignoreActivity = true)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that both the app window and the activity are visible at the end of the trace
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
this.isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun resizableAppWindowBecomesInvisible() =
|
||||
testSpec.appWindowBecomesInVisible(splitScreenApp.defaultWindowName)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsInvisibleAtEnd() = testSpec.dockedStackDividerIsInvisible()
|
||||
fun dockedStackDividerNotExistsAtEnd() = testSpec.dockedStackDividerNotExistsAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun onlyNonResizableAppWindowIsVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isInvisible(splitScreenApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isInvisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
repetitions = SplitScreenHelper.TEST_REPETITIONS,
|
||||
supportedRotations = listOf(Surface.ROTATION_0)) // b/178685668
|
||||
repetitions = SplitScreenHelper.TEST_REPETITIONS,
|
||||
supportedRotations = listOf(Surface.ROTATION_0)) // b/178685668
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -23,13 +24,11 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.layerBecomesVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -70,11 +69,11 @@ class LegacySplitScreenFromIntentSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER, LAUNCHER_PACKAGE_NAME, LETTERBOX_NAME,
|
||||
nonResizeableApp.defaultWindowName, splitScreenApp.defaultWindowName,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
nonResizeableApp.component, splitScreenApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -90,27 +89,60 @@ class LegacySplitScreenFromIntentSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppLayerBecomesVisible() =
|
||||
testSpec.layerBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
fun nonResizableAppLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(nonResizeableApp.component)
|
||||
.then()
|
||||
.isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assets that [nonResizeableApp] doesn't exist at the start of the trace, then
|
||||
* [nonResizeableApp] is created (visible or not) and, once [nonResizeableApp] becomes
|
||||
* visible, it remains visible until the end of the trace.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.notContains(nonResizeableApp.component)
|
||||
.then()
|
||||
// we log once per frame, upon logging, window may be visible or not depending
|
||||
// on what was processed until that moment. Both behaviors are correct
|
||||
.isAppWindowInvisible(nonResizeableApp.component,
|
||||
ignoreActivity = true, isOptional = true)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowVisible(nonResizeableApp.component, ignoreActivity = true)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun bothAppsWindowsAreVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isVisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -23,16 +25,12 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesInVisible
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
import com.android.server.wm.flicker.layerBecomesVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -73,11 +71,11 @@ class LegacySplitScreenFromRecentNotSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER, LAUNCHER_PACKAGE_NAME, LETTERBOX_NAME, TOAST_NAME,
|
||||
splitScreenApp.defaultWindowName, nonResizeableApp.defaultWindowName,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
TOAST_COMPONENT, splitScreenApp.component, nonResizeableApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -93,37 +91,73 @@ class LegacySplitScreenFromRecentNotSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun resizableAppLayerBecomesInvisible() =
|
||||
testSpec.layerBecomesInvisible(splitScreenApp.defaultWindowName)
|
||||
fun resizableAppLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppLayerBecomesVisible() =
|
||||
testSpec.layerBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
fun nonResizableAppLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(nonResizeableApp.component)
|
||||
.then()
|
||||
.isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun resizableAppWindowBecomesInvisible() =
|
||||
testSpec.appWindowBecomesInVisible(splitScreenApp.defaultWindowName)
|
||||
fun resizableAppWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
// when the activity gets PAUSED the window may still be marked as visible
|
||||
// it will be updated in the next log entry. This occurs because we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
this.isAppWindowVisible(splitScreenApp.component, ignoreActivity = true)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowInvisible(splitScreenApp.component, ignoreActivity = true)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(nonResizeableApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsInvisibleAtEnd() = testSpec.dockedStackDividerIsInvisible()
|
||||
fun dockedStackDividerNotExistsAtEnd() = testSpec.dockedStackDividerNotExistsAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun onlyNonResizableAppWindowIsVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isInvisible(splitScreenApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isInvisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -23,14 +24,12 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.layerBecomesVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -71,11 +70,11 @@ class LegacySplitScreenFromRecentSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER, LAUNCHER_PACKAGE_NAME, LETTERBOX_NAME, TOAST_NAME,
|
||||
splitScreenApp.defaultWindowName, nonResizeableApp.defaultWindowName,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
TOAST_COMPONENT, splitScreenApp.component, nonResizeableApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -91,27 +90,60 @@ class LegacySplitScreenFromRecentSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppLayerBecomesVisible() =
|
||||
testSpec.layerBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
fun nonResizableAppLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(nonResizeableApp.component)
|
||||
.then()
|
||||
.isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
fun nonResizableAppWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
// when the app is launched, first the activity becomes visible, then the
|
||||
// SnapshotStartingWindow appears and then the app window becomes visible.
|
||||
// Because we log WM once per frame, sometimes the activity and the window
|
||||
// become visible in the same entry, sometimes not, thus it is not possible to
|
||||
// assert the visibility of the activity here
|
||||
this.isAppWindowInvisible(nonResizeableApp.component, ignoreActivity = true)
|
||||
.then()
|
||||
// during re-parenting, the window may disappear and reappear from the
|
||||
// trace, this occurs because we log only 1x per frame
|
||||
.notContains(nonResizeableApp.component, isOptional = true)
|
||||
.then()
|
||||
// if the window reappears after re-parenting it will most likely not
|
||||
// be visible in the first log entry (because we log only 1x per frame)
|
||||
.isAppWindowInvisible(nonResizeableApp.component, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun bothAppsWindowsAreVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isVisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
@@ -27,20 +27,18 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
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.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.exitSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.openQuickStepAndClearRecentAppsFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.dockedStackDividerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.helpers.SimpleAppHelper
|
||||
@@ -62,8 +60,6 @@ import org.junit.runners.Parameterized
|
||||
class LegacySplitScreenToLauncher(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
private val launcherPackageName = LauncherStrategyFactory.getInstance(instrumentation)
|
||||
.launcherStrategy.supportedLauncherPackage
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
@@ -90,25 +86,25 @@ class LegacySplitScreenToLauncher(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(launcherPackageName, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.endRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.endRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -122,19 +118,39 @@ class LegacySplitScreenToLauncher(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun dockedStackDividerBecomesInvisible() = testSpec.dockedStackDividerBecomesInvisible()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun layerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.component)
|
||||
.then()
|
||||
.isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun focusDoesNotChange() {
|
||||
testSpec.assertEventLog {
|
||||
this.focusDoesNotChange()
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun layerBecomesInvisible() = testSpec.layerBecomesInvisible(testApp.getPackage())
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@FlakyTest(bugId = 151179149)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun focusDoesNotChange() = testSpec.focusDoesNotChange()
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import android.view.Surface
|
||||
@@ -48,8 +49,9 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
protected val splitScreenApp = SplitScreenHelper.getPrimary(instrumentation)
|
||||
protected val secondaryApp = SplitScreenHelper.getSecondary(instrumentation)
|
||||
protected val nonResizeableApp = SplitScreenHelper.getNonResizeable(instrumentation)
|
||||
protected val LAUNCHER_PACKAGE_NAME = LauncherStrategyFactory.getInstance(instrumentation)
|
||||
.launcherStrategy.supportedLauncherPackage
|
||||
protected val LAUNCHER_COMPONENT = ComponentName("",
|
||||
LauncherStrategyFactory.getInstance(instrumentation)
|
||||
.launcherStrategy.supportedLauncherPackage)
|
||||
private var prevDevEnableNonResizableMultiWindow = 0
|
||||
|
||||
@Before
|
||||
@@ -74,8 +76,9 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
*
|
||||
* b/182720234
|
||||
*/
|
||||
open val ignoredWindows: List<String> = listOf(WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
open val ignoredWindows: List<ComponentName> = listOf(
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
protected open val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
@@ -142,9 +145,9 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal const val LIVE_WALLPAPER_PACKAGE_NAME =
|
||||
"com.breel.wallpapers18.soundviz.wallpaper.variations.SoundVizWallpaperV2"
|
||||
internal const val LETTERBOX_NAME = "Letterbox"
|
||||
internal const val TOAST_NAME = "Toast"
|
||||
internal val LIVE_WALLPAPER_COMPONENT = ComponentName("",
|
||||
"com.breel.wallpapers18.soundviz.wallpaper.variations.SoundVizWallpaperV2")
|
||||
internal val LETTERBOX_COMPONENT = ComponentName("", "Letterbox")
|
||||
internal val TOAST_COMPONENT = ComponentName("", "Toast")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -24,14 +25,11 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.focusChanges
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.layerBecomesVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.appPairsDividerBecomesVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -62,22 +60,28 @@ class OpenAppToLegacySplitScreen(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<String>
|
||||
get() = listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, splitScreenApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesVisible() = testSpec.appWindowBecomesVisible(splitScreenApp.getPackage())
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -85,12 +89,27 @@ class OpenAppToLegacySplitScreen(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun layerBecomesVisible() = testSpec.layerBecomesVisible(splitScreenApp.getPackage())
|
||||
fun layerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 151179149)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun focusChanges() = testSpec.focusChanges(splitScreenApp.`package`,
|
||||
"recents_animation_input_consumer", "NexusLauncherActivity")
|
||||
fun focusChanges() {
|
||||
testSpec.assertEventLog {
|
||||
this.focusChanges(splitScreenApp.`package`,
|
||||
"recents_animation_input_consumer", "NexusLauncherActivity")
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -28,23 +28,23 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.resizeSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
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.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.helpers.SimpleAppHelper
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -101,16 +101,16 @@ class ResizeLegacySplitScreen(
|
||||
}
|
||||
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@FlakyTest(bugId = 156223549)
|
||||
@Test
|
||||
fun topAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(sSimpleActivity)
|
||||
this.isAppWindowVisible(Components.SimpleActivity.COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,18 +118,18 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun bottomAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(sImeActivity)
|
||||
this.isAppWindowVisible(Components.ImeActivity.COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.endRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.endRotation)
|
||||
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() =
|
||||
@@ -142,21 +142,21 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun topAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(sSimpleActivity)
|
||||
this.isVisible(Components.SimpleActivity.COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(sImeActivity)
|
||||
this.isVisible(Components.ImeActivity.COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dividerLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(DOCKED_STACK_DIVIDER)
|
||||
this.isVisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ class ResizeLegacySplitScreen(
|
||||
testSpec.assertLayersStart {
|
||||
val displayBounds = WindowUtils.displayBounds
|
||||
val dividerBounds =
|
||||
entry.getVisibleBounds(DOCKED_STACK_DIVIDER).bounds
|
||||
layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region.bounds
|
||||
|
||||
val topAppBounds = Region(0, 0, dividerBounds.right,
|
||||
dividerBounds.top + WindowUtils.dockedStackDividerInset)
|
||||
@@ -174,8 +174,8 @@ class ResizeLegacySplitScreen(
|
||||
dividerBounds.bottom - WindowUtils.dockedStackDividerInset,
|
||||
displayBounds.right,
|
||||
displayBounds.bottom - WindowUtils.navigationBarHeight)
|
||||
visibleRegion("SimpleActivity").coversExactly(topAppBounds)
|
||||
visibleRegion("ImeActivity").coversExactly(bottomAppBounds)
|
||||
visibleRegion(Components.SimpleActivity.COMPONENT).coversExactly(topAppBounds)
|
||||
visibleRegion(Components.ImeActivity.COMPONENT).coversExactly(bottomAppBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ class ResizeLegacySplitScreen(
|
||||
testSpec.assertLayersStart {
|
||||
val displayBounds = WindowUtils.displayBounds
|
||||
val dividerBounds =
|
||||
entry.getVisibleBounds(DOCKED_STACK_DIVIDER).bounds
|
||||
layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region.bounds
|
||||
|
||||
val topAppBounds = Region(0, 0, dividerBounds.right,
|
||||
dividerBounds.top + WindowUtils.dockedStackDividerInset)
|
||||
@@ -194,8 +194,8 @@ class ResizeLegacySplitScreen(
|
||||
displayBounds.right,
|
||||
displayBounds.bottom - WindowUtils.navigationBarHeight)
|
||||
|
||||
visibleRegion(sSimpleActivity).coversExactly(topAppBounds)
|
||||
visibleRegion(sImeActivity).coversExactly(bottomAppBounds)
|
||||
visibleRegion(Components.SimpleActivity.COMPONENT).coversExactly(topAppBounds)
|
||||
visibleRegion(Components.ImeActivity.COMPONENT).coversExactly(bottomAppBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,8 +207,6 @@ class ResizeLegacySplitScreen(
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val sSimpleActivity = "SimpleActivity"
|
||||
private const val sImeActivity = "ImeActivity"
|
||||
private val startRatio = Rational(1, 3)
|
||||
private val stopRatio = Rational(2, 3)
|
||||
|
||||
|
||||
@@ -24,18 +24,17 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -66,21 +65,21 @@ class RotateOneLaunchedAppAndEnterSplitScreen(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackPrimaryBoundsIsVisible() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
splitScreenApp.defaultWindowName)
|
||||
fun dockedStackPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
splitScreenApp.component)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() =
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerRotatesScales() =
|
||||
testSpec.statusBarLayerRotatesScales(testSpec.config.startRotation,
|
||||
@@ -88,16 +87,26 @@ class RotateOneLaunchedAppAndEnterSplitScreen(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(splitScreenApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -24,18 +24,17 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -66,35 +65,45 @@ class RotateOneLaunchedAppInSplitScreenMode(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackPrimaryBoundsIsVisible() = testSpec.dockedStackPrimaryBoundsIsVisible(
|
||||
testSpec.config.startRotation, splitScreenApp.defaultWindowName)
|
||||
fun dockedStackPrimaryBoundsIsVisibleAtEnd() = testSpec.dockedStackPrimaryBoundsIsVisibleAtEnd(
|
||||
testSpec.config.startRotation, splitScreenApp.component)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales(
|
||||
testSpec.config.startRotation, testSpec.config.endRotation)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales(
|
||||
testSpec.config.startRotation, testSpec.config.endRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(splitScreenApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -18,26 +18,24 @@ package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
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.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -69,42 +67,66 @@ class RotateTwoLaunchedAppAndEnterSplitScreen(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackPrimaryBoundsIsVisible() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
splitScreenApp.defaultWindowName)
|
||||
fun dockedStackPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackSecondaryBoundsIsVisible() =
|
||||
testSpec.dockedStackSecondaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
secondaryApp.defaultWindowName)
|
||||
fun dockedStackSecondaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackSecondaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
secondaryApp.component)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() =
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales(
|
||||
testSpec.config.startRotation, testSpec.config.endRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
// when the app is launched, first the activity becomes visible, then the
|
||||
// SnapshotStartingWindow appears and then the app window becomes visible.
|
||||
// Because we log WM once per frame, sometimes the activity and the window
|
||||
// become visible in the same entry, sometimes not, thus it is not possible to
|
||||
// assert the visibility of the activity here
|
||||
this.isAppWindowInvisible(secondaryApp.component, ignoreActivity = true)
|
||||
.then()
|
||||
// during re-parenting, the window may disappear and reappear from the
|
||||
// trace, this occurs because we log only 1x per frame
|
||||
.notContains(secondaryApp.component, isOptional = true)
|
||||
.then()
|
||||
// if the window reappears after re-parenting it will most likely not
|
||||
// be visible in the first log entry (because we log only 1x per frame)
|
||||
.isAppWindowInvisible(secondaryApp.component, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -24,20 +24,19 @@ 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.annotation.Group2
|
||||
import com.android.server.wm.flicker.appWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -74,27 +73,27 @@ class RotateTwoLaunchedAppInSplitScreenMode(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackPrimaryBoundsIsVisible() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
splitScreenApp.defaultWindowName)
|
||||
fun dockedStackPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackPrimaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackSecondaryBoundsIsVisible() =
|
||||
testSpec.dockedStackSecondaryBoundsIsVisible(testSpec.config.startRotation,
|
||||
secondaryApp.defaultWindowName)
|
||||
fun dockedStackSecondaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.dockedStackSecondaryBoundsIsVisibleAtEnd(testSpec.config.startRotation,
|
||||
secondaryApp.component)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() =
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation)
|
||||
|
||||
@FlakyTest(bugId = 169271943)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerRotatesScales() =
|
||||
testSpec.statusBarLayerRotatesScales(testSpec.config.startRotation,
|
||||
@@ -102,16 +101,31 @@ class RotateTwoLaunchedAppInSplitScreenMode(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(secondaryApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(secondaryApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
internal const val PIP_WINDOW_TITLE = "PipMenuActivity"
|
||||
internal const val PIP_WINDOW_COMPONENT = "PipMenuActivity"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -62,18 +63,21 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun pipAppRemainInsideVisibleBounds() {
|
||||
testSpec.assertWm {
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun showBothAppWindowsThenHidePip() {
|
||||
testSpec.assertWm {
|
||||
showsAppWindow(testApp.defaultWindowName)
|
||||
.showsAppWindowOnTop(pipApp.defaultWindowName)
|
||||
// when the activity is STOPPING, sometimes it becomes invisible in an entry before
|
||||
// the window, sometimes in the same entry. This occurs because we log 1x per frame
|
||||
// thus we ignore activity here
|
||||
isAppWindowVisible(testApp.component, ignoreActivity = true)
|
||||
.isAppWindowOnTop(pipApp.component)
|
||||
.then()
|
||||
.hidesAppWindow(testApp.defaultWindowName)
|
||||
.isAppWindowInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,10 +85,10 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun showBothAppLayersThenHidePip() {
|
||||
testSpec.assertLayers {
|
||||
isVisible(testApp.defaultWindowName)
|
||||
.isVisible(pipApp.defaultWindowName)
|
||||
isVisible(testApp.component)
|
||||
.isVisible(pipApp.component)
|
||||
.then()
|
||||
.isInvisible(testApp.defaultWindowName)
|
||||
.isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,8 +96,8 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun testAppCoversFullScreenWithPipOnDisplay() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(testApp.defaultWindowName).coversExactly(displayBounds)
|
||||
visibleRegion(pipApp.defaultWindowName).coversAtMost(displayBounds)
|
||||
visibleRegion(testApp.component).coversExactly(displayBounds)
|
||||
visibleRegion(pipApp.component).coversAtMost(displayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +105,7 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun pipAppCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(pipApp.defaultWindowName).coversExactly(displayBounds)
|
||||
visibleRegion(pipApp.component).coversExactly(displayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,30 +44,24 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = buildTransition(eachRun = true, stringExtras = emptyMap()) {
|
||||
transitions {
|
||||
pipApp.clickEnterPipButton()
|
||||
pipApp.clickEnterPipButton(wmHelper)
|
||||
pipApp.expandPipWindow(wmHelper)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun noUncoveredRegions() {
|
||||
super.noUncoveredRegions()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppWindowAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(pipApp.defaultWindowName)
|
||||
this.isAppWindowVisible(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipLayerBecomesVisible() {
|
||||
fun pipAppLayerAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(pipApp.windowName)
|
||||
this.isVisible(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,15 +92,13 @@ class EnterPipToOtherOrientationTest(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun noUncoveredRegions() {
|
||||
super.noUncoveredRegions()
|
||||
}
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppWindowIsAlwaysOnTop() {
|
||||
testSpec.assertWm {
|
||||
showsAppWindowOnTop(pipApp.defaultWindowName)
|
||||
isAppWindowOnTop(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +106,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun pipAppHidesTestApp() {
|
||||
testSpec.assertWmStart {
|
||||
isInvisible(testApp.defaultWindowName)
|
||||
isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +114,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun testAppWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(testApp.defaultWindowName)
|
||||
isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,8 +122,8 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun pipAppLayerHidesTestApp() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.defaultWindowName).coversExactly(startingBounds)
|
||||
isInvisible(testApp.defaultWindowName)
|
||||
visibleRegion(pipApp.component).coversExactly(startingBounds)
|
||||
isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +131,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun testAppLayerCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(testApp.defaultWindowName).coversExactly(endingBounds)
|
||||
visibleRegion(testApp.component).coversExactly(endingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.content.ComponentName
|
||||
import com.android.server.wm.traces.common.windowmanager.WindowManagerState
|
||||
import com.android.server.wm.traces.parser.toWindowName
|
||||
|
||||
/**
|
||||
* Checks that an activity [activity] is in PIP mode
|
||||
*/
|
||||
fun WindowManagerState.isInPipMode(activity: ComponentName): Boolean {
|
||||
val windowName = activity.toWindowName()
|
||||
return isInPipMode(windowName)
|
||||
}
|
||||
@@ -21,8 +21,8 @@ import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
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.startRotation
|
||||
import org.junit.Test
|
||||
@@ -47,9 +47,9 @@ abstract class PipCloseTransition(testSpec: FlickerTestParameter) : PipTransitio
|
||||
@Test
|
||||
open fun pipWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(PIP_WINDOW_TITLE)
|
||||
this.invoke("hasPipWindow") { it.isPinned(pipApp.component) }
|
||||
.then()
|
||||
.hidesAppWindow(PIP_WINDOW_TITLE)
|
||||
.isAppWindowInvisible(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,15 +57,21 @@ abstract class PipCloseTransition(testSpec: FlickerTestParameter) : PipTransitio
|
||||
@Test
|
||||
open fun pipLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(PIP_WINDOW_TITLE)
|
||||
this.isVisible(pipApp.component)
|
||||
.isVisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(PIP_WINDOW_TITLE)
|
||||
.isInvisible(pipApp.component)
|
||||
.isVisible(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 151179149)
|
||||
@Test
|
||||
open fun focusChanges() = testSpec.focusChanges(pipApp.launcherName, "NexusLauncherActivity")
|
||||
open fun focusChanges() {
|
||||
testSpec.assertEventLog {
|
||||
this.focusChanges(pipApp.launcherName, "NexusLauncherActivity")
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -48,13 +48,9 @@ class PipCloseWithDismissButtonTest(testSpec: FlickerTestParameter) : PipCloseTr
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun pipLayerBecomesInvisible() {
|
||||
super.pipLayerBecomesInvisible()
|
||||
}
|
||||
override fun pipLayerBecomesInvisible() = super.pipLayerBecomesInvisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun pipWindowBecomesInvisible() {
|
||||
super.pipWindowBecomesInvisible()
|
||||
}
|
||||
override fun pipWindowBecomesInvisible() = super.pipWindowBecomesInvisible()
|
||||
}
|
||||
@@ -56,19 +56,19 @@ class PipCloseWithSwipeTest(testSpec: FlickerTestParameter) : PipCloseTransition
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() = super.navBarLayerIsAlwaysVisible()
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() = super.statusBarLayerIsAlwaysVisible()
|
||||
override fun statusBarLayerIsVisible() = super.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsVisible() = super.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsVisible() = super.statusBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
@@ -85,7 +85,7 @@ class PipCloseWithSwipeTest(testSpec: FlickerTestParameter) : PipCloseTransition
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun noUncoveredRegions() = super.noUncoveredRegions()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.wm.shell.flicker.IME_WINDOW_NAME
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.helpers.ImeAppHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -79,7 +79,7 @@ class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
fun pipInVisibleBounds() {
|
||||
testSpec.assertWm {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
@Test
|
||||
fun pipIsAboveAppWindow() {
|
||||
testSpec.assertWmTag(TAG_IME_VISIBLE) {
|
||||
isAboveWindow(IME_WINDOW_NAME, pipApp.defaultWindowName)
|
||||
isAboveWindow(WindowManagerStateHelper.IME_COMPONENT, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@FlakyTest(bugId = 161435597)
|
||||
@Group3
|
||||
class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
private val imeApp = ImeAppHelper(instrumentation)
|
||||
@@ -80,11 +79,11 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@FlakyTest(bugId = 161435597)
|
||||
@Test
|
||||
fun pipWindowInsideDisplayBounds() {
|
||||
testSpec.assertWm {
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,25 +91,17 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(testApp.defaultWindowName)
|
||||
isVisible(imeApp.defaultWindowName)
|
||||
noWindowsOverlap(testApp.defaultWindowName, imeApp.defaultWindowName)
|
||||
isVisible(testApp.component)
|
||||
isVisible(imeApp.component)
|
||||
noWindowsOverlap(testApp.component, imeApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
@Presubmit
|
||||
@FlakyTest(bugId = 161435597)
|
||||
@Test
|
||||
fun pipLayerInsideDisplayBounds() {
|
||||
testSpec.assertLayers {
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,18 +109,14 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun bothAppLayersVisible() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(testApp.defaultWindowName).coversAtMost(displayBounds)
|
||||
visibleRegion(imeApp.defaultWindowName).coversAtMost(displayBounds)
|
||||
visibleRegion(testApp.component).coversAtMost(displayBounds)
|
||||
visibleRegion(imeApp.component).coversAtMost(displayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@FlakyTest(bugId = 161435597)
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() = super.navBarLayerIsAlwaysVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() = super.statusBarLayerIsAlwaysVisible()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
companion object {
|
||||
const val TEST_REPETITIONS = 2
|
||||
|
||||
@@ -26,10 +26,10 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
@@ -73,9 +73,9 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 185400889)
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
|
||||
override fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation, allStates = false)
|
||||
|
||||
@FlakyTest
|
||||
@@ -90,21 +90,21 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
testSpec.statusBarLayerRotatesScales(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation)
|
||||
|
||||
@FlakyTest(bugId = 185400889)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayerRotates_StartingBounds() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(fixedApp.defaultWindowName).coversExactly(startingBounds)
|
||||
visibleRegion(pipApp.defaultWindowName).coversAtMost(startingBounds)
|
||||
visibleRegion(fixedApp.component).coversExactly(startingBounds)
|
||||
visibleRegion(pipApp.component).coversAtMost(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 185400889)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayerRotates_EndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(fixedApp.defaultWindowName).coversExactly(endingBounds)
|
||||
visibleRegion(pipApp.defaultWindowName).coversAtMost(endingBounds)
|
||||
visibleRegion(fixedApp.component).coversExactly(endingBounds)
|
||||
visibleRegion(pipApp.component).coversAtMost(endingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,13 +63,13 @@ class PipShelfHeightTest(testSpec: FlickerTestParameter) : PipTransition(testSpe
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAlwaysVisible() = testSpec.assertWm { this.showsAppWindow(pipApp.windowName) }
|
||||
fun pipAlwaysVisible() = testSpec.assertWm { this.isAppWindowVisible(pipApp.component) }
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipLayerInsideDisplay() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.defaultWindowName).coversAtMost(displayBounds)
|
||||
visibleRegion(pipApp.component).coversAtMost(displayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ 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.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
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.startRotation
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -64,9 +64,11 @@ class PipToAppTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun appReplacesPipWindow() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(PIP_WINDOW_TITLE)
|
||||
this.invoke("hasPipWindow") { it.isPinned(pipApp.component) }
|
||||
.isAppWindowOnTop(pipApp.component)
|
||||
.then()
|
||||
.showsAppWindowOnTop(pipApp.launcherName)
|
||||
.invoke("hasNotPipWindow") { it.isNotPinned(pipApp.component) }
|
||||
.isAppWindowOnTop(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,9 +76,11 @@ class PipToAppTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun appReplacesPipLayer() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(PIP_WINDOW_TITLE)
|
||||
this.isVisible(pipApp.component)
|
||||
.isVisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(pipApp.launcherName)
|
||||
.isVisible(pipApp.component)
|
||||
.isInvisible(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,22 +88,26 @@ class PipToAppTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun testAppCoversFullScreen() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.defaultWindowName).coversExactly(displayBounds)
|
||||
visibleRegion(pipApp.component).coversExactly(displayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 151179149)
|
||||
@Test
|
||||
fun focusChanges() = testSpec.focusChanges("NexusLauncherActivity",
|
||||
pipApp.launcherName, "NexusLauncherActivity")
|
||||
fun focusChanges() {
|
||||
testSpec.assertEventLog {
|
||||
this.focusChanges("NexusLauncherActivity",
|
||||
pipApp.launcherName, "NexusLauncherActivity")
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0),
|
||||
repetitions = 5)
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0),
|
||||
repetitions = 5)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,25 +20,24 @@ import android.app.Instrumentation
|
||||
import android.content.Intent
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isRotated
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.helpers.PipAppHelper
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
import org.junit.Test
|
||||
@@ -162,19 +161,19 @@ abstract class PipTransition(protected val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
open fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
open fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
open fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
open fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -188,6 +187,6 @@ abstract class PipTransition(protected val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun noUncoveredRegions() =
|
||||
testSpec.noUncoveredRegions(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
open fun entireScreenCovered() =
|
||||
testSpec.entireScreenCovered(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
}
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -81,6 +80,22 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarWindowIsVisible() = super.navBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun statusBarLayerIsVisible() = super.statusBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun statusBarWindowIsVisible() = super.statusBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
@@ -89,48 +104,48 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
@Test
|
||||
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
|
||||
|
||||
@Presubmit
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun pipWindowInsideDisplay() {
|
||||
testSpec.assertWmStart {
|
||||
frameRegion(pipApp.defaultWindowName).coversAtMost(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppShowsOnTop() {
|
||||
testSpec.assertWmEnd {
|
||||
showsAppWindowOnTop(pipApp.defaultWindowName)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipLayerInsideDisplay() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.defaultWindowName).coversAtMost(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAlwaysVisible() = testSpec.assertWm {
|
||||
this.showsAppWindow(pipApp.windowName)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppLayerCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(pipApp.defaultWindowName).coversExactly(endingBounds)
|
||||
frameRegion(pipApp.component).coversAtMost(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun noUncoveredRegions() {
|
||||
super.noUncoveredRegions()
|
||||
fun pipAppShowsOnTop() {
|
||||
testSpec.assertWmEnd {
|
||||
isAppWindowOnTop(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun pipLayerInsideDisplay() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.component).coversAtMost(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun pipAlwaysVisible() = testSpec.assertWm {
|
||||
this.isAppWindowVisible(pipApp.component)
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun pipAppLayerCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(pipApp.component).coversExactly(endingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun entireScreenCovered() {
|
||||
super.entireScreenCovered()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -37,14 +37,17 @@ class TvPipMenuTests : TvPipTestBase() {
|
||||
private val systemUiResources =
|
||||
packageManager.getResourcesForApplication(SYSTEM_UI_PACKAGE_NAME)
|
||||
private val pipBoundsWhileInMenu: Rect = systemUiResources.run {
|
||||
val bounds = getString(getIdentifier("pip_menu_bounds", "string", SYSTEM_UI_PACKAGE_NAME))
|
||||
val bounds = getString(getIdentifier("pip_menu_bounds", "string",
|
||||
SYSTEM_UI_PACKAGE_NAME))
|
||||
Rect.unflattenFromString(bounds) ?: error("Could not retrieve PiP menu bounds")
|
||||
}
|
||||
private val playButtonDescription = systemUiResources.run {
|
||||
getString(getIdentifier("pip_play", "string", SYSTEM_UI_PACKAGE_NAME))
|
||||
getString(getIdentifier("pip_play", "string",
|
||||
SYSTEM_UI_PACKAGE_NAME))
|
||||
}
|
||||
private val pauseButtonDescription = systemUiResources.run {
|
||||
getString(getIdentifier("pip_pause", "string", SYSTEM_UI_PACKAGE_NAME))
|
||||
getString(getIdentifier("pip_pause", "string",
|
||||
SYSTEM_UI_PACKAGE_NAME))
|
||||
}
|
||||
|
||||
@Before
|
||||
|
||||
@@ -70,7 +70,8 @@ fun UiDevice.waitForTvPipMenuElementWithDescription(desc: String): UiObject2? {
|
||||
// descendant and then retrieve the element from the menu and return to the caller of this
|
||||
// method.
|
||||
val elementSelector = By.desc(desc)
|
||||
val menuContainingElementSelector = By.copy(TV_PIP_MENU_SELECTOR).hasDescendant(elementSelector)
|
||||
val menuContainingElementSelector = By.copy(TV_PIP_MENU_SELECTOR)
|
||||
.hasDescendant(elementSelector)
|
||||
|
||||
return wait(Until.findObject(menuContainingElementSelector), WAIT_TIME_MS)
|
||||
?.findObject(elementSelector)
|
||||
@@ -94,7 +95,8 @@ fun UiDevice.clickTvPipMenuFullscreenButton() {
|
||||
}
|
||||
|
||||
fun UiDevice.clickTvPipMenuElementWithDescription(desc: String) {
|
||||
focusOnAndClickTvPipMenuElement(By.desc(desc).pkg(SYSTEM_UI_PACKAGE_NAME)) ||
|
||||
focusOnAndClickTvPipMenuElement(By.desc(desc)
|
||||
.pkg(SYSTEM_UI_PACKAGE_NAME)) ||
|
||||
error("Could not focus on the Pip menu object with \"$desc\" description")
|
||||
// So apparently Accessibility framework on TV is not very reliable and sometimes the state of
|
||||
// the tree of accessibility nodes as seen by the accessibility clients kind of lags behind of
|
||||
|
||||
@@ -25,11 +25,17 @@ package {
|
||||
|
||||
android_test {
|
||||
name: "FlickerTests",
|
||||
srcs: ["src/**/*.java", "src/**/*.kt"],
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
],
|
||||
manifest: "AndroidManifest.xml",
|
||||
test_config: "AndroidTest.xml",
|
||||
platform_apis: true,
|
||||
certificate: "platform",
|
||||
optimize: {
|
||||
enabled: false,
|
||||
},
|
||||
test_suites: ["device-tests"],
|
||||
libs: ["android.test.runner"],
|
||||
static_libs: [
|
||||
@@ -46,6 +52,9 @@ android_test {
|
||||
java_library {
|
||||
name: "wm-flicker-common-assertions",
|
||||
platform_apis: true,
|
||||
optimize: {
|
||||
enabled: false,
|
||||
},
|
||||
srcs: [
|
||||
"src/**/*Assertions.java",
|
||||
"src/**/*Assertions.kt",
|
||||
@@ -56,20 +65,23 @@ java_library {
|
||||
static_libs: [
|
||||
"flickerlib",
|
||||
"truth-prebuilt",
|
||||
"app-helpers-core"
|
||||
"app-helpers-core",
|
||||
],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "wm-flicker-common-app-helpers",
|
||||
platform_apis: true,
|
||||
optimize: {
|
||||
enabled: false,
|
||||
},
|
||||
srcs: [
|
||||
"**/helpers/*"
|
||||
"**/helpers/*",
|
||||
],
|
||||
static_libs: [
|
||||
"flickerlib",
|
||||
"flickertestapplib",
|
||||
"truth-prebuilt",
|
||||
"app-helpers-core"
|
||||
"app-helpers-core",
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,77 +14,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("CommonAssertions")
|
||||
package com.android.server.wm.flicker
|
||||
|
||||
import android.platform.helpers.IAppHelper
|
||||
import android.content.ComponentName
|
||||
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_WINDOW_NAME
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.STATUS_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
|
||||
|
||||
val HOME_WINDOW_TITLE = arrayOf("Wallpaper", "Launcher")
|
||||
val LAUNCHER_COMPONENT = ComponentName("com.google.android.apps.nexuslauncher",
|
||||
"com.google.android.apps.nexuslauncher.NexusLauncherActivity")
|
||||
|
||||
fun FlickerTestParameter.statusBarWindowIsAlwaysVisible() {
|
||||
fun FlickerTestParameter.statusBarWindowIsVisible() {
|
||||
assertWm {
|
||||
this.showsAboveAppWindow(STATUS_BAR_WINDOW_NAME)
|
||||
this.isAboveAppWindowVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.navBarWindowIsAlwaysVisible() {
|
||||
fun FlickerTestParameter.navBarWindowIsVisible() {
|
||||
assertWm {
|
||||
this.showsAboveAppWindow(NAV_BAR_WINDOW_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.launcherReplacesAppWindowAsTopWindow(testApp: IAppHelper) {
|
||||
assertWm {
|
||||
this.showsAppWindowOnTop(testApp.getPackage())
|
||||
.then()
|
||||
.showsAppWindowOnTop(*HOME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.launcherWindowBecomesVisible() {
|
||||
assertWm {
|
||||
this.hidesBelowAppWindow(*HOME_WINDOW_TITLE)
|
||||
.then()
|
||||
.showsBelowAppWindow(*HOME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.launcherWindowBecomesInvisible() {
|
||||
assertWm {
|
||||
this.showsBelowAppWindow(*HOME_WINDOW_TITLE)
|
||||
.then()
|
||||
.hidesBelowAppWindow(*HOME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowAlwaysVisibleOnTop(packageName: String) {
|
||||
assertWm {
|
||||
this.showsAppWindowOnTop(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowBecomesVisible(appName: String) {
|
||||
assertWm {
|
||||
this.hidesAppWindow(appName)
|
||||
.then()
|
||||
.showsAppWindow(appName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowBecomesInVisible(appName: String) {
|
||||
assertWm {
|
||||
this.showsAppWindow(appName)
|
||||
.then()
|
||||
.hidesAppWindow(appName)
|
||||
this.isAboveAppWindowVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun FlickerTestParameter.noUncoveredRegions(
|
||||
fun FlickerTestParameter.entireScreenCovered(
|
||||
beginRotation: Int,
|
||||
endRotation: Int = beginRotation,
|
||||
allStates: Boolean = true
|
||||
@@ -111,37 +64,21 @@ fun FlickerTestParameter.noUncoveredRegions(
|
||||
}
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun FlickerTestParameter.navBarLayerIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertLayers {
|
||||
this.isVisible(NAV_BAR_LAYER_NAME)
|
||||
.then()
|
||||
.isInvisible(NAV_BAR_LAYER_NAME)
|
||||
.then()
|
||||
.isVisible(NAV_BAR_LAYER_NAME)
|
||||
}
|
||||
} else {
|
||||
assertLayers {
|
||||
this.isVisible(NAV_BAR_LAYER_NAME)
|
||||
}
|
||||
fun FlickerTestParameter.navBarLayerIsVisible() {
|
||||
assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun FlickerTestParameter.statusBarLayerIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertLayers {
|
||||
this.isVisible(STATUS_BAR_LAYER_NAME)
|
||||
.then()
|
||||
.isInvisible(STATUS_BAR_LAYER_NAME)
|
||||
.then()
|
||||
.isVisible(STATUS_BAR_LAYER_NAME)
|
||||
}
|
||||
} else {
|
||||
assertLayers {
|
||||
this.isVisible(STATUS_BAR_LAYER_NAME)
|
||||
}
|
||||
fun FlickerTestParameter.statusBarLayerIsVisible() {
|
||||
assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,10 +91,10 @@ fun FlickerTestParameter.navBarLayerRotatesAndScales(
|
||||
val endingPos = WindowUtils.getNavigationBarPosition(endRotation)
|
||||
|
||||
assertLayersStart {
|
||||
this.visibleRegion(NAV_BAR_LAYER_NAME).coversExactly(startingPos)
|
||||
this.visibleRegion(WindowManagerStateHelper.NAV_BAR_COMPONENT).coversExactly(startingPos)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.visibleRegion(NAV_BAR_LAYER_NAME).coversExactly(endingPos)
|
||||
this.visibleRegion(WindowManagerStateHelper.NAV_BAR_COMPONENT).coversExactly(endingPos)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,54 +107,46 @@ fun FlickerTestParameter.statusBarLayerRotatesScales(
|
||||
val endingPos = WindowUtils.getStatusBarPosition(endRotation)
|
||||
|
||||
assertLayersStart {
|
||||
this.visibleRegion(STATUS_BAR_LAYER_NAME).coversExactly(startingPos)
|
||||
this.visibleRegion(WindowManagerStateHelper.STATUS_BAR_COMPONENT).coversExactly(startingPos)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.visibleRegion(STATUS_BAR_LAYER_NAME).coversExactly(endingPos)
|
||||
this.visibleRegion(WindowManagerStateHelper.STATUS_BAR_COMPONENT).coversExactly(endingPos)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appLayerReplacesLauncher(appName: String) {
|
||||
/**
|
||||
* Asserts that:
|
||||
* [originalLayer] is visible at the start of the trace
|
||||
* [originalLayer] becomes invisible during the trace and (in the same entry) [newLayer]
|
||||
* becomes visible
|
||||
* [newLayer] remains visible until the end of the trace
|
||||
*
|
||||
* @param originalLayer Layer that should be visible at the start
|
||||
* @param newLayer Layer that should be visible at the end
|
||||
* @param ignoreSnapshot If the snapshot layer should be ignored during the transition
|
||||
* (useful mostly for app launch)
|
||||
*/
|
||||
fun FlickerTestParameter.replacesLayer(
|
||||
originalLayer: ComponentName,
|
||||
newLayer: ComponentName,
|
||||
ignoreSnapshot: Boolean = false
|
||||
) {
|
||||
assertLayers {
|
||||
this.isVisible(*HOME_WINDOW_TITLE)
|
||||
.then()
|
||||
.isVisible(appName)
|
||||
val assertion = this.isVisible(originalLayer)
|
||||
if (ignoreSnapshot) {
|
||||
assertion.then()
|
||||
.isVisible(WindowManagerStateHelper.SNAPSHOT_COMPONENT, isOptional = true)
|
||||
}
|
||||
assertion.then().isVisible(newLayer)
|
||||
}
|
||||
|
||||
assertLayersStart {
|
||||
this.isVisible(originalLayer)
|
||||
.isInvisible(newLayer)
|
||||
}
|
||||
|
||||
assertLayersEnd {
|
||||
this.isInvisible(originalLayer)
|
||||
.isVisible(newLayer)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.launcherLayerReplacesApp(testApp: IAppHelper) {
|
||||
assertLayers {
|
||||
this.isVisible(testApp.getPackage())
|
||||
.then()
|
||||
.isInvisible(testApp.getPackage())
|
||||
.isVisible(*HOME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerBecomesVisible(packageName: String) {
|
||||
assertLayers {
|
||||
this.isInvisible(packageName)
|
||||
.then()
|
||||
.isVisible(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerBecomesInvisible(packageName: String) {
|
||||
assertLayers {
|
||||
this.isVisible(packageName)
|
||||
.then()
|
||||
.isInvisible(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.focusChanges(vararg windows: String) {
|
||||
assertEventLog {
|
||||
this.focusChanges(windows)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.focusDoesNotChange() {
|
||||
assertEventLog {
|
||||
this.focusDoesNotChange()
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
@@ -16,6 +17,8 @@
|
||||
|
||||
package com.android.server.wm.flicker.close
|
||||
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
@@ -23,6 +26,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
@@ -46,6 +50,13 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
@Postsubmit
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.server.wm.flicker.close
|
||||
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
@@ -23,6 +25,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
@@ -46,6 +49,13 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
@Postsubmit
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -19,30 +19,35 @@ package com.android.server.wm.flicker.close
|
||||
import android.app.Instrumentation
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.launcherReplacesAppWindowAsTopWindow
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.launcherLayerReplacesApp
|
||||
import com.android.server.wm.flicker.launcherWindowBecomesVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.replacesLayer
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Base test class for transitions that close an app back to the launcher screen
|
||||
*/
|
||||
abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
protected open val testApp: StandardAppHelper = SimpleAppHelper(instrumentation)
|
||||
|
||||
/**
|
||||
* Specification of the test transition to execute
|
||||
*/
|
||||
protected open val transition: FlickerBuilder.(Map<String, Any?>) -> Unit = {
|
||||
setup {
|
||||
eachRun {
|
||||
@@ -66,29 +71,29 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsAlwaysVisible() {
|
||||
testSpec.navBarWindowIsAlwaysVisible()
|
||||
open fun navBarWindowIsVisible() {
|
||||
testSpec.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsAlwaysVisible() {
|
||||
testSpec.statusBarWindowIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
open fun navBarLayerIsAlwaysVisible() {
|
||||
testSpec.navBarLayerIsAlwaysVisible(rotatesScreen = testSpec.isRotated)
|
||||
open fun statusBarWindowIsVisible() {
|
||||
testSpec.statusBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsAlwaysVisible() {
|
||||
testSpec.statusBarLayerIsAlwaysVisible(rotatesScreen = testSpec.isRotated)
|
||||
open fun navBarLayerIsVisible() {
|
||||
testSpec.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsVisible() {
|
||||
testSpec.statusBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerRotatesAndScales() {
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
@@ -118,25 +123,33 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun noUncoveredRegions() {
|
||||
testSpec.noUncoveredRegions(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
open fun entireScreenCovered() {
|
||||
testSpec.entireScreenCovered(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherReplacesAppWindowAsTopWindow() {
|
||||
testSpec.launcherReplacesAppWindowAsTopWindow(testApp)
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
.then()
|
||||
.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherWindowBecomesVisible() {
|
||||
testSpec.launcherWindowBecomesVisible()
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherLayerReplacesApp() {
|
||||
testSpec.launcherLayerReplacesApp(testApp)
|
||||
testSpec.replacesLayer(testApp.component, LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,8 @@ open class ImeAppHelper @JvmOverloads constructor(
|
||||
if (wmHelper == null) {
|
||||
device.waitForIdle()
|
||||
} else {
|
||||
wmHelper.waitImeWindowShown()
|
||||
wmHelper.waitImeShown()
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +79,7 @@ open class ImeAppHelper @JvmOverloads constructor(
|
||||
if (wmHelper == null) {
|
||||
device.waitForIdle()
|
||||
} else {
|
||||
wmHelper.waitImeWindowGone()
|
||||
wmHelper.waitImeGone()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,8 @@ package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
@@ -28,15 +28,15 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -46,6 +46,14 @@ import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test IME window closing back to app window transitions.
|
||||
*
|
||||
* This test doesn't work on 90 degrees. According to the InputMethodService documentation:
|
||||
*
|
||||
* Don't show if this is not explicitly requested by the user and the input method
|
||||
* is fullscreen. That would be too disruptive.
|
||||
*
|
||||
* More details on b/190352379
|
||||
*
|
||||
* To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToAppTest`
|
||||
*/
|
||||
@RequiresDevice
|
||||
@@ -79,37 +87,55 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME))
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowIsAlwaysVisible() = testSpec.imeAppWindowIsAlwaysVisible(testApp)
|
||||
fun imeAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -117,15 +143,19 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerIsAlwaysVisible() = testSpec.imeAppLayerIsAlwaysVisible(testApp)
|
||||
fun imeAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() {
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation)
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerRotatesScales() {
|
||||
testSpec.statusBarLayerRotatesScales(testSpec.config.startRotation)
|
||||
@@ -145,8 +175,11 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(repetitions = 5,
|
||||
// b/190352379 (IME doesn't show on app launch in 90 degrees)
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes = listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY)
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,14 +30,14 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -47,6 +47,14 @@ import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test IME window closing back to app window transitions.
|
||||
*
|
||||
* This test doesn't work on 90 degrees. According to the InputMethodService documentation:
|
||||
*
|
||||
* Don't show if this is not explicitly requested by the user and the input method
|
||||
* is fullscreen. That would be too disruptive.
|
||||
*
|
||||
* More details on b/190352379
|
||||
*
|
||||
* To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToHomeTest`
|
||||
*/
|
||||
@RequiresDevice
|
||||
@@ -75,51 +83,73 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
transitions {
|
||||
device.pressHome()
|
||||
wmHelper.waitForHomeActivityVisible()
|
||||
wmHelper.waitImeWindowGone()
|
||||
wmHelper.waitImeGone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME))
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@FlakyTest(bugId = 190189685)
|
||||
@Test
|
||||
fun imeWindowBecomesInvisible() = testSpec.imeWindowBecomesInvisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun imeAppWindowBecomesInvisible() = testSpec.imeAppWindowBecomesInvisible(testApp)
|
||||
fun imeAppWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
.then()
|
||||
.appWindowNotOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation,
|
||||
Surface.ROTATION_0)
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerBecomesInvisible() = testSpec.imeLayerBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerBecomesInvisible() = testSpec.imeAppLayerBecomesInvisible(testApp)
|
||||
fun imeAppLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.component)
|
||||
.then()
|
||||
.isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerRotatesAndScales() {
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
@@ -133,18 +163,19 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(IME_WINDOW_TITLE, WindowManagerStateHelper.SPLASH_SCREEN_NAME))
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,8 +185,11 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(repetitions = 1,
|
||||
// b/190352379 (IME doesn't show on app launch in 90 degrees)
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes = listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY)
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import org.junit.Assume
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -61,7 +61,7 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
setup {
|
||||
test {
|
||||
testApp.launchViaIntent()
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
eachRun {
|
||||
testApp.openIME(device, wmHelper)
|
||||
@@ -80,37 +80,42 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME))
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT))
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowIsAlwaysVisible() = testSpec.imeAppWindowIsAlwaysVisible(testApp)
|
||||
fun imeAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -146,7 +151,11 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerIsAlwaysVisible() = testSpec.imeAppLayerIsAlwaysVisible(testApp)
|
||||
fun imeAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -30,13 +30,13 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -68,7 +68,7 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
transitions {
|
||||
device.pressHome()
|
||||
wmHelper.waitForHomeActivityVisible()
|
||||
wmHelper.waitImeWindowGone()
|
||||
wmHelper.waitImeGone()
|
||||
}
|
||||
teardown {
|
||||
eachRun {
|
||||
@@ -84,19 +84,20 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME))
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,19 +107,25 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun imeAppWindowBecomesInvisible() = testSpec.imeAppWindowBecomesInvisible(testApp)
|
||||
fun imeAppWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation,
|
||||
Surface.ROTATION_0)
|
||||
|
||||
@Presubmit
|
||||
@@ -127,7 +134,13 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerBecomesInvisible() = testSpec.imeAppLayerBecomesInvisible(testApp)
|
||||
fun imeAppLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.component)
|
||||
.then()
|
||||
.isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -144,8 +157,9 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
@Test
|
||||
fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(IME_WINDOW_TITLE, WindowManagerStateHelper.SPLASH_SCREEN_NAME))
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,128 +14,56 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("CommonAssertions")
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.helpers.IAppHelper
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
|
||||
const val IME_WINDOW_TITLE = "InputMethod"
|
||||
|
||||
fun FlickerTestParameter.imeLayerIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertLayers {
|
||||
this.isVisible(IME_WINDOW_TITLE)
|
||||
.then()
|
||||
.isInvisible(IME_WINDOW_TITLE)
|
||||
.then()
|
||||
.isVisible(IME_WINDOW_TITLE)
|
||||
}
|
||||
} else {
|
||||
assertLayers {
|
||||
this.isVisible(IME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
}
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(IME_WINDOW_TITLE)
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.isVisible(IME_WINDOW_TITLE)
|
||||
.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(IME_WINDOW_TITLE)
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(IME_WINDOW_TITLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeAppLayerIsAlwaysVisible(testApp: IAppHelper) {
|
||||
assertLayers {
|
||||
this.isVisible(testApp.getPackage())
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeAppWindowIsAlwaysVisible(testApp: IAppHelper) {
|
||||
assertWm {
|
||||
this.showsAppWindowOnTop(testApp.getPackage())
|
||||
.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertWm {
|
||||
this.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||
this.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.hidesNonAppWindow(IME_WINDOW_TITLE)
|
||||
.isNonAppWindowInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||
.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
} else {
|
||||
assertWm {
|
||||
this.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||
this.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesVisible() {
|
||||
assertWm {
|
||||
this.hidesNonAppWindow(IME_WINDOW_TITLE)
|
||||
this.isNonAppWindowInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||
.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesInvisible() {
|
||||
assertWm {
|
||||
this.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||
this.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.hidesNonAppWindow(IME_WINDOW_TITLE)
|
||||
.isNonAppWindowInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeAppWindowIsAlwaysVisible(
|
||||
testApp: IAppHelper,
|
||||
rotatesScreen: Boolean = false
|
||||
) {
|
||||
if (rotatesScreen) {
|
||||
assertWm {
|
||||
this.showsAppWindow(testApp.getPackage())
|
||||
.then()
|
||||
.hidesAppWindow(testApp.getPackage())
|
||||
.then()
|
||||
.showsAppWindow(testApp.getPackage())
|
||||
}
|
||||
} else {
|
||||
assertWm {
|
||||
this.showsAppWindow(testApp.getPackage())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeAppWindowBecomesVisible(windowName: String) {
|
||||
assertWm {
|
||||
this.hidesAppWindow(windowName)
|
||||
.then()
|
||||
.showsAppWindow(windowName)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeAppWindowBecomesInvisible(testApp: IAppHelper) {
|
||||
assertWm {
|
||||
this.showsAppWindowOnTop(testApp.getPackage())
|
||||
.then()
|
||||
.appWindowNotOnTop(testApp.getPackage())
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeAppLayerBecomesInvisible(testApp: IAppHelper) {
|
||||
assertLayers {
|
||||
this.isVisible(testApp.getPackage())
|
||||
.then()
|
||||
.isInvisible(testApp.getPackage())
|
||||
}
|
||||
}
|
||||
@@ -28,16 +28,15 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.appWindowAlwaysVisibleOnTop
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -81,11 +80,11 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -93,19 +92,23 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowAlwaysVisibleOnTop() = testSpec.appWindowAlwaysVisibleOnTop(testApp.`package`)
|
||||
fun appWindowAlwaysVisibleOnTop() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -115,7 +118,7 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
@Test
|
||||
fun layerAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.`package`)
|
||||
this.isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
@@ -26,23 +27,22 @@ import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
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.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.launcherWindowBecomesInvisible
|
||||
import com.android.server.wm.flicker.appLayerReplacesLauncher
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -61,7 +61,6 @@ import org.junit.runners.Parameterized
|
||||
class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, testSpec.config.startRotation)
|
||||
private val testAppComponentName = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME
|
||||
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
@@ -73,14 +72,14 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
}
|
||||
eachRun {
|
||||
device.pressRecentApps()
|
||||
wmHelper.waitImeWindowGone()
|
||||
wmHelper.waitImeGone()
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
this.setRotation(testSpec.config.startRotation)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
device.reopenAppFromOverview(wmHelper)
|
||||
wmHelper.waitImeWindowShown()
|
||||
wmHelper.waitImeShown()
|
||||
}
|
||||
teardown {
|
||||
test {
|
||||
@@ -92,23 +91,34 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
val component = ComponentName("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
ignoreWindows = listOf(WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
component)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherWindowBecomesInvisible() = testSpec.launcherWindowBecomesInvisible()
|
||||
fun launcherWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowInvisible(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -116,30 +126,57 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowIsAlwaysVisible() = testSpec.imeAppWindowIsAlwaysVisible(testApp, true)
|
||||
fun imeAppWindowVisibility() {
|
||||
// the app starts visible in live tile, then becomes invisible during animation and
|
||||
// is again launched. Since we log 1x per frame, sometimes the activity visibility and
|
||||
// the app visibility are updated together, sometimes not, thus ignore activity check
|
||||
// at the start
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp.component, ignoreActivity = true)
|
||||
.then()
|
||||
.isAppWindowInvisible(testApp.component, ignoreActivity = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
// During testing the launcher is always in portrait mode
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun navBarLayerIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun statusBarLayerIsVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerIsAlwaysVisible() = testSpec.imeLayerIsAlwaysVisible(true)
|
||||
fun imeLayerIsBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayerReplacesLauncher() =
|
||||
testSpec.appLayerReplacesLauncher(testAppComponentName.className)
|
||||
fun appLayerReplacesLauncher() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(WindowManagerStateHelper.SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -156,8 +193,14 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
// depends on how much of the animation transactions are sent to SF at once
|
||||
// sometimes this layer appears for 2-3 frames, sometimes for only 1
|
||||
val recentTaskComponent = ComponentName("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT, recentTaskComponent)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,27 +17,26 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
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.annotation.Group2
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -54,10 +53,11 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group2
|
||||
@Presubmit
|
||||
class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParameter) {
|
||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
private val imeTestApp = ImeAppHelper(instrumentation)
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.config.startRotation)
|
||||
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
@@ -66,7 +66,13 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
|
||||
eachRun {
|
||||
this.setRotation(testSpec.config.startRotation)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
wmHelper.waitForFullScreenApp(testApp.component)
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
|
||||
imeTestApp.launchViaIntent(wmHelper)
|
||||
wmHelper.waitForFullScreenApp(testApp.component)
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
|
||||
imeTestApp.openIME(device, wmHelper)
|
||||
}
|
||||
}
|
||||
@@ -74,57 +80,86 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
|
||||
eachRun {
|
||||
device.pressHome()
|
||||
wmHelper.waitForHomeActivityVisible()
|
||||
}
|
||||
test {
|
||||
imeTestApp.exit(wmHelper)
|
||||
testApp.exit()
|
||||
imeTestApp.exit()
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
// [Step1]: Swipe right from imeTestApp to testApp task
|
||||
createTag(TAG_IME_VISIBLE)
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
val displayCenterX = displayBounds.bounds.width() / 2
|
||||
device.swipe(displayCenterX, displayBounds.bounds.height(),
|
||||
displayBounds.bounds.width(), displayBounds.bounds.height(), 20)
|
||||
device.swipe(0, displayBounds.bounds.height(),
|
||||
displayBounds.bounds.width(), displayBounds.bounds.height(), 50)
|
||||
|
||||
wmHelper.waitForFullScreenApp(testApp.component)
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
createTag(TAG_IME_INVISIBLE)
|
||||
}
|
||||
transitions {
|
||||
// [Step2]: Swipe left to back to imeTestApp task
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
val displayCenterX = displayBounds.bounds.width() / 2
|
||||
device.swipe(displayBounds.bounds.width(), displayBounds.bounds.height(),
|
||||
displayCenterX, displayBounds.bounds.height(), 20)
|
||||
0, displayBounds.bounds.height(), 50)
|
||||
wmHelper.waitForFullScreenApp(imeTestApp.component)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun imeAppWindowIsAlwaysVisible() = testSpec.imeAppWindowIsAlwaysVisible(imeTestApp)
|
||||
fun imeAppWindowVisibility() {
|
||||
val component = ComponentName(imeTestApp.`package`, "")
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(component)
|
||||
.then()
|
||||
.isAppWindowVisible(component, ignoreActivity = true)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
|
||||
fun navBarLayerIsVisibleAroundSwitching() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun imeLayerBecomesInvisible() = testSpec.imeLayerBecomesInvisible()
|
||||
fun statusBarLayerIsVisibleAroundSwitching() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsAlwaysVisible()
|
||||
fun imeLayerIsVisibleWhenSwitchingToImeApp() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersTag(TAG_IME_VISIBLE) {
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun navBarLayerIsAlwaysVisible() = testSpec.navBarLayerIsAlwaysVisible()
|
||||
fun imeLayerIsInvisibleWhenSwitchingToTestApp() {
|
||||
testSpec.assertLayersTag(TAG_IME_INVISIBLE) {
|
||||
isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
fun navBarWindowIsVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@@ -134,10 +169,13 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
|
||||
.getConfigNonRotationTests(
|
||||
repetitions = 3,
|
||||
supportedNavigationModes = listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
),
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
)
|
||||
}
|
||||
|
||||
private const val TAG_IME_VISIBLE = "imeVisible"
|
||||
private const val TAG_IME_INVISIBLE = "imeInVisible"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.platform.helpers.IAppHelper
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.HOME_WINDOW_TITLE
|
||||
|
||||
fun FlickerTestParameter.appWindowReplacesLauncherAsTopWindow(testApp: IAppHelper) {
|
||||
assertWm {
|
||||
this.showsAppWindowOnTop(*HOME_WINDOW_TITLE)
|
||||
.then()
|
||||
.showsAppWindowOnTop("Snapshot", testApp.getPackage())
|
||||
}
|
||||
}
|
||||
@@ -62,37 +62,19 @@ class OpenAppColdTest(testSpec: FlickerTestParameter) : OpenAppTransition(testSp
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() {
|
||||
super.navBarLayerIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() {
|
||||
super.navBarLayerRotatesAndScales()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() {
|
||||
super.statusBarLayerIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@FlakyTest(bugId = 192721431)
|
||||
@Test
|
||||
override fun appLayerReplacesLauncher() {
|
||||
super.appLayerReplacesLauncher()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@FlakyTest(bugId = 192721431)
|
||||
@Test
|
||||
override fun appWindowReplacesLauncherAsTopWindow() {
|
||||
super.appWindowReplacesLauncherAsTopWindow()
|
||||
|
||||
@@ -63,36 +63,12 @@ class OpenAppFromOverviewTest(testSpec: FlickerTestParameter) : OpenAppTransitio
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() {
|
||||
super.navBarLayerIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() {
|
||||
super.statusBarLayerIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() {
|
||||
super.navBarLayerRotatesAndScales()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun statusBarLayerRotatesScales() {
|
||||
super.statusBarLayerRotatesScales()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
|
||||
@@ -22,24 +22,24 @@ import android.view.Surface
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.appLayerReplacesLauncher
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.focusChanges
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.replacesLayer
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.launcherWindowBecomesInvisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.SNAPSHOT_COMPONENT
|
||||
import org.junit.Test
|
||||
|
||||
abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
@@ -71,14 +71,14 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsAlwaysVisible() {
|
||||
testSpec.navBarWindowIsAlwaysVisible()
|
||||
open fun navBarWindowIsVisible() {
|
||||
testSpec.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsAlwaysVisible() {
|
||||
testSpec.navBarLayerIsAlwaysVisible(rotatesScreen = testSpec.isRotated)
|
||||
open fun navBarLayerIsVisible() {
|
||||
testSpec.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@@ -89,14 +89,14 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsAlwaysVisible() {
|
||||
testSpec.statusBarWindowIsAlwaysVisible()
|
||||
open fun statusBarWindowIsVisible() {
|
||||
testSpec.statusBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsAlwaysVisible() {
|
||||
testSpec.statusBarLayerIsAlwaysVisible(rotatesScreen = testSpec.isRotated)
|
||||
open fun statusBarLayerIsVisible() {
|
||||
testSpec.statusBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@@ -124,31 +124,43 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
@Presubmit
|
||||
@Test
|
||||
// During testing the launcher is always in portrait mode
|
||||
open fun noUncoveredRegions() {
|
||||
testSpec.noUncoveredRegions(Surface.ROTATION_0, testSpec.config.endRotation)
|
||||
open fun entireScreenCovered() {
|
||||
testSpec.entireScreenCovered(Surface.ROTATION_0, testSpec.config.endRotation)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun focusChanges() {
|
||||
testSpec.focusChanges("NexusLauncherActivity", testApp.`package`)
|
||||
testSpec.assertEventLog {
|
||||
this.focusChanges("NexusLauncherActivity", testApp.`package`)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appLayerReplacesLauncher() {
|
||||
testSpec.appLayerReplacesLauncher(testApp.`package`)
|
||||
testSpec.replacesLayer(LAUNCHER_COMPONENT, testApp.component)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appWindowReplacesLauncherAsTopWindow() {
|
||||
testSpec.appWindowReplacesLauncherAsTopWindow(testApp)
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowOnTop(SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherWindowBecomesInvisible() {
|
||||
testSpec.launcherWindowBecomesInvisible()
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowInvisible(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,15 +67,7 @@ class OpenAppWarmTest(testSpec: FlickerTestParameter) : OpenAppTransition(testSp
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerIsAlwaysVisible() {
|
||||
super.navBarLayerIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() {
|
||||
super.navBarLayerRotatesAndScales()
|
||||
}
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -25,7 +25,13 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.ROTATION_COMPONENT
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -61,39 +67,62 @@ class ChangeAppRotationTest(
|
||||
super.focusDoesNotChange()
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Presubmit
|
||||
@Test
|
||||
fun screenshotLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.getPackage())
|
||||
this.isVisible(testApp.component)
|
||||
.then()
|
||||
.isVisible(SCREENSHOT_LAYER)
|
||||
.isVisible(ROTATION_COMPONENT)
|
||||
.then()
|
||||
.isVisible(testApp.getPackage())
|
||||
.isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerRotatesScales() {
|
||||
super.statusBarLayerRotatesScales()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() {
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
fun statusBarWindowIsVisible() {
|
||||
testSpec.statusBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun statusBarLayerIsVisible() {
|
||||
testSpec.statusBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerRotatesScales() {
|
||||
testSpec.statusBarLayerRotatesScales(
|
||||
testSpec.config.startRotation, testSpec.config.endRotation)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsVisible() {
|
||||
super.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisible() {
|
||||
super.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() {
|
||||
super.statusBarLayerIsAlwaysVisible()
|
||||
override fun navBarLayerRotatesAndScales() {
|
||||
super.navBarLayerRotatesAndScales()
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val SCREENSHOT_LAYER = "RotationLayer"
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
|
||||
@@ -17,25 +17,21 @@
|
||||
package com.android.server.wm.flicker.rotation
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
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.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Test
|
||||
|
||||
@@ -69,19 +65,19 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsAlwaysVisible() {
|
||||
testSpec.navBarWindowIsAlwaysVisible()
|
||||
open fun navBarWindowIsVisible() {
|
||||
testSpec.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsAlwaysVisible() {
|
||||
testSpec.navBarLayerIsAlwaysVisible(rotatesScreen = true)
|
||||
open fun navBarLayerIsVisible() {
|
||||
testSpec.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerRotatesAndScales() {
|
||||
testSpec.navBarLayerRotatesAndScales(
|
||||
@@ -90,31 +86,12 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsAlwaysVisible() {
|
||||
testSpec.statusBarWindowIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
open fun statusBarLayerIsAlwaysVisible() {
|
||||
testSpec.statusBarLayerIsAlwaysVisible(rotatesScreen = true)
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
open fun statusBarLayerRotatesScales() {
|
||||
testSpec.statusBarLayerRotatesScales(
|
||||
testSpec.config.startRotation, testSpec.config.endRotation)
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
ignoreLayers = listOf(WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME,
|
||||
"SecondaryHomeHandle"
|
||||
ignoreLayers = listOf(WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
ComponentName("", "SecondaryHomeHandle")
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -130,22 +107,24 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun noUncoveredRegions() {
|
||||
testSpec.noUncoveredRegions(testSpec.config.startRotation,
|
||||
open fun entireScreenCovered() {
|
||||
testSpec.entireScreenCovered(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation, allStates = false)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun focusDoesNotChange() {
|
||||
testSpec.focusDoesNotChange()
|
||||
testSpec.assertEventLog {
|
||||
this.focusDoesNotChange()
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appLayerRotates_StartingPos() {
|
||||
testSpec.assertLayersStart {
|
||||
this.visibleRegion(testApp.getPackage()).coversExactly(startingPos)
|
||||
this.visibleRegion(testApp.component).coversExactly(startingPos)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +132,7 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
@Test
|
||||
open fun appLayerRotates_EndingPos() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.visibleRegion(testApp.getPackage()).coversExactly(endingPos)
|
||||
this.visibleRegion(testApp.component).coversExactly(endingPos)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ package com.android.server.wm.flicker.rotation
|
||||
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManager
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
@@ -27,6 +28,7 @@ import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.SeamlessRotationAppHelper
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -60,42 +62,91 @@ class SeamlessAppRotationTest(
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 140855415)
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() {
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
fun appWindowFullScreen() {
|
||||
testSpec.assertWm {
|
||||
this.invoke("isFullScreen") {
|
||||
val appWindow = it.windowState(testApp.`package`)
|
||||
val flags = appWindow.windowState?.attributes?.flags ?: 0
|
||||
appWindow.verify("isFullScreen")
|
||||
.that(flags.and(WindowManager.LayoutParams.FLAG_FULLSCREEN))
|
||||
.isGreaterThan(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 140855415)
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsAlwaysVisible() {
|
||||
super.statusBarLayerIsAlwaysVisible()
|
||||
fun appWindowSeamlessRotation() {
|
||||
testSpec.assertWm {
|
||||
this.invoke("isRotationSeamless") {
|
||||
val appWindow = it.windowState(testApp.`package`)
|
||||
val rotationAnimation = appWindow.windowState?.attributes?.rotationAnimation ?: 0
|
||||
appWindow.verify("isRotationSeamless")
|
||||
.that(rotationAnimation
|
||||
.and(WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS))
|
||||
.isGreaterThan(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayerAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
isVisible(testApp.`package`)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 185400889)
|
||||
@Test
|
||||
fun appLayerRotates() {
|
||||
testSpec.assertLayers {
|
||||
this.coversExactly(startingPos, testApp.`package`)
|
||||
.then()
|
||||
.coversExactly(endingPos, testApp.`package`)
|
||||
isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun appLayerRotates() {
|
||||
testSpec.assertLayers {
|
||||
this.coversExactly(startingPos, testApp.component)
|
||||
.then()
|
||||
.coversExactly(endingPos, testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAboveAppWindowInvisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsVisible() {
|
||||
super.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisible() {
|
||||
super.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
companion object {
|
||||
private val testFactory = FlickerTestParameterFactory.getInstance()
|
||||
|
||||
|
||||
@@ -23,5 +23,6 @@
|
||||
<EditText android:id="@+id/plain_text_input"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
android:inputType="text"/>
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user