Merge "Simplify flicker assertions"
This commit is contained in:
committed by
Android (Google) Code Review
commit
9271b1a31a
@@ -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#")
|
||||
@@ -25,7 +25,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
|
||||
@@ -91,7 +91,7 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsInvisible() = testSpec.appPairsDividerIsInvisible()
|
||||
fun appPairsDividerIsInvisibleAtEnd() = testSpec.appPairsDividerIsInvisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -101,8 +101,8 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
"Non resizeable app not initialized"
|
||||
}
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isInvisible(primaryApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isInvisible(primaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,8 @@ 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
|
||||
@@ -73,14 +72,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,10 +87,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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,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
|
||||
@@ -91,7 +91,7 @@ class AppPairsTestSupportPairNonResizeableApps(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsVisible() = testSpec.appPairsDividerIsVisible()
|
||||
fun appPairsDividerIsVisibleAtEnd() = testSpec.appPairsDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -101,8 +101,8 @@ class AppPairsTestSupportPairNonResizeableApps(
|
||||
"Non resizeable app not initialized"
|
||||
}
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isVisible(primaryApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isVisible(primaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,8 @@ 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
|
||||
@@ -77,14 +76,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,10 +91,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))
|
||||
}
|
||||
}
|
||||
@@ -104,8 +103,8 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
@Test
|
||||
fun appsEndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
notContains(primaryApp.defaultWindowName)
|
||||
notContains(secondaryApp.defaultWindowName)
|
||||
notContains(primaryApp.component)
|
||||
notContains(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ 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.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
|
||||
@@ -73,26 +73,26 @@ class RotateTwoLaunchedAppsInAppPairsMode(
|
||||
@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()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun appPairsPrimaryBoundsIsVisible() =
|
||||
testSpec.appPairsPrimaryBoundsIsVisible(testSpec.config.endRotation,
|
||||
primaryApp.defaultWindowName)
|
||||
fun appPairsPrimaryBoundsIsVisibleAtEnd() =
|
||||
testSpec.appPairsPrimaryBoundsIsVisibleAtEnd(testSpec.config.endRotation,
|
||||
primaryApp.component)
|
||||
|
||||
@Postsubmit
|
||||
@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}")
|
||||
|
||||
@@ -28,11 +28,9 @@ 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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
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.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
|
||||
@@ -66,7 +64,7 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appPairsDividerIsVisible() = testSpec.appPairsDividerIsVisible()
|
||||
fun appPairsDividerIsVisibleAtEnd() = testSpec.appPairsDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -88,22 +86,22 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
|
||||
@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}")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -24,7 +25,6 @@ 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
|
||||
@@ -33,7 +33,7 @@ import com.android.server.wm.flicker.startRotation
|
||||
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
|
||||
@@ -62,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
|
||||
@@ -89,7 +89,7 @@ class EnterSplitScreenDockActivity(
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.defaultWindowName)
|
||||
isVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -26,7 +27,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
|
||||
@@ -62,21 +63,21 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -24,7 +25,6 @@ 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
|
||||
@@ -33,8 +33,8 @@ import com.android.server.wm.flicker.startRotation
|
||||
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
|
||||
@@ -63,22 +63,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
|
||||
@@ -86,7 +86,22 @@ 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
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -27,7 +28,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
|
||||
@@ -71,12 +72,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() {
|
||||
@@ -92,7 +93,7 @@ class EnterSplitScreenNotSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsInvisible() = testSpec.dockedStackDividerIsInvisible()
|
||||
fun dockedStackDividerNotExistsAtEnd() = testSpec.dockedStackDividerNotExistsAtEnd()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -27,7 +28,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
|
||||
@@ -68,12 +69,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() {
|
||||
@@ -89,13 +90,13 @@ class EnterSplitScreenSupportNonResizable(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
|
||||
fun dockedStackDividerIsVisibleAtEnd() = testSpec.dockedStackDividerIsVisibleAtEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.defaultWindowName)
|
||||
isVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -25,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.exitSplitScreenFromBottom
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.layerBecomesInvisible
|
||||
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
|
||||
@@ -72,19 +71,30 @@ class ExitLegacySplitScreenFromBottom(
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@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
|
||||
@Test
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -25,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.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
|
||||
@@ -72,23 +71,34 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun dockedStackDividerIsInvisible() = testSpec.dockedStackDividerIsInvisible()
|
||||
fun dockedStackDividerNotExistsAtEnd() = testSpec.dockedStackDividerNotExistsAtEnd()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun layerBecomesInvisible() = testSpec.layerBecomesInvisible(splitScreenApp.defaultWindowName)
|
||||
fun layerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesInVisible() =
|
||||
testSpec.appWindowBecomesInVisible(splitScreenApp.defaultWindowName)
|
||||
fun appWindowBecomesInVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -24,15 +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.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
|
||||
@@ -73,11 +70,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() {
|
||||
@@ -93,34 +90,90 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,8 +192,8 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
@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.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
@@ -24,13 +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.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
|
||||
@@ -71,11 +70,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() {
|
||||
@@ -91,24 +90,47 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -24,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
|
||||
@@ -74,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() {
|
||||
@@ -94,34 +91,60 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(nonResizeableApp.defaultWindowName)
|
||||
fun nonResizableAppWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(nonResizeableApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
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
|
||||
@@ -24,14 +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.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
|
||||
@@ -72,11 +71,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() {
|
||||
@@ -92,24 +91,47 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
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.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
@@ -27,7 +27,7 @@ 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
|
||||
@@ -35,9 +35,7 @@ import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
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.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
@@ -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,9 +86,9 @@ 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
|
||||
@@ -108,7 +104,7 @@ class LegacySplitScreenToLauncher(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.endRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.endRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -130,11 +126,21 @@ class LegacySplitScreenToLauncher(
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun layerBecomesInvisible() = testSpec.layerBecomesInvisible(testApp.getPackage())
|
||||
fun layerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.component)
|
||||
.then()
|
||||
.isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun focusDoesNotChange() = testSpec.focusDoesNotChange()
|
||||
fun focusDoesNotChange() {
|
||||
testSpec.assertEventLog {
|
||||
this.focusDoesNotChange()
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
|
||||
@@ -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
|
||||
@@ -46,8 +47,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
|
||||
@@ -70,8 +72,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 ->
|
||||
@@ -138,9 +141,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.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
@@ -25,12 +26,9 @@ 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.statusBarLayerIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
@@ -63,18 +61,24 @@ 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())
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -86,12 +90,22 @@ class OpenAppToLegacySplitScreen(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun layerBecomesVisible() = testSpec.layerBecomesVisible(splitScreenApp.getPackage())
|
||||
fun layerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@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")
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
|
||||
@@ -28,6 +28,7 @@ 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
|
||||
@@ -37,14 +38,13 @@ import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
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.flicker.traces.layers.getVisibleBounds
|
||||
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.SimpleAppHelper
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -110,7 +110,7 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun topAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(sSimpleActivity)
|
||||
this.isAppWindowVisible(Components.SimpleActivity.COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun bottomAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(sImeActivity)
|
||||
this.isAppWindowVisible(Components.ImeActivity.COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ class ResizeLegacySplitScreen(
|
||||
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)
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ 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
|
||||
@@ -35,8 +34,8 @@ 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.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
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
|
||||
@@ -67,13 +66,13 @@ 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)
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
@@ -97,8 +96,13 @@ class RotateOneLaunchedAppAndEnterSplitScreen(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(splitScreenApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
|
||||
@@ -25,7 +25,6 @@ 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
|
||||
@@ -35,8 +34,8 @@ 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.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
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
|
||||
@@ -67,12 +66,12 @@ 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)
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
@@ -94,8 +93,13 @@ class RotateOneLaunchedAppInSplitScreenMode(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(splitScreenApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(splitScreenApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
|
||||
@@ -24,7 +24,6 @@ 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
|
||||
@@ -35,9 +34,9 @@ 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.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
|
||||
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,19 +68,19 @@ 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)
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
@@ -96,7 +95,26 @@ class RotateTwoLaunchedAppAndEnterSplitScreen(
|
||||
|
||||
@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
|
||||
|
||||
@@ -25,7 +25,6 @@ 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
|
||||
@@ -36,9 +35,9 @@ 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.statusBarWindowIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
|
||||
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
|
||||
@@ -75,19 +74,19 @@ 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)
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
@@ -103,8 +102,13 @@ class RotateTwoLaunchedAppInSplitScreenMode(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun appWindowBecomesVisible() =
|
||||
testSpec.appWindowBecomesVisible(secondaryApp.defaultWindowName)
|
||||
fun appWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(secondaryApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -71,7 +71,7 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun pipAppRemainInsideVisibleBounds() {
|
||||
testSpec.assertWm {
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,10 +79,13 @@ class EnterExitPipTest(
|
||||
@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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +93,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,8 +104,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +113,7 @@ class EnterExitPipTest(
|
||||
@Test
|
||||
fun pipAppCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(pipApp.defaultWindowName).coversExactly(displayBounds)
|
||||
visibleRegion(pipApp.component).coversExactly(displayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun noUncoveredRegions() = super.noUncoveredRegions()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
@@ -66,7 +66,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun pipAppWindowAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindow(pipApp.defaultWindowName)
|
||||
this.isAppWindowVisible(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
@Test
|
||||
fun pipLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(pipApp.windowName)
|
||||
this.isVisible(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,13 +101,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun pipAppHidesTestApp() {
|
||||
testSpec.assertWmStart {
|
||||
isInvisible(testApp.defaultWindowName)
|
||||
isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun testAppWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(testApp.defaultWindowName)
|
||||
isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun pipAppLayerHidesTestApp() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.defaultWindowName).coversExactly(startingBounds)
|
||||
isInvisible(testApp.defaultWindowName)
|
||||
visibleRegion(pipApp.component).coversExactly(startingBounds)
|
||||
isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,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}")
|
||||
|
||||
@@ -85,7 +85,7 @@ class PipCloseWithSwipeTest(testSpec: FlickerTestParameter) : PipCloseTransition
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun noUncoveredRegions() = super.noUncoveredRegions()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -28,7 +28,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
|
||||
@@ -88,7 +88,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun pipWindowInsideDisplayBounds() {
|
||||
testSpec.assertWm {
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,9 +91,9 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun pipLayerInsideDisplayBounds() {
|
||||
testSpec.assertLayers {
|
||||
coversAtMost(displayBounds, pipApp.defaultWindowName)
|
||||
coversAtMost(displayBounds, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,8 +109,8 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
|
||||
@FlakyTest(bugId = 161435597)
|
||||
@Test
|
||||
override fun noUncoveredRegions() = super.noUncoveredRegions()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
companion object {
|
||||
const val TEST_REPETITIONS = 2
|
||||
|
||||
@@ -27,10 +27,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
|
||||
@@ -76,7 +76,7 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
|
||||
override fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation,
|
||||
testSpec.config.endRotation, allStates = false)
|
||||
|
||||
@Postsubmit
|
||||
@@ -103,8 +103,8 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
@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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
@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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +72,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,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
|
||||
@@ -73,9 +73,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,9 +85,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,22 +97,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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ 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
|
||||
@@ -32,7 +33,6 @@ import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
@@ -188,6 +188,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)
|
||||
}
|
||||
@@ -102,7 +102,7 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
@Test
|
||||
fun pipWindowInsideDisplay() {
|
||||
testSpec.assertWmStart {
|
||||
frameRegion(pipApp.defaultWindowName).coversAtMost(startingBounds)
|
||||
frameRegion(pipApp.component).coversAtMost(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
@Test
|
||||
fun pipAppShowsOnTop() {
|
||||
testSpec.assertWmEnd {
|
||||
showsAppWindowOnTop(pipApp.defaultWindowName)
|
||||
isAppWindowOnTop(pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,28 +118,28 @@ class SetRequestedOrientationWhilePinnedTest(
|
||||
@Test
|
||||
fun pipLayerInsideDisplay() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.defaultWindowName).coversAtMost(startingBounds)
|
||||
visibleRegion(pipApp.component).coversAtMost(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAlwaysVisible() = testSpec.assertWm {
|
||||
this.showsAppWindow(pipApp.windowName)
|
||||
this.isAppWindowVisible(pipApp.component)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppLayerCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(pipApp.defaultWindowName).coversExactly(endingBounds)
|
||||
visibleRegion(pipApp.component).coversExactly(endingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun noUncoveredRegions() {
|
||||
super.noUncoveredRegions()
|
||||
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
|
||||
|
||||
@@ -14,83 +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.statusBarWindowIsVisible() {
|
||||
assertWmStart {
|
||||
this.isAboveAppWindow(STATUS_BAR_WINDOW_NAME)
|
||||
}
|
||||
assertWmEnd {
|
||||
this.isAboveAppWindow(STATUS_BAR_WINDOW_NAME)
|
||||
assertWm {
|
||||
this.isAboveAppWindowVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.navBarWindowIsVisible() {
|
||||
assertWmStart {
|
||||
this.isAboveAppWindow(NAV_BAR_WINDOW_NAME)
|
||||
}
|
||||
assertWmEnd {
|
||||
this.isAboveAppWindow(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
|
||||
@@ -119,19 +66,19 @@ fun FlickerTestParameter.noUncoveredRegions(
|
||||
|
||||
fun FlickerTestParameter.navBarLayerIsVisible() {
|
||||
assertLayersStart {
|
||||
this.isVisible(NAV_BAR_LAYER_NAME)
|
||||
this.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(NAV_BAR_LAYER_NAME)
|
||||
this.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.statusBarLayerIsVisible() {
|
||||
assertLayersStart {
|
||||
this.isVisible(STATUS_BAR_LAYER_NAME)
|
||||
this.isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(STATUS_BAR_LAYER_NAME)
|
||||
this.isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,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
|
||||
*
|
||||
|
||||
@@ -22,26 +22,32 @@ 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.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.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
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.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.launcherLayerReplacesApp
|
||||
import com.android.server.wm.flicker.launcherWindowBecomesVisible
|
||||
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 {
|
||||
@@ -117,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()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,15 +29,16 @@ 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.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
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
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -105,7 +106,7 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
@Test
|
||||
fun imeAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindowOnTop(testApp.getPackage())
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,13 +120,13 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation)
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(IME_LAYER_TITLE)
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +134,7 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(IME_LAYER_TITLE)
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +146,7 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
@Test
|
||||
fun imeAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.getPackage())
|
||||
this.isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
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.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
@@ -84,7 +84,7 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
transitions {
|
||||
device.pressHome()
|
||||
wmHelper.waitForHomeActivityVisible()
|
||||
wmHelper.waitImeWindowGone()
|
||||
wmHelper.waitImeGone()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,22 +109,22 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
@Test
|
||||
fun imeAppWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindowOnTop(testApp.getPackage())
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
.then()
|
||||
.appWindowNotOnTop(testApp.getPackage())
|
||||
.appWindowNotOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun noUncoveredRegions() = testSpec.noUncoveredRegions(testSpec.config.startRotation,
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.startRotation,
|
||||
Surface.ROTATION_0)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(IME_LAYER_TITLE)
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(IME_LAYER_TITLE)
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,9 +144,9 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
@Test
|
||||
fun imeAppLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.getPackage())
|
||||
.then()
|
||||
.isInvisible(testApp.getPackage())
|
||||
this.isVisible(testApp.component)
|
||||
.then()
|
||||
.isInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,8 +174,9 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
@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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
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.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
@@ -90,15 +90,20 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
|
||||
@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
|
||||
@@ -110,7 +115,7 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@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}")
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
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.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
@@ -68,7 +68,7 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
transitions {
|
||||
device.pressHome()
|
||||
wmHelper.waitForHomeActivityVisible()
|
||||
wmHelper.waitImeWindowGone()
|
||||
wmHelper.waitImeGone()
|
||||
}
|
||||
teardown {
|
||||
eachRun {
|
||||
@@ -94,9 +94,10 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
@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,7 +107,13 @@ 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
|
||||
@@ -118,7 +125,7 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@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,129 +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"
|
||||
const val IME_LAYER_TITLE = "$IME_WINDOW_TITLE#0"
|
||||
|
||||
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_LAYER_TITLE)
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.isVisible(IME_LAYER_TITLE)
|
||||
.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(IME_LAYER_TITLE)
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(IME_LAYER_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())
|
||||
}
|
||||
}
|
||||
@@ -31,8 +31,7 @@ import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.appWindowAlwaysVisibleOnTop
|
||||
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.statusBarLayerIsVisible
|
||||
@@ -93,7 +92,11 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowAlwaysVisibleOnTop() = testSpec.appWindowAlwaysVisibleOnTop(testApp.`package`)
|
||||
fun appWindowAlwaysVisibleOnTop() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -105,7 +108,7 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@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,6 +27,7 @@ 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
|
||||
@@ -33,16 +35,13 @@ import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.launcherWindowBecomesInvisible
|
||||
import com.android.server.wm.flicker.appLayerReplacesLauncher
|
||||
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.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
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
|
||||
@@ -62,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 {
|
||||
@@ -74,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 {
|
||||
@@ -102,18 +100,25 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
val component = ComponentName("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
ignoreWindows = listOf(WindowManagerStateHelper.SPLASH_SCREEN_NAME,
|
||||
WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME,
|
||||
"RecentTaskScreenshotSurface#0")
|
||||
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
|
||||
@@ -121,12 +126,24 @@ 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
|
||||
@@ -139,12 +156,27 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
|
||||
@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
|
||||
@@ -161,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,11 +17,12 @@
|
||||
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.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
|
||||
@@ -35,8 +36,7 @@ import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.NAV_BAR_LAYER_NAME
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.STATUS_BAR_LAYER_NAME
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -93,7 +93,7 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
|
||||
|
||||
wmHelper.waitForFullScreenApp(testApp.component)
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
createTag(Companion.TAG_IME_INVISIBLE)
|
||||
createTag(TAG_IME_INVISIBLE)
|
||||
}
|
||||
transitions {
|
||||
// [Step2]: Swipe left to back to imeTestApp task
|
||||
@@ -106,51 +106,52 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
|
||||
}
|
||||
|
||||
@Test
|
||||
fun imeAppWindowAlwaysVisible() {
|
||||
fun imeAppWindowVisibility() {
|
||||
val component = ComponentName(imeTestApp.`package`, "")
|
||||
testSpec.assertWm {
|
||||
this.showsAppWindowOnTop(testApp.getPackage())
|
||||
this.isAppWindowOnTop(component)
|
||||
.then()
|
||||
.showsAppWindow(testApp.getPackage())
|
||||
.isAppWindowVisible(component, ignoreActivity = true)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun navBarLayerIsVisibleAroundSwitching() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(NAV_BAR_LAYER_NAME)
|
||||
isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(NAV_BAR_LAYER_NAME)
|
||||
isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun statusBarLayerIsVisibleAroundSwitching() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(STATUS_BAR_LAYER_NAME)
|
||||
isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(STATUS_BAR_LAYER_NAME)
|
||||
isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun imeLayerIsVisibleWhenSwitchingToImeApp() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(IME_WINDOW_TITLE)
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersTag(TAG_IME_VISIBLE) {
|
||||
isVisible(IME_WINDOW_TITLE)
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(IME_WINDOW_TITLE)
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun imeLayerIsInvisibleWhenSwitchingToTestApp() {
|
||||
testSpec.assertLayersTag(TAG_IME_INVISIBLE) {
|
||||
isInvisible(IME_WINDOW_TITLE)
|
||||
isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +170,8 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
|
||||
repetitions = 3,
|
||||
supportedNavigationModes = listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
),
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,8 @@ class OpenAppColdTest(testSpec: FlickerTestParameter) : OpenAppTransition(testSp
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
|
||||
@@ -22,10 +22,10 @@ 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
|
||||
@@ -33,13 +33,13 @@ import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
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.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.launcherWindowBecomesInvisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.SNAPSHOT_COMPONENT
|
||||
import org.junit.Test
|
||||
|
||||
abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,9 +74,7 @@ class OpenAppWarmTest(testSpec: FlickerTestParameter) : OpenAppTransition(testSp
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() {
|
||||
super.navBarLayerRotatesAndScales()
|
||||
}
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
|
||||
@@ -30,6 +30,7 @@ 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
|
||||
@@ -69,11 +70,11 @@ class ChangeAppRotationTest(
|
||||
@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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,8 +122,6 @@ class ChangeAppRotationTest(
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val SCREENSHOT_LAYER = "RotationLayer"
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
|
||||
@@ -17,20 +17,20 @@
|
||||
package com.android.server.wm.flicker.rotation
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
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.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
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.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Test
|
||||
@@ -89,9 +89,9 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
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")
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -107,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ class SeamlessAppRotationTest(
|
||||
@Test
|
||||
fun appLayerAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
isVisible(testApp.`package`)
|
||||
isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,9 +102,9 @@ class SeamlessAppRotationTest(
|
||||
@Test
|
||||
fun appLayerRotates() {
|
||||
testSpec.assertLayers {
|
||||
this.coversExactly(startingPos, testApp.`package`)
|
||||
this.coversExactly(startingPos, testApp.component)
|
||||
.then()
|
||||
.coversExactly(endingPos, testApp.`package`)
|
||||
.coversExactly(endingPos, testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class SeamlessAppRotationTest(
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.hidesAboveAppWindow(WindowManagerStateHelper.STATUS_BAR_WINDOW_NAME)
|
||||
this.isAboveAppWindowInvisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ class SeamlessAppRotationTest(
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(WindowManagerStateHelper.STATUS_BAR_LAYER_NAME)
|
||||
this.isInvisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,9 +144,7 @@ class SeamlessAppRotationTest(
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() {
|
||||
super.navBarLayerRotatesAndScales()
|
||||
}
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
companion object {
|
||||
private val testFactory = FlickerTestParameterFactory.getInstance()
|
||||
|
||||
Reference in New Issue
Block a user