Merge changes from topic "flicker-read-write-refactor"
* changes: Compatibilize tests with new constants Compatibilize flicker tests with flicker infra refactor
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
<option name="run-command" value="locksettings set-disabled false" />
|
||||
<!-- restart launcher to activate TAPL -->
|
||||
<option name="run-command" value="setprop ro.test_harness 1 ; am force-stop com.google.android.apps.nexuslauncher" />
|
||||
<!-- Ensure output directory is empty at the start -->
|
||||
<option name="run-command" value="rm -rf /sdcard/flicker" />
|
||||
</target_preparer>
|
||||
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
|
||||
<option name="cleanup-apks" value="true"/>
|
||||
|
||||
@@ -20,10 +20,10 @@ import android.app.Instrumentation
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation
|
||||
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.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.junit.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisibleAtStartAndEnd
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
|
||||
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
|
||||
@@ -45,12 +45,12 @@ import org.junit.Test
|
||||
abstract class BaseTest
|
||||
@JvmOverloads
|
||||
constructor(
|
||||
protected val testSpec: FlickerTestParameter,
|
||||
protected val flicker: FlickerTest,
|
||||
protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation(),
|
||||
protected val tapl: LauncherInstrumentation = LauncherInstrumentation()
|
||||
) {
|
||||
init {
|
||||
testSpec.setIsTablet(
|
||||
flicker.scenario.setIsTablet(
|
||||
WindowManagerStateHelper(instrumentation, clearCacheAfterParsing = false)
|
||||
.currentState
|
||||
.wmState
|
||||
@@ -68,13 +68,13 @@ constructor(
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
setup { testSpec.setIsTablet(wmHelper.currentState.wmState.isTablet) }
|
||||
setup { flicker.scenario.setIsTablet(wmHelper.currentState.wmState.isTablet) }
|
||||
transition()
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks that all parts of the screen are covered during the transition */
|
||||
@Presubmit @Test open fun entireScreenCovered() = testSpec.entireScreenCovered()
|
||||
@Presubmit @Test open fun entireScreenCovered() = flicker.entireScreenCovered()
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentNameMatcher.NAV_BAR] layer is visible during the whole transition
|
||||
@@ -82,8 +82,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsVisibleAtStartAndEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarLayerIsVisibleAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,8 +93,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerPositionAtStartAndEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarLayerPositionAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarLayerPositionAtStartAndEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,8 +105,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsAlwaysVisible() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarWindowIsAlwaysVisible()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarWindowIsAlwaysVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,8 +115,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun taskBarLayerIsVisibleAtStartAndEnd() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
flicker.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,8 +127,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun taskBarWindowIsAlwaysVisible() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.taskBarWindowIsAlwaysVisible()
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
flicker.taskBarWindowIsAlwaysVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,8 +137,7 @@ constructor(
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsVisibleAtStartAndEnd() =
|
||||
testSpec.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
open fun statusBarLayerIsVisibleAtStartAndEnd() = flicker.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the
|
||||
@@ -146,7 +145,7 @@ constructor(
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerPositionAtStartAndEnd() = testSpec.statusBarLayerPositionAtStartAndEnd()
|
||||
open fun statusBarLayerPositionAtStartAndEnd() = flicker.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentNameMatcher.STATUS_BAR] window is visible during the whole
|
||||
@@ -154,7 +153,7 @@ constructor(
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
open fun statusBarWindowIsAlwaysVisible() = flicker.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/**
|
||||
* Checks that all layers that are visible on the trace, are visible for at least 2 consecutive
|
||||
@@ -163,7 +162,7 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers { this.visibleLayersShownMoreThanOneConsecutiveEntry() }
|
||||
flicker.assertLayers { this.visibleLayersShownMoreThanOneConsecutiveEntry() }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,6 +172,6 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm { this.visibleWindowsShownMoreThanOneConsecutiveEntry() }
|
||||
flicker.assertWm { this.visibleWindowsShownMoreThanOneConsecutiveEntry() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,23 +18,23 @@
|
||||
|
||||
package com.android.wm.shell.flicker
|
||||
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.traces.layers.LayerTraceEntrySubject
|
||||
import com.android.server.wm.flicker.traces.layers.LayersTraceSubject
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.region.Region
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerIsVisibleAtEnd() {
|
||||
fun FlickerTest.appPairsDividerIsVisibleAtEnd() {
|
||||
assertLayersEnd { this.isVisible(APP_PAIR_SPLIT_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerIsInvisibleAtEnd() {
|
||||
fun FlickerTest.appPairsDividerIsInvisibleAtEnd() {
|
||||
assertLayersEnd { this.notContains(APP_PAIR_SPLIT_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerBecomesVisible() {
|
||||
fun FlickerTest.appPairsDividerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
@@ -42,7 +42,7 @@ fun FlickerTestParameter.appPairsDividerBecomesVisible() {
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenEntered(
|
||||
fun FlickerTest.splitScreenEntered(
|
||||
component1: IComponentMatcher,
|
||||
component2: IComponentMatcher,
|
||||
fromOtherApp: Boolean,
|
||||
@@ -69,7 +69,7 @@ fun FlickerTestParameter.splitScreenEntered(
|
||||
splitScreenDividerIsVisibleAtEnd()
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenDismissed(
|
||||
fun FlickerTest.splitScreenDismissed(
|
||||
component1: IComponentMatcher,
|
||||
component2: IComponentMatcher,
|
||||
toHome: Boolean
|
||||
@@ -87,27 +87,27 @@ fun FlickerTestParameter.splitScreenDismissed(
|
||||
splitScreenDividerIsInvisibleAtEnd()
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenDividerIsVisibleAtStart() {
|
||||
fun FlickerTest.splitScreenDividerIsVisibleAtStart() {
|
||||
assertLayersStart { this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenDividerIsVisibleAtEnd() {
|
||||
fun FlickerTest.splitScreenDividerIsVisibleAtEnd() {
|
||||
assertLayersEnd { this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenDividerIsInvisibleAtStart() {
|
||||
fun FlickerTest.splitScreenDividerIsInvisibleAtStart() {
|
||||
assertLayersStart { this.isInvisible(SPLIT_SCREEN_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenDividerIsInvisibleAtEnd() {
|
||||
fun FlickerTest.splitScreenDividerIsInvisibleAtEnd() {
|
||||
assertLayersEnd { this.isInvisible(SPLIT_SCREEN_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenDividerBecomesVisible() {
|
||||
fun FlickerTest.splitScreenDividerBecomesVisible() {
|
||||
layerBecomesVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitScreenDividerBecomesInvisible() {
|
||||
fun FlickerTest.splitScreenDividerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
@@ -115,23 +115,23 @@ fun FlickerTestParameter.splitScreenDividerBecomesInvisible() {
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerBecomesVisible(component: IComponentMatcher) {
|
||||
fun FlickerTest.layerBecomesVisible(component: IComponentMatcher) {
|
||||
assertLayers { this.isInvisible(component).then().isVisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerBecomesInvisible(component: IComponentMatcher) {
|
||||
fun FlickerTest.layerBecomesInvisible(component: IComponentMatcher) {
|
||||
assertLayers { this.isVisible(component).then().isInvisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerIsVisibleAtEnd(component: IComponentMatcher) {
|
||||
fun FlickerTest.layerIsVisibleAtEnd(component: IComponentMatcher) {
|
||||
assertLayersEnd { this.isVisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.layerKeepVisible(component: IComponentMatcher) {
|
||||
fun FlickerTest.layerKeepVisible(component: IComponentMatcher) {
|
||||
assertLayers { this.isVisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitAppLayerBoundsBecomesVisible(
|
||||
fun FlickerTest.splitAppLayerBoundsBecomesVisible(
|
||||
component: IComponentMatcher,
|
||||
landscapePosLeft: Boolean,
|
||||
portraitPosTop: Boolean
|
||||
@@ -145,12 +145,12 @@ fun FlickerTestParameter.splitAppLayerBoundsBecomesVisible(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
endRotation
|
||||
scenario.endRotation
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitAppLayerBoundsBecomesVisibleByDrag(component: IComponentMatcher) {
|
||||
fun FlickerTest.splitAppLayerBoundsBecomesVisibleByDrag(component: IComponentMatcher) {
|
||||
assertLayers {
|
||||
this.notContains(SPLIT_SCREEN_DIVIDER_COMPONENT.or(component), isOptional = true)
|
||||
.then()
|
||||
@@ -161,7 +161,7 @@ fun FlickerTestParameter.splitAppLayerBoundsBecomesVisibleByDrag(component: ICom
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitAppLayerBoundsBecomesInvisible(
|
||||
fun FlickerTest.splitAppLayerBoundsBecomesInvisible(
|
||||
component: IComponentMatcher,
|
||||
landscapePosLeft: Boolean,
|
||||
portraitPosTop: Boolean
|
||||
@@ -171,7 +171,7 @@ fun FlickerTestParameter.splitAppLayerBoundsBecomesInvisible(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
endRotation
|
||||
scenario.endRotation
|
||||
)
|
||||
.then()
|
||||
.isVisible(component, true)
|
||||
@@ -180,27 +180,37 @@ fun FlickerTestParameter.splitAppLayerBoundsBecomesInvisible(
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
fun FlickerTest.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
component: IComponentMatcher,
|
||||
landscapePosLeft: Boolean,
|
||||
portraitPosTop: Boolean
|
||||
) {
|
||||
assertLayersEnd {
|
||||
splitAppLayerBoundsSnapToDivider(component, landscapePosLeft, portraitPosTop, endRotation)
|
||||
splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitAppLayerBoundsKeepVisible(
|
||||
fun FlickerTest.splitAppLayerBoundsKeepVisible(
|
||||
component: IComponentMatcher,
|
||||
landscapePosLeft: Boolean,
|
||||
portraitPosTop: Boolean
|
||||
) {
|
||||
assertLayers {
|
||||
splitAppLayerBoundsSnapToDivider(component, landscapePosLeft, portraitPosTop, endRotation)
|
||||
splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
scenario.endRotation
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.splitAppLayerBoundsChanges(
|
||||
fun FlickerTest.splitAppLayerBoundsChanges(
|
||||
component: IComponentMatcher,
|
||||
landscapePosLeft: Boolean,
|
||||
portraitPosTop: Boolean
|
||||
@@ -211,14 +221,14 @@ fun FlickerTestParameter.splitAppLayerBoundsChanges(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
endRotation
|
||||
scenario.endRotation
|
||||
)
|
||||
} else {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
endRotation
|
||||
scenario.endRotation
|
||||
)
|
||||
.then()
|
||||
.isInvisible(component)
|
||||
@@ -227,7 +237,7 @@ fun FlickerTestParameter.splitAppLayerBoundsChanges(
|
||||
component,
|
||||
landscapePosLeft,
|
||||
portraitPosTop,
|
||||
endRotation
|
||||
scenario.endRotation
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -237,7 +247,7 @@ fun LayersTraceSubject.splitAppLayerBoundsSnapToDivider(
|
||||
component: IComponentMatcher,
|
||||
landscapePosLeft: Boolean,
|
||||
portraitPosTop: Boolean,
|
||||
rotation: Int
|
||||
rotation: PlatformConsts.Rotation
|
||||
): LayersTraceSubject {
|
||||
return invoke("splitAppLayerBoundsSnapToDivider") {
|
||||
it.splitAppLayerBoundsSnapToDivider(component, landscapePosLeft, portraitPosTop, rotation)
|
||||
@@ -248,7 +258,7 @@ fun LayerTraceEntrySubject.splitAppLayerBoundsSnapToDivider(
|
||||
component: IComponentMatcher,
|
||||
landscapePosLeft: Boolean,
|
||||
portraitPosTop: Boolean,
|
||||
rotation: Int
|
||||
rotation: PlatformConsts.Rotation
|
||||
): LayerTraceEntrySubject {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(rotation)
|
||||
return invoke {
|
||||
@@ -292,7 +302,7 @@ fun LayerTraceEntrySubject.splitAppLayerBoundsSnapToDivider(
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowBecomesVisible(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowBecomesVisible(component: IComponentMatcher) {
|
||||
assertWm {
|
||||
this.isAppWindowInvisible(component)
|
||||
.then()
|
||||
@@ -304,39 +314,39 @@ fun FlickerTestParameter.appWindowBecomesVisible(component: IComponentMatcher) {
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowBecomesInvisible(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowBecomesInvisible(component: IComponentMatcher) {
|
||||
assertWm { this.isAppWindowVisible(component).then().isAppWindowInvisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowIsVisibleAtStart(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowIsVisibleAtStart(component: IComponentMatcher) {
|
||||
assertWmStart { this.isAppWindowVisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowIsVisibleAtEnd(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowIsVisibleAtEnd(component: IComponentMatcher) {
|
||||
assertWmEnd { this.isAppWindowVisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowIsInvisibleAtStart(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowIsInvisibleAtStart(component: IComponentMatcher) {
|
||||
assertWmStart { this.isAppWindowInvisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowIsInvisibleAtEnd(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowIsInvisibleAtEnd(component: IComponentMatcher) {
|
||||
assertWmEnd { this.isAppWindowInvisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowIsNotContainAtStart(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowIsNotContainAtStart(component: IComponentMatcher) {
|
||||
assertWmStart { this.notContains(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appWindowKeepVisible(component: IComponentMatcher) {
|
||||
fun FlickerTest.appWindowKeepVisible(component: IComponentMatcher) {
|
||||
assertWm { this.isAppWindowVisible(component) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerIsVisibleAtEnd() {
|
||||
fun FlickerTest.dockedStackDividerIsVisibleAtEnd() {
|
||||
assertLayersEnd { this.isVisible(DOCKED_STACK_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerBecomesVisible() {
|
||||
fun FlickerTest.dockedStackDividerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
@@ -344,7 +354,7 @@ fun FlickerTestParameter.dockedStackDividerBecomesVisible() {
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerBecomesInvisible() {
|
||||
fun FlickerTest.dockedStackDividerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(DOCKED_STACK_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
@@ -352,12 +362,12 @@ fun FlickerTestParameter.dockedStackDividerBecomesInvisible() {
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackDividerNotExistsAtEnd() {
|
||||
fun FlickerTest.dockedStackDividerNotExistsAtEnd() {
|
||||
assertLayersEnd { this.notContains(DOCKED_STACK_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
fun FlickerTest.appPairsPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: PlatformConsts.Rotation,
|
||||
primaryComponent: IComponentMatcher
|
||||
) {
|
||||
assertLayersEnd {
|
||||
@@ -366,8 +376,8 @@ fun FlickerTestParameter.appPairsPrimaryBoundsIsVisibleAtEnd(
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
fun FlickerTest.dockedStackPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: PlatformConsts.Rotation,
|
||||
primaryComponent: IComponentMatcher
|
||||
) {
|
||||
assertLayersEnd {
|
||||
@@ -376,8 +386,8 @@ fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisibleAtEnd(
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.appPairsSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
fun FlickerTest.appPairsSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: PlatformConsts.Rotation,
|
||||
secondaryComponent: IComponentMatcher
|
||||
) {
|
||||
assertLayersEnd {
|
||||
@@ -386,8 +396,8 @@ fun FlickerTestParameter.appPairsSecondaryBoundsIsVisibleAtEnd(
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
fun FlickerTest.dockedStackSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: PlatformConsts.Rotation,
|
||||
secondaryComponent: IComponentMatcher
|
||||
) {
|
||||
assertLayersEnd {
|
||||
@@ -396,40 +406,40 @@ fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisibleAtEnd(
|
||||
}
|
||||
}
|
||||
|
||||
fun getPrimaryRegion(dividerRegion: Region, rotation: Int): Region {
|
||||
fun getPrimaryRegion(dividerRegion: Region, rotation: PlatformConsts.Rotation): Region {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(rotation)
|
||||
return if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
|
||||
Region.from(
|
||||
0,
|
||||
0,
|
||||
displayBounds.bounds.right,
|
||||
dividerRegion.bounds.top + WindowUtils.dockedStackDividerInset
|
||||
)
|
||||
} else {
|
||||
return if (rotation.isRotated()) {
|
||||
Region.from(
|
||||
0,
|
||||
0,
|
||||
dividerRegion.bounds.left + WindowUtils.dockedStackDividerInset,
|
||||
displayBounds.bounds.bottom
|
||||
)
|
||||
} else {
|
||||
Region.from(
|
||||
0,
|
||||
0,
|
||||
displayBounds.bounds.right,
|
||||
dividerRegion.bounds.top + WindowUtils.dockedStackDividerInset
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun getSecondaryRegion(dividerRegion: Region, rotation: Int): Region {
|
||||
fun getSecondaryRegion(dividerRegion: Region, rotation: PlatformConsts.Rotation): Region {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(rotation)
|
||||
return if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
|
||||
Region.from(
|
||||
0,
|
||||
dividerRegion.bounds.bottom - WindowUtils.dockedStackDividerInset,
|
||||
displayBounds.bounds.right,
|
||||
displayBounds.bounds.bottom
|
||||
)
|
||||
} else {
|
||||
return if (rotation.isRotated()) {
|
||||
Region.from(
|
||||
dividerRegion.bounds.right - WindowUtils.dockedStackDividerInset,
|
||||
0,
|
||||
displayBounds.bounds.right,
|
||||
displayBounds.bounds.bottom
|
||||
)
|
||||
} else {
|
||||
Region.from(
|
||||
0,
|
||||
dividerRegion.bounds.bottom - WindowUtils.dockedStackDividerInset,
|
||||
displayBounds.bounds.right,
|
||||
displayBounds.bounds.bottom
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,21 +21,21 @@ import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.ServiceManager
|
||||
import android.view.Surface
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiObject2
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.Flicker
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.IFlickerTestData
|
||||
import com.android.server.wm.flicker.helpers.LaunchBubbleHelper
|
||||
import com.android.server.wm.flicker.helpers.SYSTEMUI_PACKAGE
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.BaseTest
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/** Base configurations for Bubble flicker tests */
|
||||
abstract class BaseBubbleScreen(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
abstract class BaseBubbleScreen(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
|
||||
protected val context: Context = instrumentation.context
|
||||
protected val testApp = LaunchBubbleHelper(instrumentation)
|
||||
@@ -79,17 +79,18 @@ abstract class BaseBubbleScreen(testSpec: FlickerTestParameter) : BaseTest(testS
|
||||
}
|
||||
}
|
||||
|
||||
protected fun Flicker.waitAndGetAddBubbleBtn(): UiObject2? =
|
||||
protected fun IFlickerTestData.waitAndGetAddBubbleBtn(): UiObject2? =
|
||||
device.wait(Until.findObject(By.text("Add Bubble")), FIND_OBJECT_TIMEOUT)
|
||||
protected fun Flicker.waitAndGetCancelAllBtn(): UiObject2? =
|
||||
protected fun IFlickerTestData.waitAndGetCancelAllBtn(): UiObject2? =
|
||||
device.wait(Until.findObject(By.text("Cancel All Bubble")), FIND_OBJECT_TIMEOUT)
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
|
||||
const val FIND_OBJECT_TIMEOUT = 2000L
|
||||
|
||||
@@ -25,9 +25,9 @@ import android.view.WindowManager
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.Parameterized
|
||||
@@ -45,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
open class DismissBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
|
||||
open class DismissBubbleScreen(flicker: FlickerTest) : BaseBubbleScreen(flicker) {
|
||||
|
||||
private val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||
private val displaySize = DisplayMetrics()
|
||||
@@ -72,7 +72,7 @@ open class DismissBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScree
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun testAppIsAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp) }
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
@@ -20,9 +20,9 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.Parameterized
|
||||
@@ -42,7 +42,7 @@ import org.junit.runners.Parameterized
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
open class ExpandBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
|
||||
open class ExpandBubbleScreen(flicker: FlickerTest) : BaseBubbleScreen(flicker) {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -64,6 +64,6 @@ open class ExpandBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun testAppIsAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ import android.view.WindowManager
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.Parameterized
|
||||
@@ -43,7 +43,7 @@ import org.junit.runners.Parameterized
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
|
||||
class LaunchBubbleFromLockScreen(flicker: FlickerTest) : BaseBubbleScreen(flicker) {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -88,7 +88,7 @@ class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScr
|
||||
@FlakyTest(bugId = 242088970)
|
||||
@Test
|
||||
fun testAppIsVisibleAtEnd() {
|
||||
testSpec.assertLayersEnd { this.isVisible(testApp) }
|
||||
flicker.assertLayersEnd { this.isVisible(testApp) }
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.android.wm.shell.flicker.bubble
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.Parameterized
|
||||
@@ -40,7 +40,7 @@ import org.junit.runners.Parameterized
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
open class LaunchBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
|
||||
open class LaunchBubbleScreen(flicker: FlickerTest) : BaseBubbleScreen(flicker) {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -59,6 +59,6 @@ open class LaunchBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen
|
||||
|
||||
@Test
|
||||
open fun testAppIsAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiObject2
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
@@ -45,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
open class MultiBubblesScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
|
||||
open class MultiBubblesScreen(flicker: FlickerTest) : BaseBubbleScreen(flicker) {
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
@@ -87,6 +87,6 @@ open class MultiBubblesScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun testAppIsAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.android.wm.shell.flicker.bubble
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.runner.RunWith
|
||||
@@ -30,8 +30,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FlakyTest(bugId = 217777115)
|
||||
class MultiBubblesScreenShellTransit(testSpec: FlickerTestParameter) :
|
||||
MultiBubblesScreen(testSpec) {
|
||||
class MultiBubblesScreenShellTransit(flicker: FlickerTest) : MultiBubblesScreen(flicker) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
|
||||
@@ -18,15 +18,15 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
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.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -59,7 +59,7 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@FlakyTest(bugId = 238367575)
|
||||
class AutoEnterPipOnGoToHomeTest(testSpec: FlickerTestParameter) : EnterPipTest(testSpec) {
|
||||
class AutoEnterPipOnGoToHomeTest(flicker: FlickerTest) : EnterPipTest(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -73,7 +73,7 @@ class AutoEnterPipOnGoToHomeTest(testSpec: FlickerTestParameter) : EnterPipTest(
|
||||
// close gracefully so that onActivityUnpinned() can be called before force exit
|
||||
pipApp.closePipWindow(wmHelper)
|
||||
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
RemoveAllTasksButHomeRule.removeAllTasksButHome()
|
||||
pipApp.exit(wmHelper)
|
||||
}
|
||||
@@ -83,7 +83,7 @@ class AutoEnterPipOnGoToHomeTest(testSpec: FlickerTestParameter) : EnterPipTest(
|
||||
@FlakyTest(bugId = 256863309)
|
||||
@Test
|
||||
override fun pipLayerReduces() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
pipLayerList.zipWithNext { previous, current ->
|
||||
current.visibleRegion.notBiggerThan(previous.visibleRegion.region)
|
||||
@@ -96,8 +96,8 @@ class AutoEnterPipOnGoToHomeTest(testSpec: FlickerTestParameter) : EnterPipTest(
|
||||
@Test
|
||||
fun pipLayerMovesTowardsRightBottomCorner() {
|
||||
// in gestural nav the swipe makes PiP first go upwards
|
||||
Assume.assumeFalse(testSpec.isGesturalNavigation)
|
||||
testSpec.assertLayers {
|
||||
Assume.assumeFalse(flicker.scenario.isGesturalNavigation)
|
||||
flicker.assertLayers {
|
||||
val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
// Pip animates towards the right bottom corner, but because it is being resized at the
|
||||
// same time, it is possible it shrinks first quickly below the default position and get
|
||||
@@ -112,7 +112,7 @@ class AutoEnterPipOnGoToHomeTest(testSpec: FlickerTestParameter) : EnterPipTest(
|
||||
@Test
|
||||
override fun focusChanges() {
|
||||
// in gestural nav the focus goes to different activity on swipe up
|
||||
Assume.assumeFalse(testSpec.isGesturalNavigation)
|
||||
Assume.assumeFalse(flicker.scenario.isGesturalNavigation)
|
||||
super.focusChanges()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
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.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -56,7 +56,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest(testSpec) {
|
||||
class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTest(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -68,7 +68,7 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
|
||||
pipApp.enableEnterPipOnUserLeaveHint()
|
||||
}
|
||||
teardown {
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
RemoveAllTasksButHomeRule.removeAllTasksButHome()
|
||||
pipApp.exit(wmHelper)
|
||||
}
|
||||
@@ -78,10 +78,10 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun pipAppLayerAlwaysVisible() {
|
||||
if (!testSpec.isGesturalNavigation) super.pipAppLayerAlwaysVisible()
|
||||
if (!flicker.scenario.isGesturalNavigation) super.pipAppLayerAlwaysVisible()
|
||||
else {
|
||||
// pip layer in gesture nav will disappear during transition
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(pipApp).then().isInvisible(pipApp).then().isVisible(pipApp)
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
|
||||
@Test
|
||||
override fun pipLayerReduces() {
|
||||
// in gestural nav the pip enters through alpha animation
|
||||
Assume.assumeFalse(testSpec.isGesturalNavigation)
|
||||
Assume.assumeFalse(flicker.scenario.isGesturalNavigation)
|
||||
super.pipLayerReduces()
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
|
||||
@Test
|
||||
override fun focusChanges() {
|
||||
// in gestural nav the focus goes to different activity on swipe up
|
||||
Assume.assumeFalse(testSpec.isGesturalNavigation)
|
||||
Assume.assumeFalse(flicker.scenario.isGesturalNavigation)
|
||||
super.focusChanges()
|
||||
}
|
||||
|
||||
@@ -112,11 +112,11 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun pipLayerRemainInsideVisibleBounds() {
|
||||
if (!testSpec.isGesturalNavigation) super.pipLayerRemainInsideVisibleBounds()
|
||||
if (!flicker.scenario.isGesturalNavigation) super.pipLayerRemainInsideVisibleBounds()
|
||||
else {
|
||||
// pip layer in gesture nav will disappear during transition
|
||||
testSpec.assertLayersStart { this.visibleRegion(pipApp).coversAtMost(displayBounds) }
|
||||
testSpec.assertLayersEnd { this.visibleRegion(pipApp).coversAtMost(displayBounds) }
|
||||
flicker.assertLayersStart { this.visibleRegion(pipApp).coversAtMost(displayBounds) }
|
||||
flicker.assertLayersEnd { this.visibleRegion(pipApp).coversAtMost(displayBounds) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,16 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -57,7 +57,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -68,7 +68,7 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
pipApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
teardown {
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
RemoveAllTasksButHomeRule.removeAllTasksButHome()
|
||||
pipApp.exit(wmHelper)
|
||||
}
|
||||
@@ -79,16 +79,14 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipAppWindowAlwaysVisible() {
|
||||
testSpec.assertWm { this.isAppWindowVisible(pipApp) }
|
||||
flicker.assertWm { this.isAppWindowVisible(pipApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks [pipApp] layer remains visible throughout the animation
|
||||
*/
|
||||
/** Checks [pipApp] layer remains visible throughout the animation */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipAppLayerAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(pipApp) }
|
||||
flicker.assertLayers { this.isVisible(pipApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +96,7 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipWindowRemainInsideVisibleBounds() {
|
||||
testSpec.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
flicker.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,14 +106,14 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerRemainInsideVisibleBounds() {
|
||||
testSpec.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/** Checks that the visible region of [pipApp] always reduces during the animation */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerReduces() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
pipLayerList.zipWithNext { previous, current ->
|
||||
current.visibleRegion.notBiggerThan(previous.visibleRegion.region)
|
||||
@@ -127,7 +125,7 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipWindowBecomesPinned() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
invoke("pipWindowIsNotPinned") { it.isNotPinned(pipApp) }
|
||||
.then()
|
||||
.invoke("pipWindowIsPinned") { it.isPinned(pipApp) }
|
||||
@@ -138,7 +136,7 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
isInvisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
@@ -152,21 +150,22 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun focusChanges() {
|
||||
testSpec.assertEventLog { this.focusChanges(pipApp.`package`, "NexusLauncherActivity") }
|
||||
flicker.assertEventLog { this.focusChanges(pipApp.`package`, "NexusLauncherActivity") }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,22 +19,22 @@ package com.android.wm.shell.flicker.pip
|
||||
import android.app.Activity
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.Pip.ACTION_ENTER_PIP
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.PortraitOnlyActivity.EXTRA_FIXED_ORIENTATION
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_PORTRAIT
|
||||
import org.junit.Assume
|
||||
@@ -51,32 +51,31 @@ import org.junit.runners.Parameterized
|
||||
* To run this test: `atest WMShellFlickerTests:EnterPipToOtherOrientationTest`
|
||||
*
|
||||
* Actions:
|
||||
* ```
|
||||
* Launch [testApp] on a fixed portrait orientation
|
||||
* Launch [pipApp] on a fixed landscape orientation
|
||||
* Broadcast action [ACTION_ENTER_PIP] to enter pip mode
|
||||
*
|
||||
* ```
|
||||
* Notes:
|
||||
* ```
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [PipTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
* ```
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterPipToOtherOrientationTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : PipTransition(testSpec) {
|
||||
class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val testApp = FixedOrientationAppHelper(instrumentation)
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_90)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_0)
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_90)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_0)
|
||||
|
||||
/**
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
setup {
|
||||
@@ -85,19 +84,18 @@ class EnterPipToOtherOrientationTest(
|
||||
|
||||
// Launch a portrait only app on the fullscreen stack
|
||||
testApp.launchViaIntent(
|
||||
wmHelper, stringExtras = mapOf(
|
||||
EXTRA_FIXED_ORIENTATION to ORIENTATION_PORTRAIT.toString()
|
||||
)
|
||||
wmHelper,
|
||||
stringExtras = mapOf(EXTRA_FIXED_ORIENTATION to ORIENTATION_PORTRAIT.toString())
|
||||
)
|
||||
// Launch the PiP activity fixed as landscape
|
||||
pipApp.launchViaIntent(
|
||||
wmHelper, stringExtras = mapOf(
|
||||
EXTRA_FIXED_ORIENTATION to ORIENTATION_LANDSCAPE.toString()
|
||||
)
|
||||
wmHelper,
|
||||
stringExtras =
|
||||
mapOf(EXTRA_FIXED_ORIENTATION to ORIENTATION_LANDSCAPE.toString())
|
||||
)
|
||||
}
|
||||
teardown {
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
RemoveAllTasksButHomeRule.removeAllTasksButHome()
|
||||
pipApp.exit(wmHelper)
|
||||
testApp.exit(wmHelper)
|
||||
@@ -107,7 +105,8 @@ class EnterPipToOtherOrientationTest(
|
||||
// in portrait
|
||||
broadcastActionTrigger.doAction(ACTION_ENTER_PIP)
|
||||
// during rotation the status bar becomes invisible and reappears at the end
|
||||
wmHelper.StateSyncBuilder()
|
||||
wmHelper
|
||||
.StateSyncBuilder()
|
||||
.withPipShown()
|
||||
.withNavOrTaskBarVisible()
|
||||
.withStatusBarVisible()
|
||||
@@ -116,21 +115,21 @@ class EnterPipToOtherOrientationTest(
|
||||
}
|
||||
|
||||
/**
|
||||
* This test is not compatible with Tablets. When using [Activity.setRequestedOrientation]
|
||||
* to fix a orientation, Tablets instead keep the same orientation and add letterboxes
|
||||
* This test is not compatible with Tablets. When using [Activity.setRequestedOrientation] to
|
||||
* fix a orientation, Tablets instead keep the same orientation and add letterboxes
|
||||
*/
|
||||
@Before
|
||||
fun setup() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentNameMatcher.NAV_BAR] has the correct position at
|
||||
* the start and end of the transition
|
||||
* Checks that the [ComponentNameMatcher.NAV_BAR] has the correct position at the start and end
|
||||
* of the transition
|
||||
*/
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() = testSpec.navBarLayerPositionAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = flicker.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks that all parts of the screen are covered at the start and end of the transition
|
||||
@@ -139,7 +138,7 @@ class EnterPipToOtherOrientationTest(
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun entireScreenCoveredAtStartAndEnd() = testSpec.entireScreenCovered(allStates = false)
|
||||
fun entireScreenCoveredAtStartAndEnd() = flicker.entireScreenCovered(allStates = false)
|
||||
|
||||
@FlakyTest(bugId = 251219769)
|
||||
@Test
|
||||
@@ -147,89 +146,65 @@ class EnterPipToOtherOrientationTest(
|
||||
super.entireScreenCovered()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks [pipApp] window remains visible and on top throughout the transition
|
||||
*/
|
||||
/** Checks [pipApp] window remains visible and on top throughout the transition */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppWindowIsAlwaysOnTop() {
|
||||
testSpec.assertWm {
|
||||
isAppWindowOnTop(pipApp)
|
||||
}
|
||||
flicker.assertWm { isAppWindowOnTop(pipApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] window is not visible at the start
|
||||
*/
|
||||
/** Checks that [testApp] window is not visible at the start */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun testAppWindowInvisibleOnStart() {
|
||||
testSpec.assertWmStart {
|
||||
isAppWindowInvisible(testApp)
|
||||
}
|
||||
flicker.assertWmStart { isAppWindowInvisible(testApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] window is visible at the end
|
||||
*/
|
||||
/** Checks that [testApp] window is visible at the end */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun testAppWindowVisibleOnEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isAppWindowVisible(testApp)
|
||||
}
|
||||
flicker.assertWmEnd { isAppWindowVisible(testApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] layer is not visible at the start
|
||||
*/
|
||||
/** Checks that [testApp] layer is not visible at the start */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun testAppLayerInvisibleOnStart() {
|
||||
testSpec.assertLayersStart {
|
||||
isInvisible(testApp)
|
||||
}
|
||||
flicker.assertLayersStart { isInvisible(testApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] layer is visible at the end
|
||||
*/
|
||||
/** Checks that [testApp] layer is visible at the end */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun testAppLayerVisibleOnEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(testApp)
|
||||
}
|
||||
flicker.assertLayersEnd { isVisible(testApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the visible region of [pipApp] covers the full display area at the start of
|
||||
* the transition
|
||||
* Checks that the visible region of [pipApp] covers the full display area at the start of the
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppLayerCoversFullScreenOnStart() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp).coversExactly(startingBounds)
|
||||
}
|
||||
flicker.assertLayersStart { visibleRegion(pipApp).coversExactly(startingBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the visible region of [testApp] plus the visible region of [pipApp]
|
||||
* cover the full display area at the end of the transition
|
||||
* Checks that the visible region of [testApp] plus the visible region of [pipApp] cover the
|
||||
* full display area at the end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun testAppPlusPipLayerCoversFullScreenOnEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
flicker.assertLayersEnd {
|
||||
val pipRegion = visibleRegion(pipApp).region
|
||||
visibleRegion(testApp)
|
||||
.plus(pipRegion)
|
||||
.coversExactly(endingBounds)
|
||||
visibleRegion(testApp).plus(pipRegion).coversExactly(endingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
@@ -239,16 +214,15 @@ class EnterPipToOtherOrientationTest(
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import org.junit.Test
|
||||
|
||||
/** Base class for pip expand tests */
|
||||
abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
protected val testApp = SimpleAppHelper(instrumentation)
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipAppWindowRemainInsideVisibleBounds() {
|
||||
testSpec.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
flicker.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipAppLayerRemainInsideVisibleBounds() {
|
||||
testSpec.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun showBothAppWindowsThenHidePip() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
// 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
|
||||
@@ -71,7 +71,7 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun showBothAppLayersThenHidePip() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
isVisible(testApp).isVisible(pipApp).then().isInvisible(testApp).isVisible(pipApp)
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun testPlusPipAppsCoverFullScreenAtStart() {
|
||||
testSpec.assertLayersStart {
|
||||
flicker.assertLayersStart {
|
||||
val pipRegion = visibleRegion(pipApp).region
|
||||
visibleRegion(testApp).plus(pipRegion).coversExactly(displayBounds)
|
||||
}
|
||||
@@ -96,14 +96,14 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipAppCoversFullScreenAtEnd() {
|
||||
testSpec.assertLayersEnd { visibleRegion(pipApp).coversExactly(displayBounds) }
|
||||
flicker.assertLayersEnd { visibleRegion(pipApp).coversExactly(displayBounds) }
|
||||
}
|
||||
|
||||
/** Checks that the visible region of [pipApp] always expands during the animation */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerExpands() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
pipLayerList.zipWithNext { previous, current ->
|
||||
current.visibleRegion.coversAtLeast(previous.visibleRegion.region)
|
||||
|
||||
@@ -17,20 +17,20 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher.Companion.LAUNCHER
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Test
|
||||
|
||||
/** Base class for exiting pip (closing pip window) without returning to the app */
|
||||
abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
abstract class ExitPipTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
setup { this.setRotation(testSpec.startRotation) }
|
||||
teardown { this.setRotation(Surface.ROTATION_0) }
|
||||
setup { this.setRotation(flicker.scenario.startRotation) }
|
||||
teardown { this.setRotation(PlatformConsts.Rotation.ROTATION_0) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,16 +45,16 @@ abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition
|
||||
// When Shell transition is enabled, we change the windowing mode at start, but
|
||||
// update the visibility after the transition is finished, so we can't check isNotPinned
|
||||
// and isAppWindowInvisible in the same assertion block.
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.invoke("hasPipWindow") {
|
||||
it.isPinned(pipApp).isAppWindowVisible(pipApp).isAppWindowOnTop(pipApp)
|
||||
}
|
||||
.then()
|
||||
.invoke("!hasPipWindow") { it.isNotPinned(pipApp).isAppWindowNotOnTop(pipApp) }
|
||||
}
|
||||
testSpec.assertWmEnd { isAppWindowInvisible(pipApp) }
|
||||
flicker.assertWmEnd { isAppWindowInvisible(pipApp) }
|
||||
} else {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.invoke("hasPipWindow") { it.isPinned(pipApp).isAppWindowVisible(pipApp) }
|
||||
.then()
|
||||
.invoke("!hasPipWindow") { it.isNotPinned(pipApp).isAppWindowInvisible(pipApp) }
|
||||
@@ -69,7 +69,7 @@ abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(pipApp)
|
||||
.isVisible(LAUNCHER)
|
||||
.then()
|
||||
|
||||
@@ -18,12 +18,12 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -36,30 +36,29 @@ import org.junit.runners.Parameterized
|
||||
* To run this test: `atest WMShellFlickerTests:ExitPipViaExpandButtonClickTest`
|
||||
*
|
||||
* Actions:
|
||||
* ```
|
||||
* Launch an app in pip mode [pipApp],
|
||||
* Launch another full screen mode [testApp]
|
||||
* Expand [pipApp] app to full screen by clicking on the pip window and
|
||||
* then on the expand button
|
||||
*
|
||||
* ```
|
||||
* Notes:
|
||||
* ```
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [PipTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
* ```
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExitPipViaExpandButtonClickTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : ExitPipToAppTransition(testSpec) {
|
||||
class ExitPipViaExpandButtonClickTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
|
||||
|
||||
/**
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
@@ -70,34 +69,29 @@ class ExitPipViaExpandButtonClickTest(
|
||||
// This will bring PipApp to fullscreen
|
||||
pipApp.expandPipWindowToApp(wmHelper)
|
||||
// Wait until the other app is no longer visible
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withWindowSurfaceDisappeared(testApp)
|
||||
.waitForAndVerify()
|
||||
wmHelper.StateSyncBuilder().withWindowSurfaceDisappeared(testApp).waitForAndVerify()
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 197726610)
|
||||
@Test
|
||||
override fun pipLayerExpands() = super.pipLayerExpands()
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 197726610) @Test override fun pipLayerExpands() = super.pipLayerExpands()
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -57,7 +57,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExitPipViaIntentTest(testSpec: FlickerTestParameter) : ExitPipToAppTransition(testSpec) {
|
||||
class ExitPipViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
|
||||
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -74,10 +74,8 @@ class ExitPipViaIntentTest(testSpec: FlickerTestParameter) : ExitPipToAppTransit
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -113,14 +111,15 @@ class ExitPipViaIntentTest(testSpec: FlickerTestParameter) : ExitPipToAppTransit
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -54,7 +54,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExitPipWithDismissButtonTest(testSpec: FlickerTestParameter) : ExitPipTransition(testSpec) {
|
||||
class ExitPipWithDismissButtonTest(flicker: FlickerTest) : ExitPipTransition(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -69,21 +69,22 @@ class ExitPipWithDismissButtonTest(testSpec: FlickerTestParameter) : ExitPipTran
|
||||
@Presubmit
|
||||
@Test
|
||||
fun focusChanges() {
|
||||
testSpec.assertEventLog { this.focusChanges("PipMenuView", "NexusLauncherActivity") }
|
||||
flicker.assertEventLog { this.focusChanges("PipMenuView", "NexusLauncherActivity") }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -54,7 +54,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExitPipWithSwipeDownTest(testSpec: FlickerTestParameter) : ExitPipTransition(testSpec) {
|
||||
class ExitPipWithSwipeDownTest(flicker: FlickerTest) : ExitPipTransition(flicker) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
@@ -64,7 +64,7 @@ class ExitPipWithSwipeDownTest(testSpec: FlickerTestParameter) : ExitPipTransiti
|
||||
val pipCenterY = pipRegion.centerY()
|
||||
val displayCenterX = device.displayWidth / 2
|
||||
val barComponent =
|
||||
if (testSpec.isTablet) {
|
||||
if (flicker.scenario.isTablet) {
|
||||
ComponentNameMatcher.TASK_BAR
|
||||
} else {
|
||||
ComponentNameMatcher.NAV_BAR
|
||||
@@ -92,21 +92,22 @@ class ExitPipWithSwipeDownTest(testSpec: FlickerTestParameter) : ExitPipTransiti
|
||||
@Presubmit
|
||||
@Test
|
||||
fun focusDoesNotChange() {
|
||||
testSpec.assertEventLog { this.focusDoesNotChange() }
|
||||
flicker.assertEventLog { this.focusDoesNotChange() }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -36,28 +36,27 @@ import org.junit.runners.Parameterized
|
||||
* To run this test: `atest WMShellFlickerTests:ExpandPipOnDoubleClickTest`
|
||||
*
|
||||
* Actions:
|
||||
* ```
|
||||
* Launch an app in pip mode [pipApp],
|
||||
* Expand [pipApp] app to its maximum pip size by double clicking on it
|
||||
*
|
||||
* ```
|
||||
* Notes:
|
||||
* ```
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [PipTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
* ```
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
class ExpandPipOnDoubleClickTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
transitions {
|
||||
pipApp.doubleClickPipWindow(wmHelper)
|
||||
}
|
||||
}
|
||||
get() = buildTransition { transitions { pipApp.doubleClickPipWindow(wmHelper) } }
|
||||
|
||||
/**
|
||||
* Checks that the pip app window remains inside the display bounds throughout the whole
|
||||
@@ -66,9 +65,7 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun pipWindowRemainInsideVisibleBounds() {
|
||||
testSpec.assertWmVisibleRegion(pipApp) {
|
||||
coversAtMost(displayBounds)
|
||||
}
|
||||
flicker.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,40 +75,28 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun pipLayerRemainInsideVisibleBounds() {
|
||||
testSpec.assertLayersVisibleRegion(pipApp) {
|
||||
coversAtMost(displayBounds)
|
||||
}
|
||||
flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks [pipApp] window remains visible throughout the animation
|
||||
*/
|
||||
/** Checks [pipApp] window remains visible throughout the animation */
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun pipWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
isAppWindowVisible(pipApp)
|
||||
}
|
||||
flicker.assertWm { isAppWindowVisible(pipApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks [pipApp] layer remains visible throughout the animation
|
||||
*/
|
||||
/** Checks [pipApp] layer remains visible throughout the animation */
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun pipLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
isVisible(pipApp)
|
||||
}
|
||||
flicker.assertLayers { isVisible(pipApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the visible region of [pipApp] always expands during the animation
|
||||
*/
|
||||
/** Checks that the visible region of [pipApp] always expands during the animation */
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun pipLayerExpands() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
pipLayerList.zipWithNext { previous, current ->
|
||||
current.visibleRegion.coversAtLeast(previous.visibleRegion.region)
|
||||
@@ -122,7 +107,7 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun pipSameAspectRatio() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
pipLayerList.zipWithNext { previous, current ->
|
||||
current.visibleRegion.isSameAspectRatio(previous.visibleRegion)
|
||||
@@ -130,37 +115,25 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks [pipApp] window remains pinned throughout the animation
|
||||
*/
|
||||
/** Checks [pipApp] window remains pinned throughout the animation */
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun windowIsAlwaysPinned() {
|
||||
testSpec.assertWm {
|
||||
this.invoke("hasPipWindow") { it.isPinned(pipApp) }
|
||||
}
|
||||
flicker.assertWm { this.invoke("hasPipWindow") { it.isPinned(pipApp) } }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks [ComponentMatcher.LAUNCHER] layer remains visible throughout the animation
|
||||
*/
|
||||
/** Checks [ComponentMatcher.LAUNCHER] layer remains visible throughout the animation */
|
||||
@FlakyTest(bugId = 249308003)
|
||||
@Test
|
||||
fun launcherIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
flicker.assertLayers { isVisible(ComponentNameMatcher.LAUNCHER) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the focus doesn't change between windows during the transition
|
||||
*/
|
||||
/** Checks that the focus doesn't change between windows during the transition */
|
||||
@FlakyTest(bugId = 216306753)
|
||||
@Test
|
||||
fun focusDoesNotChange() {
|
||||
testSpec.assertEventLog {
|
||||
this.focusDoesNotChange()
|
||||
}
|
||||
flicker.assertEventLog { this.focusDoesNotChange() }
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 216306753)
|
||||
@@ -233,16 +206,15 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,40 +17,32 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test expanding a pip window via pinch out gesture.
|
||||
*/
|
||||
/** Test expanding a pip window via pinch out gesture. */
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExpandPipOnPinchOpenTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
class ExpandPipOnPinchOpenTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
transitions {
|
||||
pipApp.pinchOpenPipWindow(wmHelper, 0.4f, 30)
|
||||
}
|
||||
}
|
||||
get() = buildTransition { transitions { pipApp.pinchOpenPipWindow(wmHelper, 0.4f, 30) } }
|
||||
|
||||
/**
|
||||
* Checks that the visible region area of [pipApp] always increases during the animation.
|
||||
*/
|
||||
/** Checks that the visible region area of [pipApp] always increases during the animation. */
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun pipLayerAreaIncreases() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
pipLayerList.zipWithNext { previous, current ->
|
||||
previous.visibleRegion.notBiggerThan(current.visibleRegion.region)
|
||||
@@ -62,16 +54,15 @@ class ExpandPipOnPinchOpenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.Direction
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -36,71 +36,56 @@ import org.junit.runners.Parameterized
|
||||
* To run this test: `atest WMShellFlickerTests:MovePipUpShelfHeightChangeTest`
|
||||
*
|
||||
* Actions:
|
||||
* ```
|
||||
* Launch [pipApp] in pip mode
|
||||
* Press home
|
||||
* Launch [testApp]
|
||||
* Check if pip window moves down (visually)
|
||||
*
|
||||
* ```
|
||||
* Notes:
|
||||
* ```
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [PipTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
* ```
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class MovePipDownShelfHeightChangeTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : MovePipShelfHeightTransition(testSpec) {
|
||||
// @Before
|
||||
// fun before() {
|
||||
// Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
// }
|
||||
|
||||
/**
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
class MovePipDownShelfHeightChangeTest(flicker: FlickerTest) :
|
||||
MovePipShelfHeightTransition(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
teardown {
|
||||
tapl.pressHome()
|
||||
testApp.exit(wmHelper)
|
||||
}
|
||||
transitions {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
transitions { testApp.launchViaIntent(wmHelper) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the visible region of [pipApp] window always moves down during the animation.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipWindowMovesDown() = pipWindowMoves(Direction.DOWN)
|
||||
/** Checks that the visible region of [pipApp] window always moves down during the animation. */
|
||||
@Presubmit @Test fun pipWindowMovesDown() = pipWindowMoves(Direction.DOWN)
|
||||
|
||||
/**
|
||||
* Checks that the visible region of [pipApp] layer always moves down during the animation.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipLayerMovesDown() = pipLayerMoves(Direction.DOWN)
|
||||
/** Checks that the visible region of [pipApp] layer always moves down during the animation. */
|
||||
@Presubmit @Test fun pipLayerMovesDown() = pipLayerMoves(Direction.DOWN)
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,29 +17,28 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
|
||||
import com.android.server.wm.flicker.traces.region.RegionSubject
|
||||
import com.android.wm.shell.flicker.Direction
|
||||
import org.junit.Test
|
||||
|
||||
/** Base class for pip tests with Launcher shelf height change */
|
||||
abstract class MovePipShelfHeightTransition(testSpec: FlickerTestParameter) :
|
||||
PipTransition(testSpec) {
|
||||
abstract class MovePipShelfHeightTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
protected val testApp = FixedOrientationAppHelper(instrumentation)
|
||||
|
||||
/** Checks [pipApp] window remains visible throughout the animation */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm { isAppWindowVisible(pipApp) }
|
||||
flicker.assertWm { isAppWindowVisible(pipApp) }
|
||||
}
|
||||
|
||||
/** Checks [pipApp] layer remains visible throughout the animation */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers { isVisible(pipApp) }
|
||||
flicker.assertLayers { isVisible(pipApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,7 +48,7 @@ abstract class MovePipShelfHeightTransition(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipWindowRemainInsideVisibleBounds() {
|
||||
testSpec.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
flicker.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,7 +58,7 @@ abstract class MovePipShelfHeightTransition(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerRemainInsideVisibleBounds() {
|
||||
testSpec.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +66,7 @@ abstract class MovePipShelfHeightTransition(testSpec: FlickerTestParameter) :
|
||||
* during the animation.
|
||||
*/
|
||||
protected fun pipWindowMoves(direction: Direction) {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
val pipWindowFrameList =
|
||||
this.windowStates { pipApp.windowMatchesAnyOf(it) && it.isVisible }.map { it.frame }
|
||||
when (direction) {
|
||||
@@ -83,7 +82,7 @@ abstract class MovePipShelfHeightTransition(testSpec: FlickerTestParameter) :
|
||||
* during the animation.
|
||||
*/
|
||||
protected fun pipLayerMoves(direction: Direction) {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
val pipLayerRegionList =
|
||||
this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
|
||||
.map { it.visibleRegion }
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.Direction
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -36,68 +36,55 @@ import org.junit.runners.Parameterized
|
||||
* To run this test: `atest WMShellFlickerTests:MovePipDownShelfHeightChangeTest`
|
||||
*
|
||||
* Actions:
|
||||
* ```
|
||||
* Launch [pipApp] in pip mode
|
||||
* Launch [testApp]
|
||||
* Press home
|
||||
* Check if pip window moves up (visually)
|
||||
*
|
||||
* ```
|
||||
* Notes:
|
||||
* ```
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [PipTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
* ```
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class MovePipUpShelfHeightChangeTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : MovePipShelfHeightTransition(testSpec) {
|
||||
/**
|
||||
* Defines the transition used to run the test
|
||||
*/
|
||||
open class MovePipUpShelfHeightChangeTest(flicker: FlickerTest) :
|
||||
MovePipShelfHeightTransition(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition() {
|
||||
setup {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
get() =
|
||||
buildTransition() {
|
||||
setup { testApp.launchViaIntent(wmHelper) }
|
||||
transitions { tapl.pressHome() }
|
||||
teardown { testApp.exit(wmHelper) }
|
||||
}
|
||||
transitions {
|
||||
tapl.pressHome()
|
||||
}
|
||||
teardown {
|
||||
testApp.exit(wmHelper)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the visible region of [pipApp] window always moves up during the animation.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipWindowMovesUp() = pipWindowMoves(Direction.UP)
|
||||
/** Checks that the visible region of [pipApp] window always moves up during the animation. */
|
||||
@Presubmit @Test fun pipWindowMovesUp() = pipWindowMoves(Direction.UP)
|
||||
|
||||
/**
|
||||
* Checks that the visible region of [pipApp] layer always moves up during the animation.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipLayerMovesUp() = pipLayerMoves(Direction.UP)
|
||||
/** Checks that the visible region of [pipApp] layer always moves up during the animation. */
|
||||
@Presubmit @Test fun pipLayerMovesUp() = pipLayerMoves(Direction.UP)
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume.assumeFalse
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -41,7 +41,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
open class PipKeyboardTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val imeApp = ImeAppHelper(instrumentation)
|
||||
|
||||
@Before
|
||||
@@ -54,11 +54,11 @@ open class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
imeApp.launchViaIntent(wmHelper)
|
||||
setRotation(testSpec.startRotation)
|
||||
setRotation(flicker.scenario.startRotation)
|
||||
}
|
||||
teardown {
|
||||
imeApp.exit(wmHelper)
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
}
|
||||
transitions {
|
||||
// open the soft keyboard
|
||||
@@ -74,8 +74,8 @@ open class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipInVisibleBounds() {
|
||||
testSpec.assertWmVisibleRegion(pipApp) {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
flicker.assertWmVisibleRegion(pipApp) {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(flicker.scenario.startRotation)
|
||||
coversAtMost(displayBounds)
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ open class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipIsAboveAppWindow() {
|
||||
testSpec.assertWmTag(TAG_IME_VISIBLE) { isAboveWindow(ComponentNameMatcher.IME, pipApp) }
|
||||
flicker.assertWmTag(TAG_IME_VISIBLE) { isAboveWindow(ComponentNameMatcher.IME, pipApp) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -92,9 +92,10 @@ open class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
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.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -33,7 +33,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class PipKeyboardTestShellTransit(testSpec: FlickerTestParameter) : PipKeyboardTest(testSpec) {
|
||||
class PipKeyboardTestShellTransit(flicker: FlickerTest) : PipKeyboardTest(flicker) {
|
||||
|
||||
@Before
|
||||
override fun before() {
|
||||
|
||||
@@ -18,16 +18,15 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -45,7 +44,7 @@ import org.junit.runners.Parameterized
|
||||
* ```
|
||||
* Launch a [pipApp] in pip mode
|
||||
* Launch another app [fixedApp] (appears below pip)
|
||||
* Rotate the screen from [testSpec.startRotation] to [testSpec.endRotation]
|
||||
* Rotate the screen from [flicker.scenario.startRotation] to [flicker.scenario.endRotation]
|
||||
* (usually, 0->90 and 90->0)
|
||||
* ```
|
||||
* Notes:
|
||||
@@ -62,10 +61,10 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
open class PipRotationTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
private val screenBoundsStart = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
private val screenBoundsEnd = WindowUtils.getDisplayBounds(testSpec.endRotation)
|
||||
private val screenBoundsStart = WindowUtils.getDisplayBounds(flicker.scenario.startRotation)
|
||||
private val screenBoundsEnd = WindowUtils.getDisplayBounds(flicker.scenario.endRotation)
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
@@ -76,9 +75,9 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
setRotation(testSpec.startRotation)
|
||||
setRotation(flicker.scenario.startRotation)
|
||||
}
|
||||
transitions { setRotation(testSpec.endRotation) }
|
||||
transitions { setRotation(flicker.scenario.endRotation) }
|
||||
}
|
||||
|
||||
/** Checks the position of the navigation bar at the start and end of the transition */
|
||||
@@ -90,14 +89,14 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun fixedAppLayer_StartingBounds() {
|
||||
testSpec.assertLayersStart { visibleRegion(testApp).coversAtMost(screenBoundsStart) }
|
||||
flicker.assertLayersStart { visibleRegion(testApp).coversAtMost(screenBoundsStart) }
|
||||
}
|
||||
|
||||
/** Checks that [testApp] layer is within [screenBoundsEnd] at the end of the transition */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun fixedAppLayer_EndingBounds() {
|
||||
testSpec.assertLayersEnd { visibleRegion(testApp).coversAtMost(screenBoundsEnd) }
|
||||
flicker.assertLayersEnd { visibleRegion(testApp).coversAtMost(screenBoundsEnd) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +106,7 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayers_StartingBounds() {
|
||||
testSpec.assertLayersStart {
|
||||
flicker.assertLayersStart {
|
||||
visibleRegion(testApp.or(pipApp)).coversExactly(screenBoundsStart)
|
||||
}
|
||||
}
|
||||
@@ -119,14 +118,12 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayers_EndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(testApp.or(pipApp)).coversExactly(screenBoundsEnd)
|
||||
}
|
||||
flicker.assertLayersEnd { visibleRegion(testApp.or(pipApp)).coversExactly(screenBoundsEnd) }
|
||||
}
|
||||
|
||||
/** Checks that [pipApp] layer is within [screenBoundsStart] at the start of the transition */
|
||||
private fun pipLayerRotates_StartingBounds_internal() {
|
||||
testSpec.assertLayersStart { visibleRegion(pipApp).coversAtMost(screenBoundsStart) }
|
||||
flicker.assertLayersStart { visibleRegion(pipApp).coversAtMost(screenBoundsStart) }
|
||||
}
|
||||
|
||||
/** Checks that [pipApp] layer is within [screenBoundsStart] at the start of the transition */
|
||||
@@ -140,7 +137,7 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipLayerRotates_EndingBounds() {
|
||||
testSpec.assertLayersEnd { visibleRegion(pipApp).coversAtMost(screenBoundsEnd) }
|
||||
flicker.assertLayersEnd { visibleRegion(pipApp).coversAtMost(screenBoundsEnd) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +146,7 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipIsAboveFixedAppWindow_Start() {
|
||||
testSpec.assertWmStart { isAboveWindow(pipApp, testApp) }
|
||||
flicker.assertWmStart { isAboveWindow(pipApp, testApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,7 +155,7 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipIsAboveFixedAppWindow_End() {
|
||||
testSpec.assertWmEnd { isAboveWindow(pipApp, testApp) }
|
||||
flicker.assertWmEnd { isAboveWindow(pipApp, testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@@ -171,16 +168,13 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0, Surface.ROTATION_90)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.rotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -38,7 +38,7 @@ import org.junit.runners.Parameterized
|
||||
* ```
|
||||
* Launch a [pipApp] in pip mode
|
||||
* Launch another app [fixedApp] (appears below pip)
|
||||
* Rotate the screen from [testSpec.startRotation] to [testSpec.endRotation]
|
||||
* Rotate the screen from [flicker.scenario.startRotation] to [flicker.scenario.endRotation]
|
||||
* (usually, 0->90 and 90->0)
|
||||
* ```
|
||||
* Notes:
|
||||
@@ -56,7 +56,7 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@FlakyTest(bugId = 239575053)
|
||||
class PipRotationTest_ShellTransit(testSpec: FlickerTestParameter) : PipRotationTest(testSpec) {
|
||||
class PipRotationTest_ShellTransit(flicker: FlickerTest) : PipRotationTest(flicker) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
|
||||
@@ -18,19 +18,19 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.Intent
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.PipAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.BaseTest
|
||||
|
||||
abstract class PipTransition(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
abstract class PipTransition(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
protected val pipApp = PipAppHelper(instrumentation)
|
||||
protected val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
protected val displayBounds = WindowUtils.getDisplayBounds(flicker.scenario.startRotation)
|
||||
protected val broadcastActionTrigger = BroadcastActionTrigger(instrumentation)
|
||||
|
||||
// Helper class to process test actions by broadcast.
|
||||
@@ -67,12 +67,12 @@ abstract class PipTransition(testSpec: FlickerTestParameter) : BaseTest(testSpec
|
||||
): FlickerBuilder.() -> Unit {
|
||||
return {
|
||||
setup {
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
removeAllTasksButHome()
|
||||
pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = stringExtras)
|
||||
}
|
||||
teardown {
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
removeAllTasksButHome()
|
||||
pipApp.exit(wmHelper)
|
||||
}
|
||||
|
||||
@@ -20,19 +20,19 @@ import android.app.Activity
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.PortraitOnlyActivity.EXTRA_FIXED_ORIENTATION
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
@@ -43,20 +43,18 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test exiting Pip with orientation changes.
|
||||
* To run this test: `atest WMShellFlickerTests:SetRequestedOrientationWhilePinnedTest`
|
||||
* Test exiting Pip with orientation changes. To run this test: `atest
|
||||
* WMShellFlickerTests:SetRequestedOrientationWhilePinnedTest`
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class SetRequestedOrientationWhilePinnedTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : PipTransition(testSpec) {
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_0)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_90)
|
||||
open class SetRequestedOrientationWhilePinnedTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_0)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_90)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
setup {
|
||||
@@ -64,30 +62,35 @@ open class SetRequestedOrientationWhilePinnedTest(
|
||||
device.wakeUpAndGoToHomeScreen()
|
||||
|
||||
// Launch the PiP activity fixed as landscape.
|
||||
pipApp.launchViaIntent(wmHelper, stringExtras = mapOf(
|
||||
EXTRA_FIXED_ORIENTATION to ORIENTATION_LANDSCAPE.toString()))
|
||||
pipApp.launchViaIntent(
|
||||
wmHelper,
|
||||
stringExtras =
|
||||
mapOf(EXTRA_FIXED_ORIENTATION to ORIENTATION_LANDSCAPE.toString())
|
||||
)
|
||||
// Enter PiP.
|
||||
broadcastActionTrigger.doAction(ActivityOptions.Pip.ACTION_ENTER_PIP)
|
||||
// System bar may fade out during fixed rotation.
|
||||
wmHelper.StateSyncBuilder()
|
||||
wmHelper
|
||||
.StateSyncBuilder()
|
||||
.withPipShown()
|
||||
.withRotation(Surface.ROTATION_0)
|
||||
.withRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
.withNavOrTaskBarVisible()
|
||||
.withStatusBarVisible()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
teardown {
|
||||
pipApp.exit(wmHelper)
|
||||
setRotation(Surface.ROTATION_0)
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_0)
|
||||
removeAllTasksButHome()
|
||||
}
|
||||
transitions {
|
||||
// Launch the activity back into fullscreen and ensure that it is now in landscape
|
||||
pipApp.launchViaIntent(wmHelper)
|
||||
// System bar may fade out during fixed rotation.
|
||||
wmHelper.StateSyncBuilder()
|
||||
wmHelper
|
||||
.StateSyncBuilder()
|
||||
.withFullScreenApp(pipApp)
|
||||
.withRotation(Surface.ROTATION_90)
|
||||
.withRotation(PlatformConsts.Rotation.ROTATION_90)
|
||||
.withNavOrTaskBarVisible()
|
||||
.withStatusBarVisible()
|
||||
.waitForAndVerify()
|
||||
@@ -95,34 +98,32 @@ open class SetRequestedOrientationWhilePinnedTest(
|
||||
}
|
||||
|
||||
/**
|
||||
* This test is not compatible with Tablets. When using [Activity.setRequestedOrientation]
|
||||
* to fix a orientation, Tablets instead keep the same orientation and add letterboxes
|
||||
* This test is not compatible with Tablets. When using [Activity.setRequestedOrientation] to
|
||||
* fix a orientation, Tablets instead keep the same orientation and add letterboxes
|
||||
*/
|
||||
@Before
|
||||
fun setup() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun displayEndsAt90Degrees() {
|
||||
testSpec.assertWmEnd {
|
||||
hasRotation(Surface.ROTATION_90)
|
||||
}
|
||||
flicker.assertWmEnd { hasRotation(PlatformConsts.Rotation.ROTATION_90) }
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
@@ -130,23 +131,17 @@ open class SetRequestedOrientationWhilePinnedTest(
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipWindowInsideDisplay() {
|
||||
testSpec.assertWmStart {
|
||||
visibleRegion(pipApp).coversAtMost(startingBounds)
|
||||
}
|
||||
flicker.assertWmStart { visibleRegion(pipApp).coversAtMost(startingBounds) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppShowsOnTop() {
|
||||
testSpec.assertWmEnd {
|
||||
isAppWindowOnTop(pipApp)
|
||||
}
|
||||
flicker.assertWmEnd { isAppWindowOnTop(pipApp) }
|
||||
}
|
||||
|
||||
private fun pipLayerInsideDisplay_internal() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp).coversAtMost(startingBounds)
|
||||
}
|
||||
flicker.assertLayersStart { visibleRegion(pipApp).coversAtMost(startingBounds) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@@ -166,40 +161,35 @@ open class SetRequestedOrientationWhilePinnedTest(
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(pipApp)
|
||||
}
|
||||
flicker.assertWm { this.isAppWindowVisible(pipApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipAppLayerCoversFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(pipApp).coversExactly(endingBounds)
|
||||
}
|
||||
flicker.assertLayersEnd { visibleRegion(pipApp).coversExactly(endingBounds) }
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,10 @@ import androidx.test.uiautomator.UiDevice
|
||||
import org.junit.Before
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
abstract class PipTestBase(protected val rotationName: String, protected val rotation: Int) {
|
||||
abstract class PipTestBase(
|
||||
protected val rotationName: String,
|
||||
protected val rotation: Int
|
||||
) {
|
||||
val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
val uiDevice = UiDevice.getInstance(instrumentation)
|
||||
val packageManager: PackageManager = instrumentation.context.packageManager
|
||||
|
||||
@@ -20,10 +20,10 @@ import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.EdgeExtensionComponentMatcher
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
@@ -49,7 +49,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class CopyContentInSplit(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
private val textEditApp = SplitScreenUtils.getIme(instrumentation)
|
||||
private val MagnifierLayer = ComponentNameMatcher("", "magnifier surface bbq wrapper#")
|
||||
private val PopupWindowLayer = ComponentNameMatcher("", "PopupWindow:")
|
||||
@@ -72,29 +72,29 @@ class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() {
|
||||
testSpec.appWindowIsVisibleAtStart(primaryApp)
|
||||
testSpec.appWindowIsVisibleAtStart(textEditApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtStart()
|
||||
flicker.appWindowIsVisibleAtStart(primaryApp)
|
||||
flicker.appWindowIsVisibleAtStart(textEditApp)
|
||||
flicker.splitScreenDividerIsVisibleAtStart()
|
||||
|
||||
testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
testSpec.appWindowIsVisibleAtEnd(textEditApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtEnd()
|
||||
flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
flicker.appWindowIsVisibleAtEnd(textEditApp)
|
||||
flicker.splitScreenDividerIsVisibleAtEnd()
|
||||
|
||||
// The validation of copied text is already done in SplitScreenUtils.copyContentInSplit()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerKeepVisible() = testSpec.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
fun splitScreenDividerKeepVisible() = flicker.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
|
||||
@Presubmit @Test fun primaryAppLayerKeepVisible() = testSpec.layerKeepVisible(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerKeepVisible() = flicker.layerKeepVisible(primaryApp)
|
||||
|
||||
@Presubmit @Test fun textEditAppLayerKeepVisible() = testSpec.layerKeepVisible(textEditApp)
|
||||
@Presubmit @Test fun textEditAppLayerKeepVisible() = flicker.layerKeepVisible(textEditApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsKeepVisible() =
|
||||
testSpec.splitAppLayerBoundsKeepVisible(
|
||||
flicker.splitAppLayerBoundsKeepVisible(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
@@ -103,21 +103,18 @@ class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
fun textEditAppBoundsKeepVisible() =
|
||||
testSpec.splitAppLayerBoundsKeepVisible(
|
||||
flicker.splitAppLayerBoundsKeepVisible(
|
||||
textEditApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
)
|
||||
|
||||
@Presubmit @Test fun primaryAppWindowKeepVisible() = testSpec.appWindowKeepVisible(primaryApp)
|
||||
@Presubmit @Test fun primaryAppWindowKeepVisible() = flicker.appWindowKeepVisible(primaryApp)
|
||||
|
||||
@Presubmit @Test fun textEditAppWindowKeepVisible() = testSpec.appWindowKeepVisible(textEditApp)
|
||||
@Presubmit @Test fun textEditAppWindowKeepVisible() = flicker.appWindowKeepVisible(textEditApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
@Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -164,15 +161,18 @@ class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testS
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
ignoreLayers = listOf(
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT,
|
||||
ComponentNameMatcher.IME_SNAPSHOT,
|
||||
EdgeExtensionComponentMatcher(),
|
||||
MagnifierLayer,
|
||||
PopupWindowLayer))
|
||||
ignoreLayers =
|
||||
listOf(
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT,
|
||||
ComponentNameMatcher.IME_SNAPSHOT,
|
||||
EdgeExtensionComponentMatcher(),
|
||||
MagnifierLayer,
|
||||
PopupWindowLayer
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,9 +185,8 @@ class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testS
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests()
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesInvisible
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
@@ -49,54 +49,62 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class DismissSplitScreenByDivider(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp)
|
||||
}
|
||||
setup { SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp) }
|
||||
transitions {
|
||||
if (tapl.isTablet) {
|
||||
SplitScreenUtils.dragDividerToDismissSplit(device, wmHelper,
|
||||
dragToRight = false, dragToBottom = true)
|
||||
SplitScreenUtils.dragDividerToDismissSplit(
|
||||
device,
|
||||
wmHelper,
|
||||
dragToRight = false,
|
||||
dragToBottom = true
|
||||
)
|
||||
} else {
|
||||
SplitScreenUtils.dragDividerToDismissSplit(device, wmHelper,
|
||||
dragToRight = true, dragToBottom = true)
|
||||
SplitScreenUtils.dragDividerToDismissSplit(
|
||||
device,
|
||||
wmHelper,
|
||||
dragToRight = true,
|
||||
dragToBottom = true
|
||||
)
|
||||
}
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withFullScreenApp(secondaryApp)
|
||||
.waitForAndVerify()
|
||||
wmHelper.StateSyncBuilder().withFullScreenApp(secondaryApp).waitForAndVerify()
|
||||
}
|
||||
}
|
||||
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenDismissed(primaryApp, secondaryApp, toHome = false)
|
||||
fun cujCompleted() = flicker.splitScreenDismissed(primaryApp, secondaryApp, toHome = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesInvisible() = testSpec.splitScreenDividerBecomesInvisible()
|
||||
fun splitScreenDividerBecomesInvisible() = flicker.splitScreenDividerBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerBecomesInvisible() = testSpec.layerBecomesInvisible(primaryApp)
|
||||
fun primaryAppLayerBecomesInvisible() = flicker.layerBecomesInvisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(secondaryApp)
|
||||
fun secondaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible(
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
fun primaryAppBoundsBecomesInvisible() =
|
||||
flicker.splitAppLayerBoundsBecomesInvisible(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsFullscreenAtEnd() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(secondaryApp)
|
||||
.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
@@ -109,7 +117,7 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
.contains(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.invoke("secondaryAppBoundsIsFullscreenAtEnd") {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.endRotation)
|
||||
val displayBounds = WindowUtils.getDisplayBounds(flicker.scenario.endRotation)
|
||||
it.visibleRegion(secondaryApp).coversExactly(displayBounds)
|
||||
}
|
||||
}
|
||||
@@ -117,35 +125,29 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowBecomesInvisible() = testSpec.appWindowBecomesInvisible(primaryApp)
|
||||
fun primaryAppWindowBecomesInvisible() = flicker.appWindowBecomesInvisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
fun secondaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 206753786)
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -156,26 +158,22 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -192,8 +190,8 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.wm.shell.flicker.appWindowBecomesInvisible
|
||||
import com.android.wm.shell.flicker.layerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesInvisible
|
||||
@@ -44,89 +44,81 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class DismissSplitScreenByGoHome(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SplitScreenBase(testSpec) {
|
||||
class DismissSplitScreenByGoHome(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp)
|
||||
}
|
||||
setup { SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp) }
|
||||
transitions {
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
wmHelper.StateSyncBuilder().withHomeActivityVisible().waitForAndVerify()
|
||||
}
|
||||
}
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenDismissed(primaryApp, secondaryApp, toHome = true)
|
||||
fun cujCompleted() = flicker.splitScreenDismissed(primaryApp, secondaryApp, toHome = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesInvisible() = testSpec.splitScreenDividerBecomesInvisible()
|
||||
fun splitScreenDividerBecomesInvisible() = flicker.splitScreenDividerBecomesInvisible()
|
||||
|
||||
@FlakyTest(bugId = 241525302)
|
||||
@Test
|
||||
fun primaryAppLayerBecomesInvisible() = testSpec.layerBecomesInvisible(primaryApp)
|
||||
fun primaryAppLayerBecomesInvisible() = flicker.layerBecomesInvisible(primaryApp)
|
||||
|
||||
// TODO(b/245472831): Move back to presubmit after shell transitions landing.
|
||||
@FlakyTest(bugId = 245472831)
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesInvisible() = testSpec.layerBecomesInvisible(primaryApp)
|
||||
fun secondaryAppLayerBecomesInvisible() = flicker.layerBecomesInvisible(primaryApp)
|
||||
|
||||
// TODO(b/245472831): Move back to presubmit after shell transitions landing.
|
||||
@FlakyTest(bugId = 245472831)
|
||||
@Test
|
||||
fun primaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
)
|
||||
fun primaryAppBoundsBecomesInvisible() =
|
||||
flicker.splitAppLayerBoundsBecomesInvisible(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@FlakyTest(bugId = 250530241)
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
)
|
||||
fun secondaryAppBoundsBecomesInvisible() =
|
||||
flicker.splitAppLayerBoundsBecomesInvisible(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowBecomesInvisible() = testSpec.appWindowBecomesInvisible(primaryApp)
|
||||
fun primaryAppWindowBecomesInvisible() = flicker.appWindowBecomesInvisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesInvisible() = testSpec.appWindowBecomesInvisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesInvisible() = flicker.appWindowBecomesInvisible(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 251268711)
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 206753786)
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -137,26 +129,22 @@ class DismissSplitScreenByGoHome(
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@@ -173,8 +161,8 @@ class DismissSplitScreenByGoHome(
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtStart
|
||||
@@ -50,35 +50,31 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class DragDividerToResize(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class DragDividerToResize(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp)
|
||||
}
|
||||
transitions {
|
||||
SplitScreenUtils.dragDividerToResizeAndWait(device, wmHelper)
|
||||
}
|
||||
setup { SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp) }
|
||||
transitions { SplitScreenUtils.dragDividerToResizeAndWait(device, wmHelper) }
|
||||
}
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
Assume.assumeTrue(tapl.isTablet || !testSpec.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(tapl.isTablet || !flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
}
|
||||
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() {
|
||||
testSpec.appWindowIsVisibleAtStart(primaryApp)
|
||||
testSpec.appWindowIsVisibleAtStart(secondaryApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtStart()
|
||||
flicker.appWindowIsVisibleAtStart(primaryApp)
|
||||
flicker.appWindowIsVisibleAtStart(secondaryApp)
|
||||
flicker.splitScreenDividerIsVisibleAtStart()
|
||||
|
||||
testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
testSpec.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtEnd()
|
||||
flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
flicker.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
flicker.splitScreenDividerIsVisibleAtEnd()
|
||||
|
||||
// TODO(b/246490534): Add validation for resized app after withAppTransitionIdle is
|
||||
// robust enough to get the correct end state.
|
||||
@@ -86,16 +82,14 @@ class DragDividerToResize(testSpec: FlickerTestParameter) : SplitScreenBase(test
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerKeepVisible() = testSpec.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
fun splitScreenDividerKeepVisible() = flicker.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerKeepVisible() = testSpec.layerKeepVisible(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerKeepVisible() = flicker.layerKeepVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerVisibilityChanges() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(secondaryApp)
|
||||
.then()
|
||||
.isInvisible(secondaryApp)
|
||||
@@ -104,53 +98,47 @@ class DragDividerToResize(testSpec: FlickerTestParameter) : SplitScreenBase(test
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowKeepVisible() = testSpec.appWindowKeepVisible(primaryApp)
|
||||
@Presubmit @Test fun primaryAppWindowKeepVisible() = flicker.appWindowKeepVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowKeepVisible() = testSpec.appWindowKeepVisible(secondaryApp)
|
||||
fun secondaryAppWindowKeepVisible() = flicker.appWindowKeepVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsChanges() = testSpec.splitAppLayerBoundsChanges(
|
||||
primaryApp,
|
||||
landscapePosLeft = true,
|
||||
portraitPosTop = false
|
||||
)
|
||||
fun primaryAppBoundsChanges() =
|
||||
flicker.splitAppLayerBoundsChanges(
|
||||
primaryApp,
|
||||
landscapePosLeft = true,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@FlakyTest(bugId = 250530664)
|
||||
@Test
|
||||
fun secondaryAppBoundsChanges() = testSpec.splitAppLayerBoundsChanges(
|
||||
secondaryApp,
|
||||
landscapePosLeft = false,
|
||||
portraitPosTop = true
|
||||
)
|
||||
fun secondaryAppBoundsChanges() =
|
||||
flicker.splitAppLayerBoundsChanges(
|
||||
secondaryApp,
|
||||
landscapePosLeft = false,
|
||||
portraitPosTop = true
|
||||
)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -161,26 +149,22 @@ class DragDividerToResize(testSpec: FlickerTestParameter) : SplitScreenBase(test
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -197,8 +181,8 @@ class DragDividerToResize(testSpec: FlickerTestParameter) : SplitScreenBase(test
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ package com.android.wm.shell.flicker.splitscreen
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
@@ -44,8 +44,8 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test enter split screen by dragging app icon from all apps.
|
||||
* This test is only for large screen devices.
|
||||
* Test enter split screen by dragging app icon from all apps. This test is only for large screen
|
||||
* devices.
|
||||
*
|
||||
* To run this test: `atest WMShellFlickerTests:EnterSplitScreenByDragFromAllApps`
|
||||
*/
|
||||
@@ -53,9 +53,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterSplitScreenByDragFromAllApps(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SplitScreenBase(testSpec) {
|
||||
class EnterSplitScreenByDragFromAllApps(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
@@ -71,9 +69,9 @@ class EnterSplitScreenByDragFromAllApps(
|
||||
}
|
||||
transitions {
|
||||
tapl.launchedAppState.taskbar
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
@@ -81,13 +79,13 @@ class EnterSplitScreenByDragFromAllApps(
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false)
|
||||
fun cujCompleted() = flicker.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.splitScreenDividerBecomesVisible()
|
||||
flicker.splitScreenDividerBecomesVisible()
|
||||
}
|
||||
|
||||
// TODO(b/245472831): Back to splitScreenDividerBecomesVisible after shell transition ready.
|
||||
@@ -95,60 +93,54 @@ class EnterSplitScreenByDragFromAllApps(
|
||||
@Test
|
||||
fun splitScreenDividerIsVisibleAtEnd_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
}
|
||||
flicker.assertLayersEnd { this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp)
|
||||
fun secondaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = false,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisibleByDrag(
|
||||
secondaryApp)
|
||||
fun secondaryAppBoundsBecomesVisible() =
|
||||
flicker.splitAppLayerBoundsBecomesVisibleByDrag(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
fun primaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -159,26 +151,22 @@ class EnterSplitScreenByDragFromAllApps(
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -195,11 +183,11 @@ class EnterSplitScreenByDragFromAllApps(
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY))
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ package com.android.wm.shell.flicker.splitscreen
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
@@ -43,8 +43,8 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test enter split screen by dragging app icon from notification.
|
||||
* This test is only for large screen devices.
|
||||
* Test enter split screen by dragging app icon from notification. This test is only for large
|
||||
* screen devices.
|
||||
*
|
||||
* To run this test: `atest WMShellFlickerTests:EnterSplitScreenByDragFromNotification`
|
||||
*/
|
||||
@@ -52,9 +52,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterSplitScreenByDragFromNotification(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SplitScreenBase(testSpec) {
|
||||
class EnterSplitScreenByDragFromNotification(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
private val sendNotificationApp = SplitScreenUtils.getSendNotification(instrumentation)
|
||||
|
||||
@@ -78,21 +76,19 @@ class EnterSplitScreenByDragFromNotification(
|
||||
SplitScreenUtils.dragFromNotificationToSplit(instrumentation, device, wmHelper)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, sendNotificationApp)
|
||||
}
|
||||
teardown {
|
||||
sendNotificationApp.exit(wmHelper)
|
||||
}
|
||||
teardown { sendNotificationApp.exit(wmHelper) }
|
||||
}
|
||||
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false)
|
||||
fun cujCompleted() = flicker.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.splitScreenDividerBecomesVisible()
|
||||
flicker.splitScreenDividerBecomesVisible()
|
||||
}
|
||||
|
||||
// TODO(b/245472831): Back to splitScreenDividerBecomesVisible after shell transition ready.
|
||||
@@ -100,20 +96,16 @@ class EnterSplitScreenByDragFromNotification(
|
||||
@Test
|
||||
fun splitScreenDividerIsVisibleAtEnd_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
}
|
||||
flicker.assertLayersEnd { this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isInvisible(sendNotificationApp)
|
||||
.then()
|
||||
.isVisible(sendNotificationApp)
|
||||
@@ -129,50 +121,48 @@ class EnterSplitScreenByDragFromNotification(
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.layerBecomesVisible(sendNotificationApp)
|
||||
flicker.layerBecomesVisible(sendNotificationApp)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = false,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisibleByDrag(
|
||||
sendNotificationApp)
|
||||
fun secondaryAppBoundsBecomesVisible() =
|
||||
flicker.splitAppLayerBoundsBecomesVisibleByDrag(sendNotificationApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
fun primaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(sendNotificationApp)
|
||||
fun secondaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(sendNotificationApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -183,26 +173,22 @@ class EnterSplitScreenByDragFromNotification(
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -219,11 +205,10 @@ class EnterSplitScreenByDragFromNotification(
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
package com.android.wm.shell.flicker.splitscreen
|
||||
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
@@ -41,8 +41,7 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test enter split screen by dragging a shortcut.
|
||||
* This test is only for large screen devices.
|
||||
* Test enter split screen by dragging a shortcut. This test is only for large screen devices.
|
||||
*
|
||||
* To run this test: `atest WMShellFlickerTests:EnterSplitScreenByDragFromShortcut`
|
||||
*/
|
||||
@@ -50,13 +49,11 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterSplitScreenByDragFromShortcut(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SplitScreenBase(testSpec) {
|
||||
class EnterSplitScreenByDragFromShortcut(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -80,39 +77,46 @@ class EnterSplitScreenByDragFromShortcut(
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp,
|
||||
fromOtherApp = false, appExistAtStart = false)
|
||||
fun cujCompleted() =
|
||||
flicker.splitScreenEntered(
|
||||
primaryApp,
|
||||
secondaryApp,
|
||||
fromOtherApp = false,
|
||||
appExistAtStart = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible()
|
||||
fun splitScreenDividerBecomesVisible() = flicker.splitScreenDividerBecomesVisible()
|
||||
|
||||
@Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp)
|
||||
fun secondaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp)
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = false,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
fun secondaryAppBoundsBecomesVisible() =
|
||||
flicker.splitAppLayerBoundsBecomesVisibleByDrag(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisibleByDrag(
|
||||
secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
fun primaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.notContains(secondaryApp)
|
||||
.then()
|
||||
.isAppWindowInvisible(secondaryApp, isOptional = true)
|
||||
@@ -122,28 +126,22 @@ class EnterSplitScreenByDragFromShortcut(
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -154,26 +152,22 @@ class EnterSplitScreenByDragFromShortcut(
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -190,11 +184,11 @@ class EnterSplitScreenByDragFromShortcut(
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY))
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ package com.android.wm.shell.flicker.splitscreen
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
@@ -44,8 +44,8 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test enter split screen by dragging app icon from taskbar.
|
||||
* This test is only for large screen devices.
|
||||
* Test enter split screen by dragging app icon from taskbar. This test is only for large screen
|
||||
* devices.
|
||||
*
|
||||
* To run this test: `atest WMShellFlickerTests:EnterSplitScreenByDragFromTaskbar`
|
||||
*/
|
||||
@@ -53,9 +53,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterSplitScreenByDragFromTaskbar(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SplitScreenBase(testSpec) {
|
||||
class EnterSplitScreenByDragFromTaskbar(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
@@ -68,9 +66,7 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
super.transition(this)
|
||||
setup {
|
||||
tapl.goHome()
|
||||
SplitScreenUtils.createShortcutOnHotseatIfNotExist(
|
||||
tapl, secondaryApp.appName
|
||||
)
|
||||
SplitScreenUtils.createShortcutOnHotseatIfNotExist(tapl, secondaryApp.appName)
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
transitions {
|
||||
@@ -84,13 +80,13 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false)
|
||||
fun cujCompleted() = flicker.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.splitScreenDividerBecomesVisible()
|
||||
flicker.splitScreenDividerBecomesVisible()
|
||||
}
|
||||
|
||||
// TODO(b/245472831): Back to splitScreenDividerBecomesVisible after shell transition ready.
|
||||
@@ -98,20 +94,16 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
@Test
|
||||
fun splitScreenDividerIsVisibleAtEnd_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
}
|
||||
flicker.assertLayersEnd { this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isInvisible(secondaryApp)
|
||||
.then()
|
||||
.isVisible(secondaryApp)
|
||||
@@ -127,50 +119,48 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.layerBecomesVisible(secondaryApp)
|
||||
flicker.layerBecomesVisible(secondaryApp)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = false, portraitPosTop = false)
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = false,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisibleByDrag(
|
||||
secondaryApp)
|
||||
fun secondaryAppBoundsBecomesVisible() =
|
||||
flicker.splitAppLayerBoundsBecomesVisibleByDrag(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
fun primaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -181,26 +171,22 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -217,10 +203,9 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
@@ -49,7 +49,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterSplitScreenFromOverview(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class EnterSplitScreenFromOverview(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
@@ -57,7 +57,8 @@ class EnterSplitScreenFromOverview(testSpec: FlickerTestParameter) : SplitScreen
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
secondaryApp.launchViaIntent(wmHelper)
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
wmHelper
|
||||
.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.withHomeActivityVisible()
|
||||
.waitForAndVerify()
|
||||
@@ -71,72 +72,76 @@ class EnterSplitScreenFromOverview(testSpec: FlickerTestParameter) : SplitScreen
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
fun cujCompleted() = flicker.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible()
|
||||
fun splitScreenDividerBecomesVisible() = flicker.splitScreenDividerBecomesVisible()
|
||||
|
||||
@Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp)
|
||||
fun secondaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesVisible() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.splitAppLayerBoundsBecomesVisible(
|
||||
secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
flicker.splitAppLayerBoundsBecomesVisible(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
)
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 244407465)
|
||||
@Test
|
||||
fun secondaryAppBoundsBecomesVisible_shellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.splitAppLayerBoundsBecomesVisible(
|
||||
secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
|
||||
flicker.splitAppLayerBoundsBecomesVisible(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp)
|
||||
fun primaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 251269324)
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -147,26 +152,22 @@ class EnterSplitScreenFromOverview(testSpec: FlickerTestParameter) : SplitScreen
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 252736515)
|
||||
@@ -183,8 +184,8 @@ class EnterSplitScreenFromOverview(testSpec: FlickerTestParameter) : SplitScreen
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
package com.android.wm.shell.flicker.splitscreen
|
||||
|
||||
import android.content.Context
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.wm.shell.flicker.BaseTest
|
||||
|
||||
abstract class SplitScreenBase(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
abstract class SplitScreenBase(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
protected val context: Context = instrumentation.context
|
||||
protected val primaryApp = SplitScreenUtils.getPrimary(instrumentation)
|
||||
protected val secondaryApp = SplitScreenUtils.getSecondary(instrumentation)
|
||||
@@ -32,8 +32,8 @@ abstract class SplitScreenBase(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
get() = {
|
||||
setup {
|
||||
tapl.setEnableRotation(true)
|
||||
setRotation(testSpec.startRotation)
|
||||
tapl.setExpectedRotation(testSpec.startRotation)
|
||||
setRotation(flicker.scenario.startRotation)
|
||||
tapl.setExpectedRotation(flicker.scenario.startRotation.value)
|
||||
tapl.workspace.switchToOverview().dismissAllTasks()
|
||||
}
|
||||
teardown {
|
||||
|
||||
@@ -41,8 +41,8 @@ import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.LAUNCHER_UI_PACKAGE_NAME
|
||||
import com.android.wm.shell.flicker.SYSTEM_UI_PACKAGE_NAME
|
||||
import org.junit.Assert.assertNotNull
|
||||
import java.util.Collections
|
||||
import org.junit.Assert.assertNotNull
|
||||
|
||||
internal object SplitScreenUtils {
|
||||
private const val TIMEOUT_MS = 3_000L
|
||||
@@ -129,10 +129,18 @@ internal object SplitScreenUtils {
|
||||
|
||||
// Find the second task in the upper right corner in split select mode by sorting
|
||||
// 'left' in descending order and 'top' in ascending order.
|
||||
Collections.sort(snapshots, { t1: UiObject2, t2: UiObject2 ->
|
||||
t2.getVisibleBounds().left - t1.getVisibleBounds().left})
|
||||
Collections.sort(snapshots, { t1: UiObject2, t2: UiObject2 ->
|
||||
t1.getVisibleBounds().top - t2.getVisibleBounds().top})
|
||||
Collections.sort(
|
||||
snapshots,
|
||||
{ t1: UiObject2, t2: UiObject2 ->
|
||||
t2.getVisibleBounds().left - t1.getVisibleBounds().left
|
||||
}
|
||||
)
|
||||
Collections.sort(
|
||||
snapshots,
|
||||
{ t1: UiObject2, t2: UiObject2 ->
|
||||
t1.getVisibleBounds().top - t2.getVisibleBounds().top
|
||||
}
|
||||
)
|
||||
snapshots[0].click()
|
||||
} else {
|
||||
tapl.workspace
|
||||
|
||||
@@ -19,13 +19,13 @@ package com.android.wm.shell.flicker.splitscreen
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
@@ -50,19 +50,15 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class SwitchAppByDoubleTapDivider(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp)
|
||||
}
|
||||
setup { SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp) }
|
||||
transitions {
|
||||
SplitScreenUtils.doubleTapDividerToSwitch(device)
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.waitForAndVerify()
|
||||
wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify()
|
||||
|
||||
waitForLayersToSwitch(wmHelper)
|
||||
waitForWindowsToSwitch(wmHelper)
|
||||
@@ -70,61 +66,74 @@ class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
}
|
||||
|
||||
private fun waitForWindowsToSwitch(wmHelper: WindowManagerStateHelper) {
|
||||
wmHelper.StateSyncBuilder().add("appWindowsSwitched") {
|
||||
val primaryAppWindow = it.wmState.visibleWindows.firstOrNull { window ->
|
||||
primaryApp.windowMatchesAnyOf(window)
|
||||
} ?: return@add false
|
||||
val secondaryAppWindow = it.wmState.visibleWindows.firstOrNull { window ->
|
||||
secondaryApp.windowMatchesAnyOf(window)
|
||||
} ?: return@add false
|
||||
wmHelper
|
||||
.StateSyncBuilder()
|
||||
.add("appWindowsSwitched") {
|
||||
val primaryAppWindow =
|
||||
it.wmState.visibleWindows.firstOrNull { window ->
|
||||
primaryApp.windowMatchesAnyOf(window)
|
||||
}
|
||||
?: return@add false
|
||||
val secondaryAppWindow =
|
||||
it.wmState.visibleWindows.firstOrNull { window ->
|
||||
secondaryApp.windowMatchesAnyOf(window)
|
||||
}
|
||||
?: return@add false
|
||||
|
||||
if (isLandscape(testSpec.endRotation)) {
|
||||
return@add if (testSpec.isTablet) {
|
||||
secondaryAppWindow.frame.right <= primaryAppWindow.frame.left
|
||||
if (isLandscape(flicker.scenario.endRotation)) {
|
||||
return@add if (flicker.scenario.isTablet) {
|
||||
secondaryAppWindow.frame.right <= primaryAppWindow.frame.left
|
||||
} else {
|
||||
primaryAppWindow.frame.right <= secondaryAppWindow.frame.left
|
||||
}
|
||||
} else {
|
||||
primaryAppWindow.frame.right <= secondaryAppWindow.frame.left
|
||||
}
|
||||
} else {
|
||||
return@add if (testSpec.isTablet) {
|
||||
primaryAppWindow.frame.bottom <= secondaryAppWindow.frame.top
|
||||
} else {
|
||||
primaryAppWindow.frame.bottom <= secondaryAppWindow.frame.top
|
||||
return@add if (flicker.scenario.isTablet) {
|
||||
primaryAppWindow.frame.bottom <= secondaryAppWindow.frame.top
|
||||
} else {
|
||||
primaryAppWindow.frame.bottom <= secondaryAppWindow.frame.top
|
||||
}
|
||||
}
|
||||
}
|
||||
}.waitForAndVerify()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
|
||||
private fun waitForLayersToSwitch(wmHelper: WindowManagerStateHelper) {
|
||||
wmHelper.StateSyncBuilder().add("appLayersSwitched") {
|
||||
val primaryAppLayer = it.layerState.visibleLayers.firstOrNull { window ->
|
||||
primaryApp.layerMatchesAnyOf(window)
|
||||
} ?: return@add false
|
||||
val secondaryAppLayer = it.layerState.visibleLayers.firstOrNull { window ->
|
||||
secondaryApp.layerMatchesAnyOf(window)
|
||||
} ?: return@add false
|
||||
wmHelper
|
||||
.StateSyncBuilder()
|
||||
.add("appLayersSwitched") {
|
||||
val primaryAppLayer =
|
||||
it.layerState.visibleLayers.firstOrNull { window ->
|
||||
primaryApp.layerMatchesAnyOf(window)
|
||||
}
|
||||
?: return@add false
|
||||
val secondaryAppLayer =
|
||||
it.layerState.visibleLayers.firstOrNull { window ->
|
||||
secondaryApp.layerMatchesAnyOf(window)
|
||||
}
|
||||
?: return@add false
|
||||
|
||||
val primaryVisibleRegion = primaryAppLayer.visibleRegion?.bounds
|
||||
?: return@add false
|
||||
val secondaryVisibleRegion = secondaryAppLayer.visibleRegion?.bounds
|
||||
?: return@add false
|
||||
val primaryVisibleRegion = primaryAppLayer.visibleRegion?.bounds ?: return@add false
|
||||
val secondaryVisibleRegion =
|
||||
secondaryAppLayer.visibleRegion?.bounds ?: return@add false
|
||||
|
||||
if (isLandscape(testSpec.endRotation)) {
|
||||
return@add if (testSpec.isTablet) {
|
||||
secondaryVisibleRegion.right <= primaryVisibleRegion.left
|
||||
if (isLandscape(flicker.scenario.endRotation)) {
|
||||
return@add if (flicker.scenario.isTablet) {
|
||||
secondaryVisibleRegion.right <= primaryVisibleRegion.left
|
||||
} else {
|
||||
primaryVisibleRegion.right <= secondaryVisibleRegion.left
|
||||
}
|
||||
} else {
|
||||
primaryVisibleRegion.right <= secondaryVisibleRegion.left
|
||||
}
|
||||
} else {
|
||||
return@add if (testSpec.isTablet) {
|
||||
primaryVisibleRegion.bottom <= secondaryVisibleRegion.top
|
||||
} else {
|
||||
primaryVisibleRegion.bottom <= secondaryVisibleRegion.top
|
||||
return@add if (flicker.scenario.isTablet) {
|
||||
primaryVisibleRegion.bottom <= secondaryVisibleRegion.top
|
||||
} else {
|
||||
primaryVisibleRegion.bottom <= secondaryVisibleRegion.top
|
||||
}
|
||||
}
|
||||
}
|
||||
}.waitForAndVerify()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
|
||||
private fun isLandscape(rotation: Int): Boolean {
|
||||
private fun isLandscape(rotation: PlatformConsts.Rotation): Boolean {
|
||||
val displayBounds = WindowUtils.getDisplayBounds(rotation)
|
||||
return displayBounds.width > displayBounds.height
|
||||
}
|
||||
@@ -133,13 +142,13 @@ class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() {
|
||||
testSpec.appWindowIsVisibleAtStart(primaryApp)
|
||||
testSpec.appWindowIsVisibleAtStart(secondaryApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtStart()
|
||||
flicker.appWindowIsVisibleAtStart(primaryApp)
|
||||
flicker.appWindowIsVisibleAtStart(secondaryApp)
|
||||
flicker.splitScreenDividerIsVisibleAtStart()
|
||||
|
||||
testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
testSpec.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtEnd()
|
||||
flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
flicker.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
flicker.splitScreenDividerIsVisibleAtEnd()
|
||||
|
||||
// TODO(b/246490534): Add validation for switched app after withAppTransitionIdle is
|
||||
// robust enough to get the correct end state.
|
||||
@@ -147,63 +156,57 @@ class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerKeepVisible() = testSpec.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
fun splitScreenDividerKeepVisible() = flicker.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
|
||||
@Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp)
|
||||
fun secondaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(secondaryApp)
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
)
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() =
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
)
|
||||
fun primaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
fun secondaryAppWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -214,26 +217,22 @@ class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@@ -250,11 +249,10 @@ class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ package com.android.wm.shell.flicker.splitscreen
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
@@ -45,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class SwitchBackToSplitFromAnotherApp(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
val thirdApp = SplitScreenUtils.getNonResizeable(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -66,22 +66,22 @@ class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScr
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
fun cujCompleted() = flicker.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible()
|
||||
fun splitScreenDividerBecomesVisible() = flicker.splitScreenDividerBecomesVisible()
|
||||
|
||||
@Presubmit @Test fun primaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp)
|
||||
fun secondaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
@@ -90,7 +90,7 @@ class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScr
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
@@ -98,17 +98,14 @@ class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScr
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp)
|
||||
fun primaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
@FlakyTest @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -166,13 +163,11 @@ class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScr
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ package com.android.wm.shell.flicker.splitscreen
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
@@ -45,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class SwitchBackToSplitFromHome(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -65,22 +65,22 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
fun cujCompleted() = flicker.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible()
|
||||
fun splitScreenDividerBecomesVisible() = flicker.splitScreenDividerBecomesVisible()
|
||||
|
||||
@Presubmit @Test fun primaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp)
|
||||
fun secondaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
@@ -89,7 +89,7 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
@@ -97,17 +97,14 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp)
|
||||
fun primaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
@FlakyTest @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -165,13 +162,11 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ package com.android.wm.shell.flicker.splitscreen
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
@@ -45,7 +45,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class SwitchBackToSplitFromRecent(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -65,22 +65,22 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
@IwTest(focusArea = "sysui")
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
fun cujCompleted() = flicker.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible()
|
||||
fun splitScreenDividerBecomesVisible() = flicker.splitScreenDividerBecomesVisible()
|
||||
|
||||
@Presubmit @Test fun primaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(primaryApp)
|
||||
@Presubmit @Test fun primaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp)
|
||||
fun secondaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
@@ -89,7 +89,7 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
@@ -97,17 +97,14 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp)
|
||||
fun primaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(secondaryApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
@Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -165,13 +162,11 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
)
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// TODO(b/176061063):The 3 buttons of nav bar do not exist in the hierarchy.
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,22 @@ import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesInvisible
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.appWindowIsInvisibleAtEnd
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtStart
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtStart
|
||||
import com.android.wm.shell.flicker.layerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsSnapToDivider
|
||||
import com.android.wm.shell.flicker.splitScreenDividerIsVisibleAtStart
|
||||
import com.android.wm.shell.flicker.splitScreenDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitScreenDividerIsVisibleAtStart
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -51,7 +51,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class SwitchBetweenSplitPairs(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
class SwitchBetweenSplitPairs(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
private val thirdApp = SplitScreenUtils.getIme(instrumentation)
|
||||
private val fourthApp = SplitScreenUtils.getSendNotification(instrumentation)
|
||||
|
||||
@@ -77,21 +77,21 @@ class SwitchBetweenSplitPairs(testSpec: FlickerTestParameter) : SplitScreenBase(
|
||||
@Presubmit
|
||||
@Test
|
||||
fun cujCompleted() {
|
||||
testSpec.appWindowIsVisibleAtStart(thirdApp)
|
||||
testSpec.appWindowIsVisibleAtStart(fourthApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtStart()
|
||||
flicker.appWindowIsVisibleAtStart(thirdApp)
|
||||
flicker.appWindowIsVisibleAtStart(fourthApp)
|
||||
flicker.splitScreenDividerIsVisibleAtStart()
|
||||
|
||||
testSpec.appWindowIsVisibleAtEnd(primaryApp)
|
||||
testSpec.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
testSpec.appWindowIsInvisibleAtEnd(thirdApp)
|
||||
testSpec.appWindowIsInvisibleAtEnd(fourthApp)
|
||||
testSpec.splitScreenDividerIsVisibleAtEnd()
|
||||
flicker.appWindowIsVisibleAtEnd(primaryApp)
|
||||
flicker.appWindowIsVisibleAtEnd(secondaryApp)
|
||||
flicker.appWindowIsInvisibleAtEnd(thirdApp)
|
||||
flicker.appWindowIsInvisibleAtEnd(fourthApp)
|
||||
flicker.splitScreenDividerIsVisibleAtEnd()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun splitScreenDividerInvisibleAtMiddle() =
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(SPLIT_SCREEN_DIVIDER_COMPONENT)
|
||||
@@ -101,24 +101,24 @@ class SwitchBetweenSplitPairs(testSpec: FlickerTestParameter) : SplitScreenBase(
|
||||
|
||||
@FlakyTest(bugId = 247095572)
|
||||
@Test
|
||||
fun primaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(primaryApp)
|
||||
fun primaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(primaryApp)
|
||||
|
||||
@FlakyTest(bugId = 247095572)
|
||||
@Test
|
||||
fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp)
|
||||
fun secondaryAppLayerBecomesVisible() = flicker.layerBecomesVisible(secondaryApp)
|
||||
|
||||
@FlakyTest(bugId = 247095572)
|
||||
@Test
|
||||
fun thirdAppLayerBecomesInvisible() = testSpec.layerBecomesInvisible(thirdApp)
|
||||
fun thirdAppLayerBecomesInvisible() = flicker.layerBecomesInvisible(thirdApp)
|
||||
|
||||
@FlakyTest(bugId = 247095572)
|
||||
@Test
|
||||
fun fourthAppLayerBecomesInvisible() = testSpec.layerBecomesInvisible(fourthApp)
|
||||
fun fourthAppLayerBecomesInvisible() = flicker.layerBecomesInvisible(fourthApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
primaryApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false
|
||||
@@ -127,7 +127,7 @@ class SwitchBetweenSplitPairs(testSpec: FlickerTestParameter) : SplitScreenBase(
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppBoundsIsVisibleAtEnd() =
|
||||
testSpec.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
flicker.splitAppLayerBoundsIsVisibleAtEnd(
|
||||
secondaryApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true
|
||||
@@ -136,66 +136,62 @@ class SwitchBetweenSplitPairs(testSpec: FlickerTestParameter) : SplitScreenBase(
|
||||
@Presubmit
|
||||
@Test
|
||||
fun thirdAppBoundsIsVisibleAtBegin() =
|
||||
testSpec.assertLayersStart {
|
||||
flicker.assertLayersStart {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
thirdApp,
|
||||
landscapePosLeft = tapl.isTablet,
|
||||
portraitPosTop = false,
|
||||
testSpec.startRotation
|
||||
flicker.scenario.startRotation
|
||||
)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun fourthAppBoundsIsVisibleAtBegin() =
|
||||
testSpec.assertLayersStart {
|
||||
flicker.assertLayersStart {
|
||||
this.splitAppLayerBoundsSnapToDivider(
|
||||
fourthApp,
|
||||
landscapePosLeft = !tapl.isTablet,
|
||||
portraitPosTop = true,
|
||||
testSpec.startRotation
|
||||
flicker.scenario.startRotation
|
||||
)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp)
|
||||
fun primaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(primaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
|
||||
fun secondaryAppWindowBecomesVisible() = flicker.appWindowBecomesVisible(secondaryApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun thirdAppWindowBecomesVisible() = testSpec.appWindowBecomesInvisible(thirdApp)
|
||||
fun thirdAppWindowBecomesVisible() = flicker.appWindowBecomesInvisible(thirdApp)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun fourthAppWindowBecomesVisible() = testSpec.appWindowBecomesInvisible(fourthApp)
|
||||
fun fourthAppWindowBecomesVisible() = flicker.appWindowBecomesInvisible(fourthApp)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 251268711)
|
||||
@Test
|
||||
override fun entireScreenCovered() =
|
||||
super.entireScreenCovered()
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 206753786)
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() =
|
||||
super.navBarLayerPositionAtStartAndEnd()
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarWindowIsAlwaysVisible() =
|
||||
super.navBarWindowIsAlwaysVisible()
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@@ -206,26 +202,22 @@ class SwitchBetweenSplitPairs(testSpec: FlickerTestParameter) : SplitScreenBase(
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtStartAndEnd() =
|
||||
super.statusBarLayerPositionAtStartAndEnd()
|
||||
override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarWindowIsAlwaysVisible() =
|
||||
super.statusBarWindowIsAlwaysVisible()
|
||||
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun taskBarWindowIsAlwaysVisible() =
|
||||
super.taskBarWindowIsAlwaysVisible()
|
||||
override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@@ -242,8 +234,8 @@ class SwitchBetweenSplitPairs(testSpec: FlickerTestParameter) : SplitScreenBase(
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
<option name="run-command" value="pm disable com.google.android.internal.betterbug" />
|
||||
<!-- restart launcher to activate TAPL -->
|
||||
<option name="run-command" value="setprop ro.test_harness 1 ; am force-stop com.google.android.apps.nexuslauncher" />
|
||||
<!-- Ensure output directory is empty at the start -->
|
||||
<option name="run-command" value="rm -rf /sdcard/flicker" />
|
||||
</target_preparer>
|
||||
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
|
||||
<option name="cleanup-apks" value="true"/>
|
||||
|
||||
@@ -20,7 +20,7 @@ import android.app.Instrumentation
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.junit.FlickerBuilderProvider
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Assume
|
||||
@@ -34,12 +34,12 @@ import org.junit.Test
|
||||
abstract class BaseTest
|
||||
@JvmOverloads
|
||||
constructor(
|
||||
protected val testSpec: FlickerTestParameter,
|
||||
protected val flicker: FlickerTest,
|
||||
protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation(),
|
||||
protected val tapl: LauncherInstrumentation = LauncherInstrumentation()
|
||||
) {
|
||||
init {
|
||||
testSpec.setIsTablet(
|
||||
flicker.scenario.setIsTablet(
|
||||
WindowManagerStateHelper(instrumentation, clearCacheAfterParsing = false)
|
||||
.currentState
|
||||
.wmState
|
||||
@@ -58,13 +58,13 @@ constructor(
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
setup { testSpec.setIsTablet(wmHelper.currentState.wmState.isTablet) }
|
||||
setup { flicker.scenario.setIsTablet(wmHelper.currentState.wmState.isTablet) }
|
||||
transition()
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks that all parts of the screen are covered during the transition */
|
||||
@Presubmit @Test open fun entireScreenCovered() = testSpec.entireScreenCovered()
|
||||
@Presubmit @Test open fun entireScreenCovered() = flicker.entireScreenCovered()
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentNameMatcher.NAV_BAR] layer is visible during the whole transition
|
||||
@@ -74,8 +74,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsVisibleAtStartAndEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarLayerIsVisibleAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,8 +87,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerPositionAtStartAndEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarLayerPositionAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarLayerPositionAtStartAndEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,8 +99,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsAlwaysVisible() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarWindowIsAlwaysVisible()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarWindowIsAlwaysVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,8 +112,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun taskBarLayerIsVisibleAtStartAndEnd() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
flicker.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,8 +124,8 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun taskBarWindowIsAlwaysVisible() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.taskBarWindowIsAlwaysVisible()
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
flicker.taskBarWindowIsAlwaysVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,8 +134,7 @@ constructor(
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsVisibleAtStartAndEnd() =
|
||||
testSpec.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
open fun statusBarLayerIsVisibleAtStartAndEnd() = flicker.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the
|
||||
@@ -143,7 +142,7 @@ constructor(
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerPositionAtStartAndEnd() = testSpec.statusBarLayerPositionAtStartAndEnd()
|
||||
open fun statusBarLayerPositionAtStartAndEnd() = flicker.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentNameMatcher.STATUS_BAR] window is visible during the whole
|
||||
@@ -151,7 +150,7 @@ constructor(
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()
|
||||
open fun statusBarWindowIsAlwaysVisible() = flicker.statusBarWindowIsAlwaysVisible()
|
||||
|
||||
/**
|
||||
* Checks that all layers that are visible on the trace, are visible for at least 2 consecutive
|
||||
@@ -160,7 +159,7 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers { this.visibleLayersShownMoreThanOneConsecutiveEntry() }
|
||||
flicker.assertLayers { this.visibleLayersShownMoreThanOneConsecutiveEntry() }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +169,7 @@ constructor(
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm { this.visibleWindowsShownMoreThanOneConsecutiveEntry() }
|
||||
flicker.assertWm { this.visibleWindowsShownMoreThanOneConsecutiveEntry() }
|
||||
}
|
||||
|
||||
open fun cujCompleted() {
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.traces.common.IComponentNameMatcher
|
||||
* Checks that [ComponentNameMatcher.STATUS_BAR] window is visible and above the app windows in all
|
||||
* WM trace entries
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarWindowIsAlwaysVisible() {
|
||||
fun FlickerTest.statusBarWindowIsAlwaysVisible() {
|
||||
assertWm { this.isAboveAppWindowVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ fun FlickerTestParameter.statusBarWindowIsAlwaysVisible() {
|
||||
* Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows in all WM
|
||||
* trace entries
|
||||
*/
|
||||
fun FlickerTestParameter.navBarWindowIsAlwaysVisible() {
|
||||
fun FlickerTest.navBarWindowIsAlwaysVisible() {
|
||||
assertWm { this.isAboveAppWindowVisible(ComponentNameMatcher.NAV_BAR) }
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ fun FlickerTestParameter.navBarWindowIsAlwaysVisible() {
|
||||
* Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the
|
||||
* start and end of the WM trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarWindowIsVisibleAtStartAndEnd() {
|
||||
fun FlickerTest.navBarWindowIsVisibleAtStartAndEnd() {
|
||||
this.navBarWindowIsVisibleAtStart()
|
||||
this.navBarWindowIsVisibleAtEnd()
|
||||
}
|
||||
@@ -52,7 +52,7 @@ fun FlickerTestParameter.navBarWindowIsVisibleAtStartAndEnd() {
|
||||
* Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the
|
||||
* start of the WM trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarWindowIsVisibleAtStart() {
|
||||
fun FlickerTest.navBarWindowIsVisibleAtStart() {
|
||||
assertWmStart { this.isAboveAppWindowVisible(ComponentNameMatcher.NAV_BAR) }
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ fun FlickerTestParameter.navBarWindowIsVisibleAtStart() {
|
||||
* Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the end
|
||||
* of the WM trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarWindowIsVisibleAtEnd() {
|
||||
fun FlickerTest.navBarWindowIsVisibleAtEnd() {
|
||||
assertWmEnd { this.isAboveAppWindowVisible(ComponentNameMatcher.NAV_BAR) }
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ fun FlickerTestParameter.navBarWindowIsVisibleAtEnd() {
|
||||
* Checks that [ComponentNameMatcher.TASK_BAR] window is visible and above the app windows in all WM
|
||||
* trace entries
|
||||
*/
|
||||
fun FlickerTestParameter.taskBarWindowIsAlwaysVisible() {
|
||||
fun FlickerTest.taskBarWindowIsAlwaysVisible() {
|
||||
assertWm { this.isAboveAppWindowVisible(ComponentNameMatcher.TASK_BAR) }
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ fun FlickerTestParameter.taskBarWindowIsAlwaysVisible() {
|
||||
* Checks that [ComponentNameMatcher.TASK_BAR] window is visible and above the app windows in all WM
|
||||
* trace entries
|
||||
*/
|
||||
fun FlickerTestParameter.taskBarWindowIsVisibleAtEnd() {
|
||||
fun FlickerTest.taskBarWindowIsVisibleAtEnd() {
|
||||
assertWmEnd { this.isAboveAppWindowVisible(ComponentNameMatcher.TASK_BAR) }
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ fun FlickerTestParameter.taskBarWindowIsVisibleAtEnd() {
|
||||
* @param allStates if all states should be checked, othersie, just initial and final
|
||||
*/
|
||||
@JvmOverloads
|
||||
fun FlickerTestParameter.entireScreenCovered(allStates: Boolean = true) {
|
||||
fun FlickerTest.entireScreenCovered(allStates: Boolean = true) {
|
||||
if (allStates) {
|
||||
assertLayers {
|
||||
this.invoke("entireScreenCovered") { entry ->
|
||||
@@ -114,19 +114,19 @@ fun FlickerTestParameter.entireScreenCovered(allStates: Boolean = true) {
|
||||
}
|
||||
|
||||
/** Checks that [ComponentNameMatcher.NAV_BAR] layer is visible at the start of the SF trace */
|
||||
fun FlickerTestParameter.navBarLayerIsVisibleAtStart() {
|
||||
fun FlickerTest.navBarLayerIsVisibleAtStart() {
|
||||
assertLayersStart { this.isVisible(ComponentNameMatcher.NAV_BAR) }
|
||||
}
|
||||
|
||||
/** Checks that [ComponentNameMatcher.NAV_BAR] layer is visible at the end of the SF trace */
|
||||
fun FlickerTestParameter.navBarLayerIsVisibleAtEnd() {
|
||||
fun FlickerTest.navBarLayerIsVisibleAtEnd() {
|
||||
assertLayersEnd { this.isVisible(ComponentNameMatcher.NAV_BAR) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [ComponentNameMatcher.NAV_BAR] layer is visible at the start and end of the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarLayerIsVisibleAtStartAndEnd() {
|
||||
fun FlickerTest.navBarLayerIsVisibleAtStartAndEnd() {
|
||||
this.navBarLayerIsVisibleAtStart()
|
||||
this.navBarLayerIsVisibleAtEnd()
|
||||
}
|
||||
@@ -134,18 +134,18 @@ fun FlickerTestParameter.navBarLayerIsVisibleAtStartAndEnd() {
|
||||
/**
|
||||
* Checks that [ComponentNameMatcher.TASK_BAR] layer is visible at the start and end of the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.taskBarLayerIsVisibleAtStartAndEnd() {
|
||||
fun FlickerTest.taskBarLayerIsVisibleAtStartAndEnd() {
|
||||
this.taskBarLayerIsVisibleAtStart()
|
||||
this.taskBarLayerIsVisibleAtEnd()
|
||||
}
|
||||
|
||||
/** Checks that [ComponentNameMatcher.TASK_BAR] layer is visible at the start of the SF trace */
|
||||
fun FlickerTestParameter.taskBarLayerIsVisibleAtStart() {
|
||||
fun FlickerTest.taskBarLayerIsVisibleAtStart() {
|
||||
assertLayersStart { this.isVisible(ComponentNameMatcher.TASK_BAR) }
|
||||
}
|
||||
|
||||
/** Checks that [ComponentNameMatcher.TASK_BAR] layer is visible at the end of the SF trace */
|
||||
fun FlickerTestParameter.taskBarLayerIsVisibleAtEnd() {
|
||||
fun FlickerTest.taskBarLayerIsVisibleAtEnd() {
|
||||
assertLayersEnd { this.isVisible(ComponentNameMatcher.TASK_BAR) }
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ fun FlickerTestParameter.taskBarLayerIsVisibleAtEnd() {
|
||||
* Checks that [ComponentNameMatcher.STATUS_BAR] layer is visible at the start and end of the SF
|
||||
* trace
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarLayerIsVisibleAtStartAndEnd() {
|
||||
fun FlickerTest.statusBarLayerIsVisibleAtStartAndEnd() {
|
||||
assertLayersStart { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
assertLayersEnd { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
}
|
||||
@@ -162,12 +162,14 @@ fun FlickerTestParameter.statusBarLayerIsVisibleAtStartAndEnd() {
|
||||
* Asserts that the [ComponentNameMatcher.NAV_BAR] layer is at the correct position at the start of
|
||||
* the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarLayerPositionAtStart() {
|
||||
fun FlickerTest.navBarLayerPositionAtStart() {
|
||||
assertLayersStart {
|
||||
val display =
|
||||
this.entry.displays.firstOrNull { !it.isVirtual } ?: error("There is no display!")
|
||||
this.visibleRegion(ComponentNameMatcher.NAV_BAR)
|
||||
.coversExactly(WindowUtils.getNavigationBarPosition(display, isGesturalNavigation))
|
||||
.coversExactly(
|
||||
WindowUtils.getNavigationBarPosition(display, scenario.isGesturalNavigation)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,13 +177,15 @@ fun FlickerTestParameter.navBarLayerPositionAtStart() {
|
||||
* Asserts that the [ComponentNameMatcher.NAV_BAR] layer is at the correct position at the end of
|
||||
* the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarLayerPositionAtEnd() {
|
||||
fun FlickerTest.navBarLayerPositionAtEnd() {
|
||||
assertLayersEnd {
|
||||
val display =
|
||||
this.entry.displays.minByOrNull { it.id }
|
||||
?: throw RuntimeException("There is no display!")
|
||||
this.visibleRegion(ComponentNameMatcher.NAV_BAR)
|
||||
.coversExactly(WindowUtils.getNavigationBarPosition(display, isGesturalNavigation))
|
||||
.coversExactly(
|
||||
WindowUtils.getNavigationBarPosition(display, scenario.isGesturalNavigation)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +193,7 @@ fun FlickerTestParameter.navBarLayerPositionAtEnd() {
|
||||
* Asserts that the [ComponentNameMatcher.NAV_BAR] layer is at the correct position at the start and
|
||||
* end of the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarLayerPositionAtStartAndEnd() {
|
||||
fun FlickerTest.navBarLayerPositionAtStartAndEnd() {
|
||||
navBarLayerPositionAtStart()
|
||||
navBarLayerPositionAtEnd()
|
||||
}
|
||||
@@ -198,7 +202,7 @@ fun FlickerTestParameter.navBarLayerPositionAtStartAndEnd() {
|
||||
* Asserts that the [ComponentNameMatcher.STATUS_BAR] layer is at the correct position at the start
|
||||
* of the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarLayerPositionAtStart() {
|
||||
fun FlickerTest.statusBarLayerPositionAtStart() {
|
||||
assertLayersStart {
|
||||
val display =
|
||||
this.entry.displays.minByOrNull { it.id }
|
||||
@@ -212,7 +216,7 @@ fun FlickerTestParameter.statusBarLayerPositionAtStart() {
|
||||
* Asserts that the [ComponentNameMatcher.STATUS_BAR] layer is at the correct position at the end of
|
||||
* the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarLayerPositionAtEnd() {
|
||||
fun FlickerTest.statusBarLayerPositionAtEnd() {
|
||||
assertLayersEnd {
|
||||
val display =
|
||||
this.entry.displays.minByOrNull { it.id }
|
||||
@@ -226,7 +230,7 @@ fun FlickerTestParameter.statusBarLayerPositionAtEnd() {
|
||||
* Asserts that the [ComponentNameMatcher.STATUS_BAR] layer is at the correct position at the start
|
||||
* and end of the SF trace
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarLayerPositionAtStartAndEnd() {
|
||||
fun FlickerTest.statusBarLayerPositionAtStartAndEnd() {
|
||||
statusBarLayerPositionAtStart()
|
||||
statusBarLayerPositionAtEnd()
|
||||
}
|
||||
@@ -235,9 +239,7 @@ fun FlickerTestParameter.statusBarLayerPositionAtStartAndEnd() {
|
||||
* Asserts that the visibleRegion of the [ComponentNameMatcher.SNAPSHOT] layer can cover the
|
||||
* visibleRegion of the given app component exactly
|
||||
*/
|
||||
fun FlickerTestParameter.snapshotStartingWindowLayerCoversExactlyOnApp(
|
||||
component: IComponentNameMatcher
|
||||
) {
|
||||
fun FlickerTest.snapshotStartingWindowLayerCoversExactlyOnApp(component: IComponentNameMatcher) {
|
||||
assertLayers {
|
||||
invoke("snapshotStartingWindowLayerCoversExactlyOnApp") {
|
||||
val snapshotLayers =
|
||||
@@ -291,7 +293,7 @@ fun FlickerTestParameter.snapshotStartingWindowLayerCoversExactlyOnApp(
|
||||
* otherwise we won't and the layer must appear immediately.
|
||||
* ```
|
||||
*/
|
||||
fun FlickerTestParameter.replacesLayer(
|
||||
fun FlickerTest.replacesLayer(
|
||||
originalLayer: IComponentNameMatcher,
|
||||
newLayer: IComponentNameMatcher,
|
||||
ignoreEntriesWithRotationLayer: Boolean = false,
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
package com.android.server.wm.flicker.activityembedding
|
||||
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.ActivityEmbeddingAppHelper
|
||||
import org.junit.Before
|
||||
|
||||
abstract class ActivityEmbeddingTestBase(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
abstract class ActivityEmbeddingTestBase(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
val testApp = ActivityEmbeddingAppHelper(instrumentation)
|
||||
|
||||
@Before
|
||||
|
||||
@@ -17,14 +17,12 @@
|
||||
package com.android.server.wm.flicker.activityembedding
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ActivityEmbeddingAppHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -41,8 +39,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenActivityEmbeddingPlaceholderSplit(testSpec: FlickerTestParameter) :
|
||||
ActivityEmbeddingTestBase(testSpec) {
|
||||
class OpenActivityEmbeddingPlaceholderSplit(flicker: FlickerTest) :
|
||||
ActivityEmbeddingTestBase(flicker) {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -60,7 +58,7 @@ class OpenActivityEmbeddingPlaceholderSplit(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
fun mainActivityBecomesInvisible() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
isVisible(ActivityEmbeddingAppHelper.MAIN_ACTIVITY_COMPONENT)
|
||||
.then()
|
||||
.isInvisible(ActivityEmbeddingAppHelper.MAIN_ACTIVITY_COMPONENT)
|
||||
@@ -70,12 +68,12 @@ class OpenActivityEmbeddingPlaceholderSplit(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
fun placeholderSplitBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
isInvisible(ActivityEmbeddingAppHelper.PLACEHOLDER_PRIMARY_COMPONENT)
|
||||
.then()
|
||||
.isVisible(ActivityEmbeddingAppHelper.PLACEHOLDER_PRIMARY_COMPONENT)
|
||||
}
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
isInvisible(ActivityEmbeddingAppHelper.PLACEHOLDER_SECONDARY_COMPONENT)
|
||||
.then()
|
||||
.isVisible(ActivityEmbeddingAppHelper.PLACEHOLDER_SECONDARY_COMPONENT)
|
||||
@@ -142,21 +140,13 @@ class OpenActivityEmbeddingPlaceholderSplit(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0, Surface.ROTATION_90),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ package com.android.server.wm.flicker.close
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.annotation.FlickerServiceCompatible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -69,7 +69,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransition(testSpec) {
|
||||
class CloseAppBackButtonTest(flicker: FlickerTest) : CloseAppTransition(flicker) {
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -89,13 +89,13 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ package com.android.server.wm.flicker.close
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.annotation.FlickerServiceCompatible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -69,7 +69,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransition(testSpec) {
|
||||
class CloseAppHomeButtonTest(flicker: FlickerTest) : CloseAppTransition(flicker) {
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -91,16 +91,11 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
*/
|
||||
/** Creates the test configurations. */
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ package com.android.server.wm.flicker.close
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
@@ -28,15 +28,15 @@ import com.android.server.wm.traces.common.ComponentNameMatcher.Companion.LAUNCH
|
||||
import org.junit.Test
|
||||
|
||||
/** Base test class for transitions that close an app back to the launcher screen */
|
||||
abstract class CloseAppTransition(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
abstract class CloseAppTransition(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
protected open val testApp: StandardAppHelper = SimpleAppHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
tapl.setExpectedRotation(testSpec.startRotation)
|
||||
tapl.setExpectedRotation(flicker.scenario.startRotation.value)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
this.setRotation(testSpec.startRotation)
|
||||
this.setRotation(flicker.scenario.startRotation)
|
||||
}
|
||||
teardown { testApp.exit(wmHelper) }
|
||||
}
|
||||
@@ -48,7 +48,7 @@ abstract class CloseAppTransition(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherReplacesAppWindowAsTopWindow() {
|
||||
testSpec.assertWm { this.isAppWindowOnTop(testApp).then().isAppWindowOnTop(LAUNCHER) }
|
||||
flicker.assertWm { this.isAppWindowOnTop(testApp).then().isAppWindowOnTop(LAUNCHER) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,17 +58,17 @@ abstract class CloseAppTransition(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherWindowBecomesVisible() {
|
||||
testSpec.assertWm { this.isAppWindowNotOnTop(LAUNCHER).then().isAppWindowOnTop(LAUNCHER) }
|
||||
flicker.assertWm { this.isAppWindowNotOnTop(LAUNCHER).then().isAppWindowOnTop(LAUNCHER) }
|
||||
}
|
||||
|
||||
/** Checks that [LAUNCHER] layer becomes visible when [testApp] becomes invisible */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherLayerReplacesApp() {
|
||||
testSpec.replacesLayer(
|
||||
flicker.replacesLayer(
|
||||
testApp,
|
||||
LAUNCHER,
|
||||
ignoreEntriesWithRotationLayer = testSpec.isLandscapeOrSeascapeAtStart
|
||||
ignoreEntriesWithRotationLayer = flicker.scenario.isLandscapeOrSeascapeAtStart
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import android.util.Log
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
@@ -37,10 +35,8 @@ class ActivityEmbeddingAppHelper
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.ActivityEmbedding.MainActivity.LABEL,
|
||||
component: ComponentNameMatcher = MAIN_ACTIVITY_COMPONENT,
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy) {
|
||||
component: ComponentNameMatcher = MAIN_ACTIVITY_COMPONENT
|
||||
) : StandardAppHelper(instr, launcherName, component) {
|
||||
|
||||
/**
|
||||
* Clicks the button to launch the placeholder primary activity, which should launch the
|
||||
|
||||
@@ -25,45 +25,52 @@ import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import org.junit.Assert.assertNotNull
|
||||
|
||||
class AssistantAppHelper @JvmOverloads constructor(
|
||||
class AssistantAppHelper
|
||||
@JvmOverloads
|
||||
constructor(
|
||||
val instr: Instrumentation,
|
||||
val component: ComponentName = ActivityOptions.ASSISTANT_SERVICE_COMPONENT_NAME,
|
||||
) {
|
||||
protected val uiDevice: UiDevice = UiDevice.getInstance(instr)
|
||||
protected val defaultAssistant: String? = Settings.Secure.getString(
|
||||
instr.targetContext.contentResolver,
|
||||
Settings.Secure.ASSISTANT)
|
||||
protected val defaultVoiceInteractionService: String? = Settings.Secure.getString(
|
||||
instr.targetContext.contentResolver,
|
||||
Settings.Secure.VOICE_INTERACTION_SERVICE)
|
||||
protected val defaultAssistant: String? =
|
||||
Settings.Secure.getString(instr.targetContext.contentResolver, Settings.Secure.ASSISTANT)
|
||||
protected val defaultVoiceInteractionService: String? =
|
||||
Settings.Secure.getString(
|
||||
instr.targetContext.contentResolver,
|
||||
Settings.Secure.VOICE_INTERACTION_SERVICE
|
||||
)
|
||||
|
||||
fun setDefaultAssistant() {
|
||||
Settings.Secure.putString(
|
||||
instr.targetContext.contentResolver,
|
||||
Settings.Secure.VOICE_INTERACTION_SERVICE,
|
||||
component.flattenToString())
|
||||
component.flattenToString()
|
||||
)
|
||||
Settings.Secure.putString(
|
||||
instr.targetContext.contentResolver,
|
||||
Settings.Secure.ASSISTANT,
|
||||
component.flattenToString())
|
||||
component.flattenToString()
|
||||
)
|
||||
}
|
||||
|
||||
fun resetDefaultAssistant() {
|
||||
Settings.Secure.putString(
|
||||
instr.targetContext.contentResolver,
|
||||
Settings.Secure.VOICE_INTERACTION_SERVICE,
|
||||
defaultVoiceInteractionService)
|
||||
defaultVoiceInteractionService
|
||||
)
|
||||
Settings.Secure.putString(
|
||||
instr.targetContext.contentResolver,
|
||||
Settings.Secure.ASSISTANT,
|
||||
defaultAssistant)
|
||||
defaultAssistant
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Open Assistance UI.
|
||||
*
|
||||
* @param longpress open the UI by long pressing power button.
|
||||
* Otherwise open the UI through vioceinteraction shell command directly.
|
||||
* @param longpress open the UI by long pressing power button. Otherwise open the UI through
|
||||
* vioceinteraction shell command directly.
|
||||
*/
|
||||
@JvmOverloads
|
||||
fun openUI(longpress: Boolean = false) {
|
||||
@@ -72,9 +79,11 @@ class AssistantAppHelper @JvmOverloads constructor(
|
||||
} else {
|
||||
uiDevice.executeShellCommand("cmd voiceinteraction show")
|
||||
}
|
||||
val ui = uiDevice.wait(
|
||||
Until.findObject(By.res(ActivityOptions.FLICKER_APP_PACKAGE, "vis_frame")),
|
||||
FIND_TIMEOUT)
|
||||
val ui =
|
||||
uiDevice.wait(
|
||||
Until.findObject(By.res(ActivityOptions.FLICKER_APP_PACKAGE, "vis_frame")),
|
||||
FIND_TIMEOUT
|
||||
)
|
||||
assertNotNull("Can't find Assistant UI after long pressing power button.", ui)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
@@ -29,7 +27,5 @@ constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.PortraitOnlyActivity.LABEL,
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.PortraitOnlyActivity.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy)
|
||||
ActivityOptions.PortraitOnlyActivity.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component)
|
||||
|
||||
@@ -18,15 +18,16 @@
|
||||
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import com.android.server.wm.flicker.Flicker
|
||||
import com.android.server.wm.flicker.IFlickerTestData
|
||||
import com.android.server.wm.flicker.rules.ChangeDisplayOrientationRule
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
|
||||
/**
|
||||
* Changes the device [rotation] and wait for the rotation animation to complete
|
||||
*
|
||||
* @param rotation New device rotation
|
||||
*/
|
||||
fun Flicker.setRotation(rotation: Int) =
|
||||
fun IFlickerTestData.setRotation(rotation: PlatformConsts.Rotation) =
|
||||
ChangeDisplayOrientationRule.setRotation(
|
||||
rotation,
|
||||
instrumentation,
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Direction
|
||||
import androidx.test.uiautomator.Until
|
||||
@@ -32,10 +30,8 @@ class GameAppHelper
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.Game.LABEL,
|
||||
component: ComponentNameMatcher = ActivityOptions.Game.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy,
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy) {
|
||||
component: ComponentNameMatcher = ActivityOptions.Game.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component) {
|
||||
|
||||
/**
|
||||
* Swipes down in the mock game app.
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.Condition
|
||||
import com.android.server.wm.traces.common.DeviceStateDump
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import java.util.regex.Pattern
|
||||
@@ -34,7 +35,7 @@ class ImeAppAutoFocusHelper
|
||||
@JvmOverloads
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
private val rotation: Int,
|
||||
private val rotation: PlatformConsts.Rotation,
|
||||
private val imePackageName: String = IME_PACKAGE,
|
||||
launcherName: String = ActivityOptions.Ime.AutoFocusActivity.LABEL,
|
||||
component: ComponentNameMatcher =
|
||||
@@ -63,7 +64,7 @@ constructor(
|
||||
} else {
|
||||
getPackage()
|
||||
}
|
||||
launcherStrategy.launch(appName, expectedPackage)
|
||||
open(expectedPackage)
|
||||
}
|
||||
|
||||
fun startDialogThemedActivity(wmHelper: WindowManagerStateHelper) {
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
@@ -31,10 +29,8 @@ open class ImeAppHelper
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.Ime.Default.LABEL,
|
||||
component: ComponentNameMatcher = ActivityOptions.Ime.Default.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy) {
|
||||
component: ComponentNameMatcher = ActivityOptions.Ime.Default.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component) {
|
||||
/**
|
||||
* Opens the IME and wait for it to be displayed
|
||||
*
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
@@ -29,7 +27,5 @@ constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.Ime.StateInitializeActivity.LABEL,
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.Ime.StateInitializeActivity.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy)
|
||||
ActivityOptions.Ime.StateInitializeActivity.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Direction
|
||||
import androidx.test.uiautomator.UiObject2
|
||||
@@ -32,10 +30,8 @@ class MailAppHelper
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.Mail.LABEL,
|
||||
component: ComponentNameMatcher = ActivityOptions.Mail.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy) {
|
||||
component: ComponentNameMatcher = ActivityOptions.Mail.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component) {
|
||||
|
||||
fun openMail(rowIdx: Int) {
|
||||
val rowSel =
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
@@ -32,10 +30,8 @@ class NewTasksAppHelper
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.LaunchNewTask.LABEL,
|
||||
component: ComponentNameMatcher = ActivityOptions.LaunchNewTask.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy) {
|
||||
component: ComponentNameMatcher = ActivityOptions.LaunchNewTask.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component) {
|
||||
fun openNewTask(device: UiDevice, wmHelper: WindowManagerStateHelper) {
|
||||
val button =
|
||||
device.wait(Until.findObject(By.res(getPackage(), "launch_new_task")), FIND_TIMEOUT)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
@@ -29,7 +27,5 @@ constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.NonResizeableActivity.LABEL,
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.NonResizeableActivity.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy)
|
||||
ActivityOptions.NonResizeableActivity.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
@@ -31,10 +29,8 @@ class NotificationAppHelper
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.Notification.LABEL,
|
||||
component: ComponentNameMatcher = ActivityOptions.Notification.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy) {
|
||||
component: ComponentNameMatcher = ActivityOptions.Notification.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component) {
|
||||
fun postNotification(wmHelper: WindowManagerStateHelper) {
|
||||
val button =
|
||||
uiDevice.wait(Until.findObject(By.res(getPackage(), "post_notification")), FIND_TIMEOUT)
|
||||
|
||||
@@ -92,8 +92,12 @@ open class PipAppHelper(instrumentation: Instrumentation) :
|
||||
|
||||
// if the distance per step is less than 1, carry out the animation in two steps
|
||||
gestureHelper.pinch(
|
||||
Tuple(initLeftX, yCoord), Tuple(initRightX, yCoord),
|
||||
Tuple(finalLeftX, yCoord), Tuple(finalRightX, yCoord), adjustedSteps)
|
||||
Tuple(initLeftX, yCoord),
|
||||
Tuple(initRightX, yCoord),
|
||||
Tuple(finalLeftX, yCoord),
|
||||
Tuple(finalRightX, yCoord),
|
||||
adjustedSteps
|
||||
)
|
||||
|
||||
waitForPipWindowToExpandFrom(wmHelper, Region.from(windowRect))
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
@@ -29,7 +27,5 @@ constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.SeamlessRotation.LABEL,
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.SeamlessRotation.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy)
|
||||
ActivityOptions.SeamlessRotation.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
@@ -29,7 +27,5 @@ constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.ShowWhenLockedActivity.LABEL,
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.ShowWhenLockedActivity.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy)
|
||||
ActivityOptions.ShowWhenLockedActivity.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
@@ -28,7 +26,5 @@ class SimpleAppHelper
|
||||
constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.SimpleActivity.LABEL,
|
||||
component: ComponentNameMatcher = ActivityOptions.SimpleActivity.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy)
|
||||
component: ComponentNameMatcher = ActivityOptions.SimpleActivity.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
@@ -33,10 +31,8 @@ constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.LaunchNewActivity.LABEL,
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.LaunchNewActivity.COMPONENT.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy =
|
||||
LauncherStrategyFactory.getInstance(instr).launcherStrategy
|
||||
) : StandardAppHelper(instr, launcherName, component, launcherStrategy) {
|
||||
ActivityOptions.LaunchNewActivity.COMPONENT.toFlickerComponent()
|
||||
) : StandardAppHelper(instr, launcherName, component) {
|
||||
|
||||
private val secondActivityComponent =
|
||||
ActivityOptions.SimpleActivity.COMPONENT.toFlickerComponent()
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -49,8 +48,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CloseImeAutoOpenWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
class CloseImeAutoOpenWindowToAppTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -62,43 +61,37 @@ class CloseImeAutoOpenWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm { this.isAppWindowOnTop(testApp) }
|
||||
flicker.assertWm { this.isAppWindowOnTop(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart { this.isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersStart { this.isVisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd { this.isInvisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersEnd { this.isInvisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = testSpec.imeLayerBecomesInvisible()
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = flicker.imeLayerBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
// b/190352379 (IME doesn't show on app launch in 90 degrees)
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// b/190352379 (IME doesn't show on app launch in 90 degrees)
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -49,8 +48,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
class CloseImeAutoOpenWindowToHomeTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -68,43 +67,37 @@ class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTes
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowBecomesInvisible() {
|
||||
testSpec.assertWm { this.isAppWindowOnTop(testApp).then().isAppWindowNotOnTop(testApp) }
|
||||
flicker.assertWm { this.isAppWindowOnTop(testApp).then().isAppWindowNotOnTop(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart { this.isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersStart { this.isVisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd { this.isInvisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersEnd { this.isInvisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = testSpec.imeLayerBecomesInvisible()
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = flicker.imeLayerBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerBecomesInvisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp).then().isInvisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp).then().isInvisible(testApp) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
// b/190352379 (IME doesn't show on app launch in 90 degrees)
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
// b/190352379 (IME doesn't show on app launch in 90 degrees)
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,16 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeEditorPopupDialogAppHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.traces.region.RegionSubject
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -38,7 +37,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
class CloseImeEditorPopupDialogTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val imeTestApp = ImeEditorPopupDialogAppHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -59,14 +58,12 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeWindowBecameInvisible() = testSpec.imeWindowBecomesInvisible()
|
||||
@Presubmit @Test fun imeWindowBecameInvisible() = flicker.imeWindowBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerAndImeSnapshotVisibleOnScreen() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isVisible(ComponentNameMatcher.IME_SNAPSHOT)
|
||||
@@ -79,7 +76,7 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeSnapshotAssociatedOnAppVisibleRegion() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.invoke("imeSnapshotAssociatedOnAppVisibleRegion") {
|
||||
val imeSnapshotLayers =
|
||||
it.subjects.filter { subject ->
|
||||
@@ -106,16 +103,10 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
),
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
@@ -43,7 +43,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CloseImeWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
class CloseImeWindowToAppTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -60,7 +60,7 @@ class CloseImeWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest(testSpe
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
listOf(
|
||||
ComponentNameMatcher.IME,
|
||||
@@ -75,31 +75,31 @@ class CloseImeWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest(testSpe
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeFalse(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
testSpec.navBarLayerPositionAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
Assume.assumeFalse(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
flicker.navBarLayerPositionAtStartAndEnd()
|
||||
}
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun navBarLayerPositionAtStartAndEndLandscapeOrSeascapeAtStart() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeTrue(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
testSpec.navBarLayerPositionAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
Assume.assumeTrue(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
flicker.navBarLayerPositionAtStartAndEnd()
|
||||
}
|
||||
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = testSpec.imeLayerBecomesInvisible()
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = flicker.imeLayerBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm { this.isAppWindowOnTop(testApp) }
|
||||
flicker.assertWm { this.isAppWindowOnTop(testApp) }
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -115,8 +115,8 @@ class CloseImeWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest(testSpe
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,16 +18,15 @@ package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -42,7 +41,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class CloseImeWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
class CloseImeWindowToHomeTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -63,7 +62,7 @@ class CloseImeWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
listOf(
|
||||
ComponentNameMatcher.IME,
|
||||
@@ -78,27 +77,27 @@ class CloseImeWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(ComponentNameMatcher.IME, ComponentNameMatcher.SPLASH_SCREEN)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = testSpec.imeLayerBecomesInvisible()
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = flicker.imeLayerBecomesInvisible()
|
||||
|
||||
@Presubmit @Test fun imeWindowBecomesInvisible() = testSpec.imeWindowBecomesInvisible()
|
||||
@Presubmit @Test fun imeWindowBecomesInvisible() = flicker.imeWindowBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowBecomesInvisible() {
|
||||
testSpec.assertWm { this.isAppWindowVisible(testApp).then().isAppWindowInvisible(testApp) }
|
||||
flicker.assertWm { this.isAppWindowVisible(testApp).then().isAppWindowInvisible(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppLayerBecomesInvisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp).then().isInvisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp).then().isInvisible(testApp) }
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -115,16 +114,10 @@ class CloseImeWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,22 +18,22 @@
|
||||
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesVisible() {
|
||||
fun FlickerTest.imeLayerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(ComponentNameMatcher.IME).then().isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesInvisible() {
|
||||
fun FlickerTest.imeLayerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(ComponentNameMatcher.IME).then().isInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
fun FlickerTest.imeWindowIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(ComponentNameMatcher.IME)
|
||||
@@ -47,7 +47,7 @@ fun FlickerTestParameter.imeWindowIsAlwaysVisible(rotatesScreen: Boolean = false
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesVisible() {
|
||||
fun FlickerTest.imeWindowBecomesVisible() {
|
||||
assertWm {
|
||||
this.isNonAppWindowInvisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
@@ -55,7 +55,7 @@ fun FlickerTestParameter.imeWindowBecomesVisible() {
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesInvisible() {
|
||||
fun FlickerTest.imeWindowBecomesInvisible() {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
|
||||
@@ -18,19 +18,18 @@ package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowInsets.Type.ime
|
||||
import android.view.WindowInsets.Type.navigationBars
|
||||
import android.view.WindowInsets.Type.statusBars
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -47,8 +46,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class LaunchAppShowImeAndDialogThemeAppTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
class LaunchAppShowImeAndDialogThemeAppTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -75,42 +74,36 @@ class LaunchAppShowImeAndDialogThemeAppTest(testSpec: FlickerTestParameter) : Ba
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/** Checks that [ComponentMatcher.IME] layer becomes visible during the transition */
|
||||
@Presubmit @Test fun imeWindowIsAlwaysVisible() = testSpec.imeWindowIsAlwaysVisible()
|
||||
/** Checks that [ComponentNameMatcher.IME] layer becomes visible during the transition */
|
||||
@Presubmit @Test fun imeWindowIsAlwaysVisible() = flicker.imeWindowIsAlwaysVisible()
|
||||
|
||||
/** Checks that [ComponentMatcher.IME] layer is visible at the end of the transition */
|
||||
/** Checks that [ComponentNameMatcher.IME] layer is visible at the end of the transition */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerExistsEnd() {
|
||||
testSpec.assertLayersEnd { this.isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersEnd { this.isVisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
/** Checks that [ComponentMatcher.IME_SNAPSHOT] layer is invisible always. */
|
||||
/** Checks that [ComponentNameMatcher.IME_SNAPSHOT] layer is invisible always. */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeSnapshotNotVisible() {
|
||||
testSpec.assertLayers { this.isInvisible(ComponentNameMatcher.IME_SNAPSHOT) }
|
||||
flicker.assertLayers { this.isInvisible(ComponentNameMatcher.IME_SNAPSHOT) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,18 +17,17 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.ImeStateInitializeHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -73,15 +72,15 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class LaunchAppShowImeOnStartTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
class LaunchAppShowImeOnStartTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
private val initializeApp = ImeStateInitializeHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
initializeApp.launchViaIntent(wmHelper)
|
||||
this.setRotation(testSpec.startRotation)
|
||||
this.setRotation(flicker.scenario.startRotation)
|
||||
}
|
||||
teardown {
|
||||
initializeApp.exit(wmHelper)
|
||||
@@ -93,45 +92,39 @@ class LaunchAppShowImeOnStartTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks that [ComponentMatcher.IME] window becomes visible during the transition */
|
||||
@Presubmit @Test fun imeWindowBecomesVisible() = testSpec.imeWindowBecomesVisible()
|
||||
/** Checks that [ComponentNameMatcher.IME] window becomes visible during the transition */
|
||||
@Presubmit @Test fun imeWindowBecomesVisible() = flicker.imeWindowBecomesVisible()
|
||||
|
||||
/** Checks that [ComponentMatcher.IME] layer becomes visible during the transition */
|
||||
@Presubmit @Test fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
|
||||
/** Checks that [ComponentNameMatcher.IME] layer becomes visible during the transition */
|
||||
@Presubmit @Test fun imeLayerBecomesVisible() = flicker.imeLayerBecomesVisible()
|
||||
|
||||
/** Checks that [ComponentMatcher.IME] layer is invisible at the start of the transition */
|
||||
/** Checks that [ComponentNameMatcher.IME] layer is invisible at the start of the transition */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerNotExistsStart() {
|
||||
testSpec.assertLayersStart { this.isInvisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersStart { this.isInvisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
/** Checks that [ComponentMatcher.IME] layer is visible at the end of the transition */
|
||||
/** Checks that [ComponentNameMatcher.IME] layer is visible at the end of the transition */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerExistsEnd() {
|
||||
testSpec.assertLayersEnd { this.isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersEnd { this.isVisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,17 +19,16 @@ package com.android.server.wm.flicker.ime
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -47,7 +46,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenImeWindowAndCloseTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
class OpenImeWindowAndCloseTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val simpleApp = SimpleAppHelper(instrumentation)
|
||||
private val testApp = ImeAppHelper(instrumentation)
|
||||
|
||||
@@ -62,9 +61,9 @@ class OpenImeWindowAndCloseTest(testSpec: FlickerTestParameter) : BaseTest(testS
|
||||
teardown { simpleApp.exit(wmHelper) }
|
||||
}
|
||||
|
||||
@Presubmit @Test fun imeWindowBecomesInvisible() = testSpec.imeWindowBecomesInvisible()
|
||||
@Presubmit @Test fun imeWindowBecomesInvisible() = flicker.imeWindowBecomesInvisible()
|
||||
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = testSpec.imeLayerBecomesInvisible()
|
||||
@Presubmit @Test fun imeLayerBecomesInvisible() = flicker.imeLayerBecomesInvisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -91,16 +90,10 @@ class OpenImeWindowAndCloseTest(testSpec: FlickerTestParameter) : BaseTest(testS
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,17 +19,16 @@ package com.android.server.wm.flicker.ime
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.snapshotStartingWindowLayerCoversExactlyOnApp
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -46,9 +45,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenImeWindowFromFixedOrientationAppTest(testSpec: FlickerTestParameter) :
|
||||
BaseTest(testSpec) {
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
class OpenImeWindowFromFixedOrientationAppTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -63,61 +61,58 @@ class OpenImeWindowFromFixedOrientationAppTest(testSpec: FlickerTestParameter) :
|
||||
wmHelper.StateSyncBuilder().withHomeActivityVisible().waitForAndVerify()
|
||||
}
|
||||
transitions {
|
||||
// Bring the exist IME activity to the front in landscape mode device rotation.
|
||||
setRotation(Surface.ROTATION_90)
|
||||
// Bring the existing IME activity to the front in landscape mode device rotation.
|
||||
setRotation(PlatformConsts.Rotation.ROTATION_90)
|
||||
imeTestApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
teardown { imeTestApp.exit(wmHelper) }
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeWindowBecomesVisible() = testSpec.imeWindowBecomesVisible()
|
||||
@Presubmit @Test fun imeWindowBecomesVisible() = flicker.imeWindowBecomesVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
|
||||
@Presubmit @Test fun imeLayerBecomesVisible() = flicker.imeLayerBecomesVisible()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun snapshotStartingWindowLayerCoversExactlyOnApp() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp)
|
||||
flicker.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun snapshotStartingWindowLayerCoversExactlyOnApp_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp)
|
||||
flicker.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp)
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_90),
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_90)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,15 +18,14 @@ package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.IwTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -38,7 +37,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
class OpenImeWindowTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -60,35 +59,29 @@ class OpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
layerAlwaysVisible()
|
||||
}
|
||||
|
||||
@Presubmit @Test fun imeWindowBecomesVisible() = testSpec.imeWindowBecomesVisible()
|
||||
@Presubmit @Test fun imeWindowBecomesVisible() = flicker.imeWindowBecomesVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowAlwaysVisibleOnTop() {
|
||||
testSpec.assertWm { this.isAppWindowOnTop(testApp) }
|
||||
flicker.assertWm { this.isAppWindowOnTop(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit @Test fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
|
||||
@Presubmit @Test fun imeLayerBecomesVisible() = flicker.imeLayerBecomesVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun layerAlwaysVisible() {
|
||||
testSpec.assertLayers { this.isVisible(testApp) }
|
||||
flicker.assertLayers { this.isVisible(testApp) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,15 +18,13 @@ package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisibleAtStartAndEnd
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisibleAtStartAndEnd
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
@@ -48,8 +46,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
class OpenImeWindowToOverViewTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -82,7 +80,7 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
*/
|
||||
private fun waitNavStatusBarVisibility(stateSync: WindowManagerStateHelper.StateSyncBuilder) {
|
||||
when {
|
||||
testSpec.isLandscapeOrSeascapeAtStart && !testSpec.isTablet ->
|
||||
flicker.scenario.isLandscapeOrSeascapeAtStart && !flicker.scenario.isTablet ->
|
||||
stateSync.add(WindowManagerConditionsFactory.isStatusBarVisible().negate())
|
||||
else -> stateSync.withNavOrTaskBarVisible().withStatusBarVisible()
|
||||
}
|
||||
@@ -91,25 +89,25 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeWindowIsAlwaysVisible() {
|
||||
testSpec.imeWindowIsAlwaysVisible()
|
||||
flicker.imeWindowIsAlwaysVisible()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsVisibleAtStartAndEnd3Button() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeFalse(testSpec.isGesturalNavigation)
|
||||
testSpec.navBarLayerIsVisibleAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
Assume.assumeFalse(flicker.scenario.isGesturalNavigation)
|
||||
flicker.navBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
/** Bars are expected to be hidden while entering overview in landscape (b/227189877) */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsVisibleAtStartAndEndGestural() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeTrue(testSpec.isGesturalNavigation)
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
Assume.assumeTrue(flicker.scenario.isGesturalNavigation)
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.navBarLayerIsVisibleAtStartAndEnd()
|
||||
flicker.navBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,12 +117,12 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarLayerIsInvisibleInLandscapeGestural() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeTrue(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(testSpec.isGesturalNavigation)
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
Assume.assumeTrue(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(flicker.scenario.isGesturalNavigation)
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayersStart { this.isVisible(ComponentNameMatcher.NAV_BAR) }
|
||||
testSpec.assertLayersEnd { this.isInvisible(ComponentNameMatcher.NAV_BAR) }
|
||||
flicker.assertLayersStart { this.isVisible(ComponentNameMatcher.NAV_BAR) }
|
||||
flicker.assertLayersEnd { this.isInvisible(ComponentNameMatcher.NAV_BAR) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,11 +132,11 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsInvisibleInLandscapePhone() {
|
||||
Assume.assumeTrue(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(testSpec.isGesturalNavigation)
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.assertLayersStart { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
testSpec.assertLayersEnd { this.isInvisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
Assume.assumeTrue(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(flicker.scenario.isGesturalNavigation)
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.assertLayersStart { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
flicker.assertLayersEnd { this.isInvisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,35 +146,31 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsInvisibleInLandscapeTablet() {
|
||||
Assume.assumeTrue(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(testSpec.isGesturalNavigation)
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
Assume.assumeTrue(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(flicker.scenario.isGesturalNavigation)
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
flicker.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@Ignore("Visibility changes depending on orientation and navigation mode")
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() {
|
||||
}
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() {}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@Ignore("Visibility changes depending on orientation and navigation mode")
|
||||
override fun navBarLayerPositionAtStartAndEnd() {
|
||||
}
|
||||
override fun navBarLayerPositionAtStartAndEnd() {}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@Ignore("Visibility changes depending on orientation and navigation mode")
|
||||
override fun statusBarLayerPositionAtStartAndEnd() {
|
||||
}
|
||||
override fun statusBarLayerPositionAtStartAndEnd() {}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@Ignore("Visibility changes depending on orientation and navigation mode")
|
||||
override fun statusBarLayerIsVisibleAtStartAndEnd() {
|
||||
}
|
||||
override fun statusBarLayerIsVisibleAtStartAndEnd() {}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -185,38 +179,38 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsVisibleInPortrait() {
|
||||
Assume.assumeFalse(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
testSpec.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
flicker.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsInvisibleInLandscapeShell() {
|
||||
Assume.assumeTrue(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeTrue(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayersStart { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
testSpec.assertLayersEnd { this.isInvisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
flicker.assertLayersStart { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
flicker.assertLayersEnd { this.isInvisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsVisibleInLandscapeLegacy() {
|
||||
Assume.assumeTrue(testSpec.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
Assume.assumeTrue(flicker.scenario.isLandscapeOrSeascapeAtStart)
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
flicker.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerIsVisibleAndAssociatedWithAppWidow() {
|
||||
testSpec.assertLayersStart {
|
||||
flicker.assertLayersStart {
|
||||
isVisible(ComponentNameMatcher.IME)
|
||||
.visibleRegion(ComponentNameMatcher.IME)
|
||||
.coversAtMost(isVisible(imeTestApp).visibleRegion(imeTestApp).region)
|
||||
}
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.invoke("imeLayerIsVisibleAndAlignAppWidow") {
|
||||
val imeVisibleRegion = it.visibleRegion(ComponentNameMatcher.IME)
|
||||
val appVisibleRegion = it.visibleRegion(imeTestApp)
|
||||
@@ -232,21 +226,13 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedRotations = listOf(Surface.ROTATION_0, Surface.ROTATION_90),
|
||||
supportedNavigationModes =
|
||||
listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY,
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -41,8 +41,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
open class ReOpenImeWindowTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -50,7 +50,7 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
tapl.workspace.switchToOverview().dismissAllTasks()
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
testApp.openIME(wmHelper)
|
||||
this.setRotation(testSpec.startRotation)
|
||||
this.setRotation(flicker.scenario.startRotation)
|
||||
device.pressRecentApps()
|
||||
wmHelper.StateSyncBuilder().withRecentsActivityVisible().waitForAndVerify()
|
||||
}
|
||||
@@ -68,7 +68,7 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
// 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 = ComponentNameMatcher("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
@@ -84,14 +84,14 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
val component = ComponentNameMatcher("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
ignoreWindows =
|
||||
listOf(
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT,
|
||||
component
|
||||
)
|
||||
listOf(
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT,
|
||||
component
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -99,16 +99,14 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.isAppWindowVisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isAppWindowInvisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeWindowIsAlwaysVisible() = testSpec.imeWindowIsAlwaysVisible()
|
||||
@Presubmit @Test fun imeWindowIsAlwaysVisible() = flicker.imeWindowIsAlwaysVisible()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -117,19 +115,19 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
// and exiting overview. 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) }
|
||||
flicker.assertWm { this.isAppWindowVisible(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerBecomesVisible() {
|
||||
testSpec.assertLayers { this.isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayers { this.isVisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayerReplacesLauncher() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
@@ -141,9 +139,10 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(supportedRotations = listOf(Surface.ROTATION_0))
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,19 +19,18 @@ package com.android.server.wm.flicker.ime
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -49,9 +48,9 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Presubmit
|
||||
open class SwitchImeWindowsFromGestureNavTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
open class SwitchImeWindowsFromGestureNavTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, flicker.scenario.startRotation)
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
@@ -63,7 +62,7 @@ open class SwitchImeWindowsFromGestureNavTest(testSpec: FlickerTestParameter) :
|
||||
setup {
|
||||
tapl.setExpectedRotationCheckEnabled(false)
|
||||
tapl.setIgnoreTaskbarVisibility(true)
|
||||
this.setRotation(testSpec.startRotation)
|
||||
this.setRotation(flicker.scenario.startRotation)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
wmHelper.StateSyncBuilder().withFullScreenApp(testApp).waitForAndVerify()
|
||||
|
||||
@@ -143,7 +142,7 @@ open class SwitchImeWindowsFromGestureNavTest(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeAppWindowVisibility() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
isAppWindowVisible(imeTestApp)
|
||||
.then()
|
||||
.isAppSnapshotStartingWindowVisibleFor(testApp, isOptional = true)
|
||||
@@ -159,27 +158,25 @@ open class SwitchImeWindowsFromGestureNavTest(testSpec: FlickerTestParameter) :
|
||||
@FlakyTest(bugId = 244414110)
|
||||
@Test
|
||||
open fun imeLayerIsVisibleWhenSwitchingToImeApp() {
|
||||
testSpec.assertLayersStart { isVisible(ComponentNameMatcher.IME) }
|
||||
testSpec.assertLayersTag(TAG_IME_VISIBLE) { isVisible(ComponentNameMatcher.IME) }
|
||||
testSpec.assertLayersEnd { isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersStart { isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersTag(TAG_IME_VISIBLE) { isVisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersEnd { isVisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
fun imeLayerIsInvisibleWhenSwitchingToTestApp() {
|
||||
testSpec.assertLayersTag(TAG_IME_INVISIBLE) { isInvisible(ComponentNameMatcher.IME) }
|
||||
flicker.assertLayersTag(TAG_IME_INVISIBLE) { isInvisible(ComponentNameMatcher.IME) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
supportedNavigationModes =
|
||||
listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY),
|
||||
supportedRotations = listOf(Surface.ROTATION_0)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_GESTURAL),
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
|
||||
private const val TAG_IME_VISIBLE = "imeVisible"
|
||||
|
||||
@@ -18,10 +18,11 @@ package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
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.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -39,16 +40,14 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class SwitchImeWindowsFromGestureNavTest_ShellTransit(testSpec: FlickerTestParameter) :
|
||||
SwitchImeWindowsFromGestureNavTest(testSpec) {
|
||||
class SwitchImeWindowsFromGestureNavTest_ShellTransit(flicker: FlickerTest) :
|
||||
SwitchImeWindowsFromGestureNavTest(flicker) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
@Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -71,13 +70,13 @@ class SwitchImeWindowsFromGestureNavTest_ShellTransit(testSpec: FlickerTestParam
|
||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||
|
||||
/**
|
||||
* Checks that [ComponentMatcher.NAV_BAR] window is visible and above the app windows at the
|
||||
* Checks that [ComponentNameMatcher.NAV_BAR] window is visible and above the app windows at the
|
||||
* start and end of the WM trace
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun navBarWindowIsVisibleAtStartAndEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarWindowIsVisibleAtStartAndEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarWindowIsVisibleAtStartAndEnd()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.BaseTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.TwoActivitiesAppHelper
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
@@ -57,13 +57,13 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
class ActivitiesTransitionTest(flicker: FlickerTest) : BaseTest(flicker) {
|
||||
private val testApp: TwoActivitiesAppHelper = TwoActivitiesAppHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
setup {
|
||||
tapl.setExpectedRotation(testSpec.startRotation)
|
||||
tapl.setExpectedRotation(flicker.scenario.startRotation.value)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
teardown { testApp.exit(wmHelper) }
|
||||
@@ -91,7 +91,7 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
ActivityOptions.LaunchNewActivity.COMPONENT.toFlickerComponent()
|
||||
val imeAutoFocusActivityComponent =
|
||||
ActivityOptions.SimpleActivity.COMPONENT.toFlickerComponent()
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.isAppWindowOnTop(buttonActivityComponent)
|
||||
.then()
|
||||
.isAppWindowOnTop(imeAutoFocusActivityComponent)
|
||||
@@ -108,7 +108,7 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherWindowNotOnTop() {
|
||||
testSpec.assertWm { this.isAppWindowNotOnTop(ComponentNameMatcher.LAUNCHER) }
|
||||
flicker.assertWm { this.isAppWindowNotOnTop(ComponentNameMatcher.LAUNCHER) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,20 +117,20 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherLayerNotVisible() {
|
||||
testSpec.assertLayers { this.isInvisible(ComponentNameMatcher.LAUNCHER) }
|
||||
flicker.assertLayers { this.isInvisible(ComponentNameMatcher.LAUNCHER) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.CameraAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -41,8 +41,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class OpenAppAfterCameraTest(testSpec: FlickerTestParameter) :
|
||||
OpenAppFromLauncherTransition(testSpec) {
|
||||
open class OpenAppAfterCameraTest(flicker: FlickerTest) : OpenAppFromLauncherTransition(flicker) {
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
@@ -69,13 +68,13 @@ open class OpenAppAfterCameraTest(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -40,8 +40,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenAppAfterCameraTest_ShellTransit(testSpec: FlickerTestParameter) :
|
||||
OpenAppAfterCameraTest(testSpec) {
|
||||
class OpenAppAfterCameraTest_ShellTransit(flicker: FlickerTest) : OpenAppAfterCameraTest(flicker) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
|
||||
@@ -18,13 +18,12 @@ package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -55,17 +54,16 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenAppColdFromIcon(testSpec: FlickerTestParameter) :
|
||||
OpenAppFromLauncherTransition(testSpec) {
|
||||
class OpenAppColdFromIcon(flicker: FlickerTest) : OpenAppFromLauncherTransition(flicker) {
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
if (testSpec.isTablet) {
|
||||
tapl.setExpectedRotation(testSpec.startRotation)
|
||||
if (flicker.scenario.isTablet) {
|
||||
tapl.setExpectedRotation(flicker.scenario.startRotation.value)
|
||||
} else {
|
||||
tapl.setExpectedRotation(Surface.ROTATION_0)
|
||||
tapl.setExpectedRotation(PlatformConsts.Rotation.ROTATION_0.value)
|
||||
}
|
||||
RemoveAllTasksButHomeRule.removeAllTasksButHome()
|
||||
}
|
||||
@@ -180,19 +178,16 @@ class OpenAppColdFromIcon(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
// TAPL fails on landscape mode b/240916028
|
||||
.getConfigNonRotationTests(
|
||||
supportedNavigationModes = listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY
|
||||
)
|
||||
)
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
// TAPL fails on landscape mode b/240916028
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedNavigationModes = listOf(PlatformConsts.NavBar.MODE_3BUTTON)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ package com.android.server.wm.flicker.launch
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.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.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.annotation.FlickerServiceCompatible
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -57,15 +57,14 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class OpenAppColdTest(testSpec: FlickerTestParameter) :
|
||||
OpenAppFromLauncherTransition(testSpec) {
|
||||
open class OpenAppColdTest(flicker: FlickerTest) : OpenAppFromLauncherTransition(flicker) {
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
removeAllTasksButHome()
|
||||
this.setRotation(testSpec.startRotation)
|
||||
this.setRotation(flicker.scenario.startRotation)
|
||||
}
|
||||
teardown { testApp.exit(wmHelper) }
|
||||
transitions { testApp.launchViaIntent(wmHelper) }
|
||||
@@ -83,13 +82,13 @@ open class OpenAppColdTest(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,28 +17,27 @@
|
||||
package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.replacesLayer
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Test
|
||||
|
||||
/** Base class for app launch tests */
|
||||
abstract class OpenAppFromLauncherTransition(testSpec: FlickerTestParameter) :
|
||||
OpenAppTransition(testSpec) {
|
||||
abstract class OpenAppFromLauncherTransition(flicker: FlickerTest) : OpenAppTransition(flicker) {
|
||||
|
||||
/** Checks that the focus changes from the [ComponentMatcher.LAUNCHER] to [testApp] */
|
||||
/** Checks that the focus changes from the [ComponentNameMatcher.LAUNCHER] to [testApp] */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun focusChanges() {
|
||||
testSpec.assertEventLog { this.focusChanges("NexusLauncherActivity", testApp.`package`) }
|
||||
flicker.assertEventLog { this.focusChanges("NexusLauncherActivity", testApp.`package`) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [ComponentMatcher.LAUNCHER] layer is visible at the start of the transition, and
|
||||
* is replaced by [testApp], which remains visible until the end
|
||||
* Checks that [ComponentNameMatcher.LAUNCHER] layer is visible at the start of the transition,
|
||||
* and is replaced by [testApp], which remains visible until the end
|
||||
*/
|
||||
open fun appLayerReplacesLauncher() {
|
||||
testSpec.replacesLayer(
|
||||
flicker.replacesLayer(
|
||||
ComponentNameMatcher.LAUNCHER,
|
||||
testApp,
|
||||
ignoreEntriesWithRotationLayer = true,
|
||||
@@ -48,14 +47,14 @@ abstract class OpenAppFromLauncherTransition(testSpec: FlickerTestParameter) :
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [ComponentMatcher.LAUNCHER] window is the top window at the start of the
|
||||
* transition, and is replaced by a [ComponentMatcher.SNAPSHOT] or
|
||||
* [ComponentMatcher.SPLASH_SCREEN], or [testApp], which remains visible until the end
|
||||
* Checks that [ComponentNameMatcher.LAUNCHER] window is the top window at the start of the
|
||||
* transition, and is replaced by a [ComponentNameMatcher.SNAPSHOT] or
|
||||
* [ComponentNameMatcher.SPLASH_SCREEN], or [testApp], which remains visible until the end
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appWindowReplacesLauncherAsTopWindow() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.isAppWindowOnTop(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isAppWindowOnTop(
|
||||
@@ -68,6 +67,6 @@ abstract class OpenAppFromLauncherTransition(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appWindowAsTopWindowAtEnd() {
|
||||
testSpec.assertWmEnd { this.isAppWindowOnTop(testApp) }
|
||||
flicker.assertWmEnd { this.isAppWindowOnTop(testApp) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Ignore
|
||||
@@ -44,8 +44,8 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Postsubmit
|
||||
open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
|
||||
OpenAppFromNotificationCold(testSpec) {
|
||||
open class OpenAppFromLockNotificationCold(flicker: FlickerTest) :
|
||||
OpenAppFromNotificationCold(flicker) {
|
||||
|
||||
override val openingNotificationsFromLockScreen = true
|
||||
|
||||
@@ -93,8 +93,9 @@ open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
|
||||
* Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the
|
||||
* transition
|
||||
*/
|
||||
@Presubmit @Test override fun statusBarLayerPositionAtEnd() =
|
||||
super.statusBarLayerPositionAtEnd()
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun statusBarLayerPositionAtEnd() = super.statusBarLayerPositionAtEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@@ -119,13 +120,13 @@ open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ package com.android.server.wm.flicker.launch
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -43,8 +43,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
OpenAppFromNotificationWarm(testSpec) {
|
||||
class OpenAppFromLockNotificationWarm(flicker: FlickerTest) : OpenAppFromNotificationWarm(flicker) {
|
||||
|
||||
override val openingNotificationsFromLockScreen = true
|
||||
|
||||
@@ -70,7 +69,7 @@ class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
@Test
|
||||
@Presubmit
|
||||
fun appWindowBecomesFirstAndOnlyTopWindow() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.hasNoVisibleAppWindow()
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
@@ -85,7 +84,7 @@ class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
@Test
|
||||
@Presubmit
|
||||
fun screenLockedStart() {
|
||||
testSpec.assertWmStart { isKeyguardShowing() }
|
||||
flicker.assertWmStart { isKeyguardShowing() }
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -108,7 +107,7 @@ class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
* Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the
|
||||
* transition
|
||||
*/
|
||||
@Presubmit @Test fun statusBarLayerPositionAtEnd() = testSpec.statusBarLayerPositionAtEnd()
|
||||
@Presubmit @Test fun statusBarLayerPositionAtEnd() = flicker.statusBarLayerPositionAtEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@@ -133,13 +132,13 @@ class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.ShowWhenLockedAppHelper
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -44,8 +44,8 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Postsubmit
|
||||
class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParameter) :
|
||||
OpenAppFromLockNotificationCold(testSpec) {
|
||||
class OpenAppFromLockNotificationWithLockOverlayApp(flicker: FlickerTest) :
|
||||
OpenAppFromLockNotificationCold(flicker) {
|
||||
private val showWhenLockedApp: ShowWhenLockedAppHelper =
|
||||
ShowWhenLockedAppHelper(instrumentation)
|
||||
|
||||
@@ -74,7 +74,7 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
|
||||
@Test
|
||||
@FlakyTest(bugId = 227143265)
|
||||
fun showWhenLockedAppWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.hasNoVisibleAppWindow()
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
@@ -86,7 +86,7 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
|
||||
@Test
|
||||
@FlakyTest(bugId = 227143265)
|
||||
fun showWhenLockedAppLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
flicker.assertLayers {
|
||||
this.isInvisible(showWhenLockedApp)
|
||||
.then()
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
@@ -107,20 +107,19 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 209599395)
|
||||
@Test
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() =
|
||||
super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.platform.test.annotations.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtEnd
|
||||
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
@@ -28,8 +28,7 @@ import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
|
||||
/** Base class for app launch tests from lock screen */
|
||||
abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
OpenAppTransition(testSpec) {
|
||||
abstract class OpenAppFromLockTransition(flicker: FlickerTest) : OpenAppTransition(flicker) {
|
||||
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -46,7 +45,7 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun focusChanges() {
|
||||
testSpec.assertEventLog { this.focusChanges("", testApp.`package`) }
|
||||
flicker.assertEventLog { this.focusChanges("", testApp.`package`) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +55,7 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
@FlakyTest(bugId = 203538234)
|
||||
@Test
|
||||
open fun appWindowBecomesFirstAndOnlyTopWindow() {
|
||||
testSpec.assertWm {
|
||||
flicker.assertWm {
|
||||
this.hasNoVisibleAppWindow()
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
@@ -71,7 +70,7 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
fun screenLockedStart() {
|
||||
testSpec.assertLayersStart { isEmpty() }
|
||||
flicker.assertLayersStart { isEmpty() }
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -99,16 +98,16 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
@Ignore("Not applicable to this CUJ. Display starts off and app is full screen at the end")
|
||||
override fun taskBarWindowIsAlwaysVisible() {}
|
||||
|
||||
/** Checks the position of the [ComponentMatcher.NAV_BAR] at the end of the transition */
|
||||
/** Checks the position of the [ComponentNameMatcher.NAV_BAR] at the end of the transition */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerPositionAtEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarLayerPositionAtEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarLayerPositionAtEnd()
|
||||
}
|
||||
|
||||
/** Checks the position of the [ComponentMatcher.STATUS_BAR] at the end of the transition */
|
||||
@Presubmit @Test fun statusBarLayerPositionAtEnd() = testSpec.statusBarLayerPositionAtEnd()
|
||||
/** Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the end of the transition */
|
||||
@Presubmit @Test fun statusBarLayerPositionAtEnd() = flicker.statusBarLayerPositionAtEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@@ -116,13 +115,13 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
override fun statusBarLayerIsVisibleAtStartAndEnd() {}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.STATUS_BAR] layer is visible at the end of the trace
|
||||
* Checks that the [ComponentNameMatcher.STATUS_BAR] layer is visible at the end of the trace
|
||||
*
|
||||
* It is not possible to check at the start because the screen is off
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsVisibleAtEnd() {
|
||||
testSpec.assertLayersEnd { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
flicker.assertLayersEnd { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ package com.android.server.wm.flicker.launch
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -44,8 +44,8 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Postsubmit
|
||||
open class OpenAppFromNotificationCold(testSpec: FlickerTestParameter) :
|
||||
OpenAppFromNotificationWarm(testSpec) {
|
||||
open class OpenAppFromNotificationCold(flicker: FlickerTest) :
|
||||
OpenAppFromNotificationWarm(flicker) {
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -61,13 +61,9 @@ open class OpenAppFromNotificationCold(testSpec: FlickerTestParameter) :
|
||||
}
|
||||
}
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun appWindowBecomesVisible() = appWindowBecomesVisible_coldStart()
|
||||
@Postsubmit @Test override fun appWindowBecomesVisible() = appWindowBecomesVisible_coldStart()
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun appLayerBecomesVisible() = appLayerBecomesVisible_coldStart()
|
||||
@Postsubmit @Test override fun appLayerBecomesVisible() = appLayerBecomesVisible_coldStart()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@@ -89,9 +85,7 @@ open class OpenAppFromNotificationCold(testSpec: FlickerTestParameter) :
|
||||
* Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerPositionAtEnd() = testSpec.statusBarLayerPositionAtEnd()
|
||||
@Presubmit @Test open fun statusBarLayerPositionAtEnd() = flicker.statusBarLayerPositionAtEnd()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@@ -107,13 +101,13 @@ open class OpenAppFromNotificationCold(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,13 +24,13 @@ import android.view.WindowInsets
|
||||
import android.view.WindowManager
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.NotificationAppHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisibleAtEnd
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtEnd
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisibleAtEnd
|
||||
@@ -56,8 +56,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
OpenAppTransition(testSpec) {
|
||||
open class OpenAppFromNotificationWarm(flicker: FlickerTest) : OpenAppTransition(flicker) {
|
||||
override val testApp: NotificationAppHelper = NotificationAppHelper(instrumentation)
|
||||
|
||||
open val openingNotificationsFromLockScreen = false
|
||||
@@ -67,7 +66,7 @@ open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
get() = {
|
||||
setup {
|
||||
device.wakeUpAndGoToHomeScreen()
|
||||
this.setRotation(testSpec.startRotation)
|
||||
this.setRotation(flicker.scenario.startRotation)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
wmHelper.StateSyncBuilder().withFullScreenApp(testApp).waitForAndVerify()
|
||||
testApp.postNotification(wmHelper)
|
||||
@@ -120,19 +119,19 @@ open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun notificationAppWindowVisibleAtEnd() {
|
||||
testSpec.assertWmEnd { this.isAppWindowVisible(testApp) }
|
||||
flicker.assertWmEnd { this.isAppWindowVisible(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun notificationAppWindowOnTopAtEnd() {
|
||||
testSpec.assertWmEnd { this.isAppWindowOnTop(testApp) }
|
||||
flicker.assertWmEnd { this.isAppWindowOnTop(testApp) }
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun notificationAppLayerVisibleAtEnd() {
|
||||
testSpec.assertLayersEnd { this.isVisible(testApp) }
|
||||
flicker.assertLayersEnd { this.isVisible(testApp) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,8 +143,8 @@ open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun taskBarWindowIsVisibleAtEnd() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.taskBarWindowIsVisibleAtEnd()
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
flicker.taskBarWindowIsVisibleAtEnd()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,31 +155,31 @@ open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun taskBarLayerIsVisibleAtEnd() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.taskBarLayerIsVisibleAtEnd()
|
||||
Assume.assumeTrue(flicker.scenario.isTablet)
|
||||
flicker.taskBarLayerIsVisibleAtEnd()
|
||||
}
|
||||
|
||||
/** Checks the position of the [ComponentNameMatcher.NAV_BAR] at the end of the transition */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerPositionAtEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarLayerPositionAtEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarLayerPositionAtEnd()
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsVisibleAtEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarLayerIsVisibleAtEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarLayerIsVisibleAtEnd()
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsVisibleAtEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.navBarWindowIsVisibleAtEnd()
|
||||
Assume.assumeFalse(flicker.scenario.isTablet)
|
||||
flicker.navBarWindowIsVisibleAtEnd()
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@@ -203,13 +202,13 @@ open class OpenAppFromNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring repetitions,
|
||||
* screen orientation and navigation modes.
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests()
|
||||
fun getParams(): Collection<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user