diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt index 6f1ff99cb0b32..8765ad1596a54 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt @@ -45,14 +45,23 @@ fun FlickerTestParameter.appPairsDividerBecomesVisible() { fun FlickerTestParameter.splitScreenEntered( component1: IComponentMatcher, component2: IComponentMatcher, - fromOtherApp: Boolean + fromOtherApp: Boolean, + appExistAtStart: Boolean = true ) { if (fromOtherApp) { - appWindowIsInvisibleAtStart(component1) + if (appExistAtStart) { + appWindowIsInvisibleAtStart(component1) + } else { + appWindowIsNotContainAtStart(component1) + } } else { appWindowIsVisibleAtStart(component1) } - appWindowIsInvisibleAtStart(component2) + if (appExistAtStart) { + appWindowIsInvisibleAtStart(component2) + } else { + appWindowIsNotContainAtStart(component2) + } splitScreenDividerIsInvisibleAtStart() appWindowIsVisibleAtEnd(component1) @@ -315,6 +324,10 @@ fun FlickerTestParameter.appWindowIsInvisibleAtEnd(component: IComponentMatcher) assertWmEnd { this.isAppWindowInvisible(component) } } +fun FlickerTestParameter.appWindowIsNotContainAtStart(component: IComponentMatcher) { + assertWmStart { this.notContains(component) } +} + fun FlickerTestParameter.appWindowKeepVisible(component: IComponentMatcher) { assertWm { this.isAppWindowVisible(component) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromShortcut.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromShortcut.kt index 1a29193e7517c..e9c765ae37972 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromShortcut.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromShortcut.kt @@ -23,7 +23,6 @@ import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.dsl.FlickerBuilder -import com.android.wm.shell.flicker.appWindowBecomesVisible import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd import com.android.wm.shell.flicker.layerBecomesVisible import com.android.wm.shell.flicker.layerIsVisibleAtEnd @@ -78,7 +77,8 @@ class EnterSplitScreenByDragFromShortcut( @Postsubmit @Test - fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false) + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, + fromOtherApp = false, appExistAtStart = false) @Postsubmit @Test @@ -108,7 +108,15 @@ class EnterSplitScreenByDragFromShortcut( @Postsubmit @Test - fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp) + fun secondaryAppWindowBecomesVisible() { + testSpec.assertWm { + this.notContains(secondaryApp) + .then() + .isAppWindowInvisible(secondaryApp, isOptional = true) + .then() + .isAppWindowVisible(secondaryApp) + } + } /** {@inheritDoc} */ @Postsubmit