summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alex Chau <alexchau@google.com> 2023-11-03 10:49:56 +0000
committer Alex Chau <alexchau@google.com> 2023-11-03 11:38:00 +0000
commit63114cf3730744ec8ee8ea7acb3a72c0ba543e3c (patch)
tree79d99abd981cbeb33eaaa056e0ce19ba5b593496
parent8036b830b399025459a32b08fd95db5c13e873a9 (diff)
Split screen via Task menu when grid_only_overview is enabled
- Also change to choose bottom right task for split when grid_only_overview is eanbled, as ordering of tasks changes with grid_only_overview Fix: 309041108 Fix: 309044300 Test: com.android.wm.shell.flicker.service.splitscreen.platinum.EnterSplitScreenFromOverviewGesturalNavLandscape#enterSplitScreenFromOverview Test: com.android.wm.shell.flicker.service.splitscreen.platinum.SwitchBetweenSplitPairsGesturalNavLandscape#switchBetweenSplitPairs Change-Id: I6906ecb4851097aefc027d5fd689e8c2098404dc
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/utils/SplitScreenUtils.kt18
1 files changed, 14 insertions, 4 deletions
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 c31b9e2c22c7..3244ebc9ef32 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
@@ -135,19 +135,29 @@ object SplitScreenUtils {
// second task to split.
val home = tapl.workspace.switchToOverview()
ChangeDisplayOrientationRule.setRotation(rotation)
- home.overviewActions.clickSplit()
+ val isGridOnlyOverviewEnabled = tapl.isGridOnlyOverviewEnabled
+ if (isGridOnlyOverviewEnabled) {
+ home.currentTask.tapMenu().tapSplitMenuItem()
+ } else {
+ home.overviewActions.clickSplit()
+ }
val snapshots = device.wait(Until.findObjects(overviewSnapshotSelector), TIMEOUT_MS)
if (snapshots == null || snapshots.size < 1) {
error("Fail to find a overview snapshot to split.")
}
- // Find the second task in the upper right corner in split select mode by sorting
- // 'left' in descending order and 'top' in ascending order.
+ // Find the second task in the upper (or bottom for grid only Overview) right corner in
+ // split select mode by sorting 'left' in descending order and 'top' in ascending (or
+ // descending for grid only Overview) order.
snapshots.sortWith { t1: UiObject2, t2: UiObject2 ->
t2.getVisibleBounds().left - t1.getVisibleBounds().left
}
snapshots.sortWith { t1: UiObject2, t2: UiObject2 ->
- t1.getVisibleBounds().top - t2.getVisibleBounds().top
+ if (isGridOnlyOverviewEnabled) {
+ t2.getVisibleBounds().top - t1.getVisibleBounds().top
+ } else {
+ t1.getVisibleBounds().top - t2.getVisibleBounds().top
+ }
}
snapshots[0].click()
} else {