summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2024-12-03 15:50:46 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-12-03 15:50:46 +0000
commit18f0d02bf27f9c8fc9ea9d2857db7b8da9c907ef (patch)
treeeafa1cf99b36c9db6ff7fbc98e78a98d909d05b8
parent11f374743908ca3fbf7a05415f82fc1b6f32d04c (diff)
parente0e392277782faff97048faad1a938c89b8941e8 (diff)
Merge "Reset the frozen recents list for other split tests" into main
-rw-r--r--libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromAnotherApp.kt1
-rw-r--r--libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromHome.kt1
-rw-r--r--libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromRecent.kt1
-rw-r--r--libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBetweenSplitPairs.kt1
-rw-r--r--libs/WindowManager/Shell/tests/e2e/utils/src/com/android/wm/shell/Utils.kt16
5 files changed, 20 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromAnotherApp.kt b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromAnotherApp.kt
index 2ccffa85b5c1..a3d60207a8bd 100644
--- a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromAnotherApp.kt
+++ b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromAnotherApp.kt
@@ -66,5 +66,6 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
fun teardown() {
primaryApp.exit(wmHelper)
secondaryApp.exit(wmHelper)
+ Utils.resetFreezeRecentTaskList()
}
}
diff --git a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromHome.kt b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromHome.kt
index 8673c464ad19..9c7de05563e1 100644
--- a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromHome.kt
+++ b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromHome.kt
@@ -65,5 +65,6 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
fun teardown() {
primaryApp.exit(wmHelper)
secondaryApp.exit(wmHelper)
+ Utils.resetFreezeRecentTaskList()
}
}
diff --git a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromRecent.kt b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromRecent.kt
index 22adf6c9ee2f..9eb29723cc7d 100644
--- a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromRecent.kt
+++ b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBackToSplitFromRecent.kt
@@ -68,5 +68,6 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
fun teardown() {
primaryApp.exit(wmHelper)
secondaryApp.exit(wmHelper)
+ Utils.resetFreezeRecentTaskList()
}
}
diff --git a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBetweenSplitPairs.kt b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBetweenSplitPairs.kt
index 4ded148f6113..d833d91c0b4b 100644
--- a/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBetweenSplitPairs.kt
+++ b/libs/WindowManager/Shell/tests/e2e/splitscreen/scenarios/src/com/android/wm/shell/scenarios/SwitchBetweenSplitPairs.kt
@@ -68,5 +68,6 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
secondaryApp.exit(wmHelper)
thirdApp.exit(wmHelper)
fourthApp.exit(wmHelper)
+ Utils.resetFreezeRecentTaskList()
}
}
diff --git a/libs/WindowManager/Shell/tests/e2e/utils/src/com/android/wm/shell/Utils.kt b/libs/WindowManager/Shell/tests/e2e/utils/src/com/android/wm/shell/Utils.kt
index c0fafef96775..4a9e73b4af58 100644
--- a/libs/WindowManager/Shell/tests/e2e/utils/src/com/android/wm/shell/Utils.kt
+++ b/libs/WindowManager/Shell/tests/e2e/utils/src/com/android/wm/shell/Utils.kt
@@ -28,7 +28,10 @@ import android.tools.flicker.rules.ArtifactSaverRule
import android.tools.flicker.rules.ChangeDisplayOrientationRule
import android.tools.flicker.rules.LaunchAppRule
import android.tools.flicker.rules.RemoveAllTasksButHomeRule
+import android.util.Log
import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.uiautomator.UiDevice
+import java.io.IOException
import org.junit.rules.RuleChain
object Utils {
@@ -52,4 +55,17 @@ object Utils {
.around(PressHomeRule())
.around(EnsureDeviceSettingsRule())
}
+
+ /**
+ * Resets the frozen recent tasks list (ie. commits the quickswitch to the current task and
+ * reorders the current task to the end of the recents list).
+ */
+ fun resetFreezeRecentTaskList() {
+ try {
+ UiDevice.getInstance(instrumentation)
+ .executeShellCommand("wm reset-freeze-recent-tasks")
+ } catch (e: IOException) {
+ Log.e("TestUtils", "Failed to reset frozen recent tasks list", e)
+ }
+ }
}