From e623c1d6228990c2a79cff3a3212a6c28372d327 Mon Sep 17 00:00:00 2001 From: Chilun Huang Date: Tue, 27 Sep 2022 17:46:31 +0800 Subject: [PATCH] Add cujCompleted for Ironwood Add cujCompleted for Ironwood to focus on accomplishing user goals. Bug: 225582520 Test: atest --test-mapping frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell:ironwood-postsubmit Change-Id: I21043838da1173c497d8a9d0a009ea47cc15b4dc --- .../wm/shell/flicker/CommonAssertions.kt | 84 +++++++++++++++++++ .../flicker/splitscreen/CopyContentInSplit.kt | 24 ++++-- .../DismissSplitScreenByDivider.kt | 11 ++- .../splitscreen/DismissSplitScreenByGoHome.kt | 10 +-- .../splitscreen/DragDividerToResize.kt | 25 ++++-- .../EnterSplitScreenByDragFromAllApps.kt | 12 ++- .../EnterSplitScreenByDragFromNotification.kt | 12 ++- .../EnterSplitScreenByDragFromTaskbar.kt | 12 ++- .../EnterSplitScreenFromOverview.kt | 11 ++- .../SwitchAppByDoubleTapDivider.kt | 23 +++-- .../SwitchBackToSplitFromAnotherApp.kt | 11 ++- .../splitscreen/SwitchBackToSplitFromHome.kt | 11 ++- .../SwitchBackToSplitFromRecent.kt | 11 ++- 13 files changed, 184 insertions(+), 73 deletions(-) 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 55979905cc4f4..0d0f0bdd1f03b 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 @@ -46,6 +46,66 @@ fun FlickerTestParameter.appPairsDividerBecomesVisible() { } } +fun FlickerTestParameter.splitScreenEntered( + component1: IComponentMatcher, + component2: IComponentMatcher, + fromOtherApp: Boolean +) { + if (fromOtherApp) { + appWindowIsInvisibleAtStart(component1) + } else { + appWindowIsVisibleAtStart(component1) + } + appWindowIsInvisibleAtStart(component2) + splitScreenDividerIsInvisibleAtStart() + + appWindowIsVisibleAtEnd(component1) + appWindowIsVisibleAtEnd(component2) + splitScreenDividerIsVisibleAtEnd() +} + +fun FlickerTestParameter.splitScreenDismissed( + component1: IComponentMatcher, + component2: IComponentMatcher, + toHome: Boolean +) { + appWindowIsVisibleAtStart(component1) + appWindowIsVisibleAtStart(component2) + splitScreenDividerIsVisibleAtStart() + + appWindowIsInvisibleAtEnd(component1) + if (toHome) { + appWindowIsInvisibleAtEnd(component2) + } else { + appWindowIsVisibleAtEnd(component2) + } + splitScreenDividerIsInvisibleAtEnd() +} + +fun FlickerTestParameter.splitScreenDividerIsVisibleAtStart() { + assertLayersStart { + this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) + } +} + +fun FlickerTestParameter.splitScreenDividerIsVisibleAtEnd() { + assertLayersEnd { + this.isVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) + } +} + +fun FlickerTestParameter.splitScreenDividerIsInvisibleAtStart() { + assertLayersStart { + this.isInvisible(SPLIT_SCREEN_DIVIDER_COMPONENT) + } +} + +fun FlickerTestParameter.splitScreenDividerIsInvisibleAtEnd() { + assertLayersEnd { + this.isInvisible(SPLIT_SCREEN_DIVIDER_COMPONENT) + } +} + fun FlickerTestParameter.splitScreenDividerBecomesVisible() { layerBecomesVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) } @@ -271,6 +331,14 @@ fun FlickerTestParameter.appWindowBecomesInvisible( } } +fun FlickerTestParameter.appWindowIsVisibleAtStart( + component: IComponentMatcher +) { + assertWmStart { + this.isAppWindowVisible(component) + } +} + fun FlickerTestParameter.appWindowIsVisibleAtEnd( component: IComponentMatcher ) { @@ -279,6 +347,22 @@ fun FlickerTestParameter.appWindowIsVisibleAtEnd( } } +fun FlickerTestParameter.appWindowIsInvisibleAtStart( + component: IComponentMatcher +) { + assertWmStart { + this.isAppWindowInvisible(component) + } +} + +fun FlickerTestParameter.appWindowIsInvisibleAtEnd( + component: IComponentMatcher +) { + assertWmEnd { + this.isAppWindowInvisible(component) + } +} + fun FlickerTestParameter.appWindowKeepVisible( component: IComponentMatcher ) { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt index 7dbd27949bdd3..5b044e3fcbc3e 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt @@ -27,9 +27,13 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group1 import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT +import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd +import com.android.wm.shell.flicker.appWindowIsVisibleAtStart import com.android.wm.shell.flicker.appWindowKeepVisible import com.android.wm.shell.flicker.layerKeepVisible import com.android.wm.shell.flicker.splitAppLayerBoundsKeepVisible +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 @@ -62,38 +66,46 @@ class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testS } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() { + testSpec.appWindowIsVisibleAtStart(primaryApp) + testSpec.appWindowIsVisibleAtStart(textEditApp) + testSpec.splitScreenDividerIsVisibleAtStart() + + testSpec.appWindowIsVisibleAtEnd(primaryApp) + testSpec.appWindowIsVisibleAtEnd(textEditApp) + testSpec.splitScreenDividerIsVisibleAtEnd() + + // The validation of copied text is already done in SplitScreenUtils.copyContentInSplit() + } + @Presubmit @Test fun splitScreenDividerKeepVisible() = testSpec.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerKeepVisible() = testSpec.layerKeepVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun textEditAppLayerKeepVisible() = testSpec.layerKeepVisible(textEditApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsKeepVisible() = testSpec.splitAppLayerBoundsKeepVisible( primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun textEditAppBoundsKeepVisible() = testSpec.splitAppLayerBoundsKeepVisible( textEditApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowKeepVisible() = testSpec.appWindowKeepVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun textEditAppWindowKeepVisible() = testSpec.appWindowKeepVisible(textEditApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByDivider.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByDivider.kt index 3646fd7f0177a..838026fdc6a66 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByDivider.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByDivider.kt @@ -33,6 +33,7 @@ import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd import com.android.wm.shell.flicker.layerBecomesInvisible import com.android.wm.shell.flicker.layerIsVisibleAtEnd import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesInvisible +import com.android.wm.shell.flicker.splitScreenDismissed import com.android.wm.shell.flicker.splitScreenDividerBecomesInvisible import org.junit.FixMethodOrder import org.junit.Test @@ -73,27 +74,27 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenDismissed(primaryApp, secondaryApp, toHome = false) + @Presubmit @Test fun splitScreenDividerBecomesInvisible() = testSpec.splitScreenDividerBecomesInvisible() - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerBecomesInvisible() = testSpec.layerBecomesInvisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible( primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsIsFullscreenAtEnd() { @@ -116,12 +117,10 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen } } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowBecomesInvisible() = testSpec.appWindowBecomesInvisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByGoHome.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByGoHome.kt index 80abedd476e6e..a764206fb33e9 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByGoHome.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DismissSplitScreenByGoHome.kt @@ -30,6 +30,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.wm.shell.flicker.appWindowBecomesInvisible import com.android.wm.shell.flicker.layerBecomesInvisible import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesInvisible +import com.android.wm.shell.flicker.splitScreenDismissed import com.android.wm.shell.flicker.splitScreenDividerBecomesInvisible import org.junit.FixMethodOrder import org.junit.Test @@ -64,13 +65,15 @@ class DismissSplitScreenByGoHome( .waitForAndVerify() } } - @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenDismissed(primaryApp, secondaryApp, toHome = true) + @Presubmit @Test fun splitScreenDividerBecomesInvisible() = testSpec.splitScreenDividerBecomesInvisible() - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerBecomesInvisible() = testSpec.layerBecomesInvisible(primaryApp) @@ -86,18 +89,15 @@ class DismissSplitScreenByGoHome( fun primaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible( primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsBecomesInvisible() = testSpec.splitAppLayerBoundsBecomesInvisible( secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowBecomesInvisible() = testSpec.appWindowBecomesInvisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowBecomesInvisible() = testSpec.appWindowBecomesInvisible(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DragDividerToResize.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DragDividerToResize.kt index 2915787d5a434..ba02317556905 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DragDividerToResize.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/DragDividerToResize.kt @@ -28,9 +28,13 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group1 import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT +import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd +import com.android.wm.shell.flicker.appWindowIsVisibleAtStart import com.android.wm.shell.flicker.appWindowKeepVisible import com.android.wm.shell.flicker.layerKeepVisible import com.android.wm.shell.flicker.splitAppLayerBoundsChanges +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 @@ -61,16 +65,29 @@ class DragDividerToResize (testSpec: FlickerTestParameter) : SplitScreenBase(tes } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() { + testSpec.appWindowIsVisibleAtStart(primaryApp) + testSpec.appWindowIsVisibleAtStart(secondaryApp) + testSpec.splitScreenDividerIsVisibleAtStart() + + testSpec.appWindowIsVisibleAtEnd(primaryApp) + testSpec.appWindowIsVisibleAtEnd(secondaryApp) + testSpec.splitScreenDividerIsVisibleAtEnd() + + // TODO(b/246490534): Add validation for resized app after withAppTransitionIdle is + // robust enough to get the correct end state. + } + @Presubmit @Test fun splitScreenDividerKeepVisible() = testSpec.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerKeepVisible() = testSpec.layerKeepVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerVisibilityChanges() { @@ -83,23 +100,19 @@ class DragDividerToResize (testSpec: FlickerTestParameter) : SplitScreenBase(tes } } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowKeepVisible() = testSpec.appWindowKeepVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowKeepVisible() = testSpec.appWindowKeepVisible(secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsChanges() = testSpec.splitAppLayerBoundsChanges( primaryApp, landscapePosLeft = true, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsChanges() = testSpec.splitAppLayerBoundsChanges( diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromAllApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromAllApps.kt index 8e041a703802a..bb4478940939f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromAllApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromAllApps.kt @@ -35,6 +35,7 @@ import com.android.wm.shell.flicker.layerIsVisibleAtEnd import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisibleByDrag import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible +import com.android.wm.shell.flicker.splitScreenEntered import org.junit.Assume import org.junit.Before import org.junit.FixMethodOrder @@ -80,6 +81,10 @@ class EnterSplitScreenByDragFromAllApps( } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false) + @Presubmit @Test fun splitScreenDividerBecomesVisible() { @@ -88,7 +93,6 @@ class EnterSplitScreenByDragFromAllApps( } // TODO(b/245472831): Back to splitScreenDividerBecomesVisible after shell transition ready. - @IwTest(focusArea = "sysui") @Presubmit @Test fun splitScreenDividerIsVisibleAtEnd_ShellTransit() { @@ -98,12 +102,10 @@ class EnterSplitScreenByDragFromAllApps( } } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerBecomesVisible() { @@ -127,24 +129,20 @@ class EnterSplitScreenByDragFromAllApps( testSpec.layerBecomesVisible(secondaryApp) } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( primaryApp, landscapePosLeft = false, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisibleByDrag( secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt index 047bcfe6d2004..559219683ea4d 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt @@ -36,6 +36,7 @@ import com.android.wm.shell.flicker.layerIsVisibleAtEnd import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisibleByDrag import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible +import com.android.wm.shell.flicker.splitScreenEntered import org.junit.Assume import org.junit.Before import org.junit.FixMethodOrder @@ -92,6 +93,10 @@ class EnterSplitScreenByDragFromNotification( } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false) + @Presubmit @Test fun splitScreenDividerBecomesVisible() { @@ -100,7 +105,6 @@ class EnterSplitScreenByDragFromNotification( } // TODO(b/245472831): Back to splitScreenDividerBecomesVisible after shell transition ready. - @IwTest(focusArea = "sysui") @Presubmit @Test fun splitScreenDividerIsVisibleAtEnd_ShellTransit() { @@ -110,12 +114,10 @@ class EnterSplitScreenByDragFromNotification( } } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerBecomesVisible() { @@ -139,24 +141,20 @@ class EnterSplitScreenByDragFromNotification( testSpec.layerBecomesVisible(sendNotificationApp) } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( primaryApp, landscapePosLeft = false, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisibleByDrag( sendNotificationApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(sendNotificationApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromTaskbar.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromTaskbar.kt index a11874e002283..84d2e6a42d27c 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromTaskbar.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromTaskbar.kt @@ -35,6 +35,7 @@ import com.android.wm.shell.flicker.layerIsVisibleAtEnd import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisibleByDrag import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible +import com.android.wm.shell.flicker.splitScreenEntered import org.junit.Assume import org.junit.Before import org.junit.FixMethodOrder @@ -83,6 +84,10 @@ class EnterSplitScreenByDragFromTaskbar( } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false) + @Presubmit @Test fun splitScreenDividerBecomesVisible() { @@ -91,7 +96,6 @@ class EnterSplitScreenByDragFromTaskbar( } // TODO(b/245472831): Back to splitScreenDividerBecomesVisible after shell transition ready. - @IwTest(focusArea = "sysui") @Presubmit @Test fun splitScreenDividerIsVisibleAtEnd_ShellTransit() { @@ -101,12 +105,10 @@ class EnterSplitScreenByDragFromTaskbar( } } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerBecomesVisible() { @@ -130,24 +132,20 @@ class EnterSplitScreenByDragFromTaskbar( testSpec.layerBecomesVisible(secondaryApp) } - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( primaryApp, landscapePosLeft = false, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisibleByDrag( secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenFromOverview.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenFromOverview.kt index 6064b52938c85..23623aaf2d00e 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenFromOverview.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenFromOverview.kt @@ -31,6 +31,7 @@ import com.android.wm.shell.flicker.layerIsVisibleAtEnd import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisible import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible +import com.android.wm.shell.flicker.splitScreenEntered import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -69,38 +70,36 @@ class EnterSplitScreenFromOverview(testSpec: FlickerTestParameter) : SplitScreen } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true) + @Presubmit @Test fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible() - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisible( secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchAppByDoubleTapDivider.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchAppByDoubleTapDivider.kt index f06dd66f61d28..025bb40856249 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchAppByDoubleTapDivider.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchAppByDoubleTapDivider.kt @@ -31,9 +31,12 @@ import com.android.server.wm.flicker.helpers.isRotated 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 +import com.android.wm.shell.flicker.appWindowIsVisibleAtStart import com.android.wm.shell.flicker.layerIsVisibleAtEnd import com.android.wm.shell.flicker.layerKeepVisible import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd +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 @@ -109,21 +112,33 @@ class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenB } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() { + testSpec.appWindowIsVisibleAtStart(primaryApp) + testSpec.appWindowIsVisibleAtStart(secondaryApp) + testSpec.splitScreenDividerIsVisibleAtStart() + + testSpec.appWindowIsVisibleAtEnd(primaryApp) + testSpec.appWindowIsVisibleAtEnd(secondaryApp) + testSpec.splitScreenDividerIsVisibleAtEnd() + + // TODO(b/246490534): Add validation for switched app after withAppTransitionIdle is + // robust enough to get the correct end state. + } + @Presubmit @Test fun splitScreenDividerKeepVisible() = testSpec.layerKeepVisible(SPLIT_SCREEN_DIVIDER_COMPONENT) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerIsVisibleAtEnd() = testSpec.layerIsVisibleAtEnd(secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( @@ -136,12 +151,10 @@ class SwitchAppByDoubleTapDivider(testSpec: FlickerTestParameter) : SplitScreenB fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( secondaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowIsVisibleAtEnd() = testSpec.appWindowIsVisibleAtEnd(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromAnotherApp.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromAnotherApp.kt index 5c30116432705..9947a53dda423 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromAnotherApp.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromAnotherApp.kt @@ -30,6 +30,7 @@ import com.android.wm.shell.flicker.appWindowBecomesVisible import com.android.wm.shell.flicker.layerBecomesVisible import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible +import com.android.wm.shell.flicker.splitScreenEntered import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -67,38 +68,36 @@ class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScr } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true) + @Presubmit @Test fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible() - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromHome.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromHome.kt index 9c66a3734da33..3716dc98714ca 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromHome.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromHome.kt @@ -30,6 +30,7 @@ import com.android.wm.shell.flicker.appWindowBecomesVisible import com.android.wm.shell.flicker.layerBecomesVisible import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible +import com.android.wm.shell.flicker.splitScreenEntered import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -66,38 +67,36 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true) + @Presubmit @Test fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible() - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromRecent.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromRecent.kt index e8862bd4c982b..db07f2132e95e 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromRecent.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SwitchBackToSplitFromRecent.kt @@ -30,6 +30,7 @@ import com.android.wm.shell.flicker.appWindowBecomesVisible import com.android.wm.shell.flicker.layerBecomesVisible import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible +import com.android.wm.shell.flicker.splitScreenEntered import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -68,38 +69,36 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB } @IwTest(focusArea = "sysui") + @Presubmit + @Test + fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = true) + @Presubmit @Test fun splitScreenDividerBecomesVisible() = testSpec.splitScreenDividerBecomesVisible() - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppLayerBecomesVisible() = testSpec.layerBecomesVisible(secondaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( primaryApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd( secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true) - @IwTest(focusArea = "sysui") @Presubmit @Test fun primaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(primaryApp) - @IwTest(focusArea = "sysui") @Presubmit @Test fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)