From 69147f18e4cae682e7f8b4a7e7a76bd96fb0798e Mon Sep 17 00:00:00 2001 From: Pablo Gamito Date: Tue, 19 Sep 2023 15:12:11 +0000 Subject: Update expected CUJ for DismissSplitScreenByGoHome We don't seem to trigger a SPLIT_SCREEN_EXIT in this case yet. Bug: 301222449 Test: atest com.android.wm.shell.flicker.service.splitscreen.flicker.DismissSplitScreenByGoHomeGesturalNavPortrait Change-Id: I478f00db59a30188ac7038fac8172a6397294b2e --- .../flicker/DismissSplitScreenByGoHomeGesturalNavLandscape.kt | 2 +- .../flicker/DismissSplitScreenByGoHomeGesturalNavPortrait.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavLandscape.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavLandscape.kt index aa35237b615f..a8f4d0a24c7e 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavLandscape.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavLandscape.kt @@ -31,7 +31,7 @@ import org.junit.runner.RunWith class DismissSplitScreenByGoHomeGesturalNavLandscape : DismissSplitScreenByGoHome(Rotation.ROTATION_90) { - @ExpectedScenarios(["SPLIT_SCREEN_EXIT"]) + @ExpectedScenarios(["APP_CLOSE_TO_HOME"]) // SPLIT_SCREEN_EXIT not yet tagged here (b/301222449) @Test override fun dismissSplitScreenByGoHome() = super.dismissSplitScreenByGoHome() diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavPortrait.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavPortrait.kt index e195360cdc36..cee9bbfb4aa4 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavPortrait.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/flicker/DismissSplitScreenByGoHomeGesturalNavPortrait.kt @@ -31,7 +31,7 @@ import org.junit.runner.RunWith class DismissSplitScreenByGoHomeGesturalNavPortrait : DismissSplitScreenByGoHome(Rotation.ROTATION_0) { - @ExpectedScenarios(["SPLIT_SCREEN_EXIT"]) + @ExpectedScenarios(["APP_CLOSE_TO_HOME"]) // SPLIT_SCREEN_EXIT not yet tagged here (b/301222449) @Test override fun dismissSplitScreenByGoHome() = super.dismissSplitScreenByGoHome() -- cgit v1.2.3-59-g8ed1b From 1ffa69e112f052d3a33ff5f926f97bd601e82ed1 Mon Sep 17 00:00:00 2001 From: Pablo Gamito Date: Wed, 20 Sep 2023 10:48:32 +0000 Subject: Fix tapl unexpected rotation errors Bug: 300065764 Test: atest WMShellFlickerServiceTests Change-Id: I179614bf64ff3171879303e24827ba340368c6a9 --- .../splitscreen/scenarios/EnterSplitScreenByDragFromAllApps.kt | 9 ++++++--- .../scenarios/EnterSplitScreenByDragFromNotification.kt | 9 ++++++--- .../splitscreen/scenarios/EnterSplitScreenByDragFromShortcut.kt | 8 +++++--- .../splitscreen/scenarios/EnterSplitScreenFromOverview.kt | 6 +++--- .../service/splitscreen/scenarios/SwitchAppByDoubleTapDivider.kt | 4 ++-- .../service/splitscreen/scenarios/SwitchBackToSplitFromRecent.kt | 3 ++- .../src/com/android/wm/shell/flicker/utils/SplitScreenUtils.kt | 1 + 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromAllApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromAllApps.kt index c433b211b53d..d7b306c3be23 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromAllApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromAllApps.kt @@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.service.splitscreen.scenarios import android.app.Instrumentation import android.tools.common.NavBar import android.tools.common.Rotation +import android.tools.device.flicker.rules.ChangeDisplayOrientationRule import android.tools.device.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice @@ -49,11 +50,13 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) { fun setup() { Assume.assumeTrue(tapl.isTablet) - tapl.setEnableRotation(true) - tapl.setExpectedRotation(rotation.value) - tapl.goHome() + primaryApp.launchViaIntent(wmHelper) + ChangeDisplayOrientationRule.setRotation(rotation) + + tapl.setEnableRotation(true) + tapl.setExpectedRotation(rotation.value) } @Test diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromNotification.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromNotification.kt index 3f087a5b7ecd..cc982d1ba860 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromNotification.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromNotification.kt @@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.service.splitscreen.scenarios import android.app.Instrumentation import android.tools.common.NavBar import android.tools.common.Rotation +import android.tools.device.flicker.rules.ChangeDisplayOrientationRule import android.tools.device.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice @@ -50,14 +51,16 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) { fun setup() { Assume.assumeTrue(tapl.isTablet) - tapl.setEnableRotation(true) - tapl.setExpectedRotation(rotation.value) - // Send a notification sendNotificationApp.launchViaIntent(wmHelper) sendNotificationApp.postNotification(wmHelper) tapl.goHome() + + tapl.setEnableRotation(true) + tapl.setExpectedRotation(rotation.value) + primaryApp.launchViaIntent(wmHelper) + ChangeDisplayOrientationRule.setRotation(rotation) } @Test diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromShortcut.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromShortcut.kt index 767e7b555618..fa12bb869467 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromShortcut.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenByDragFromShortcut.kt @@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.service.splitscreen.scenarios import android.app.Instrumentation import android.tools.common.NavBar import android.tools.common.Rotation +import android.tools.device.flicker.rules.ChangeDisplayOrientationRule import android.tools.device.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice @@ -49,12 +50,13 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) { fun setup() { Assume.assumeTrue(tapl.isTablet) - tapl.setEnableRotation(true) - tapl.setExpectedRotation(rotation.value) - tapl.goHome() SplitScreenUtils.createShortcutOnHotseatIfNotExist(tapl, secondaryApp.appName) primaryApp.launchViaIntent(wmHelper) + ChangeDisplayOrientationRule.setRotation(rotation) + + tapl.setEnableRotation(true) + tapl.setExpectedRotation(rotation.value) } @Test diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenFromOverview.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenFromOverview.kt index 3a6a4a17811b..983653b9b5ca 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenFromOverview.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/EnterSplitScreenFromOverview.kt @@ -46,9 +46,6 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) { @Before fun setup() { - tapl.setEnableRotation(true) - tapl.setExpectedRotation(rotation.value) - primaryApp.launchViaIntent(wmHelper) secondaryApp.launchViaIntent(wmHelper) tapl.goHome() @@ -57,6 +54,9 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) { .withAppTransitionIdle() .withHomeActivityVisible() .waitForAndVerify() + + tapl.setEnableRotation(true) + tapl.setExpectedRotation(rotation.value) } @Test diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchAppByDoubleTapDivider.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchAppByDoubleTapDivider.kt index 6330d33b4be6..068171d2e129 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchAppByDoubleTapDivider.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchAppByDoubleTapDivider.kt @@ -48,11 +48,11 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) { @Before fun setup() { + tapl.workspace.switchToOverview().dismissAllTasks() + tapl.setEnableRotation(true) tapl.setExpectedRotation(rotation.value) - tapl.workspace.switchToOverview().dismissAllTasks() - SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp, rotation) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchBackToSplitFromRecent.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchBackToSplitFromRecent.kt index 6ff8c53cbac8..7065846dc653 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchBackToSplitFromRecent.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/splitscreen/scenarios/SwitchBackToSplitFromRecent.kt @@ -46,9 +46,10 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) { @Before fun setup() { + tapl.workspace.switchToOverview().dismissAllTasks() + tapl.setEnableRotation(true) tapl.setExpectedRotation(rotation.value) - tapl.workspace.switchToOverview().dismissAllTasks() SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp, rotation) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/utils/SplitScreenUtils.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/utils/SplitScreenUtils.kt index 87e3860a85f8..d53adc08d2ff 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/utils/SplitScreenUtils.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/utils/SplitScreenUtils.kt @@ -108,6 +108,7 @@ object SplitScreenUtils { ) { primaryApp.launchViaIntent(wmHelper) secondaryApp.launchViaIntent(wmHelper) + ChangeDisplayOrientationRule.setRotation(rotation) tapl.goHome() wmHelper.StateSyncBuilder().withHomeActivityVisible().waitForAndVerify() splitFromOverview(tapl, device, rotation) -- cgit v1.2.3-59-g8ed1b