summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yuichiro Hanada <yhanada@google.com> 2025-02-13 13:30:14 +0900
committer Yuichiro Hanada <yhanada@google.com> 2025-02-16 15:36:31 -0800
commite3848ab43fe7c87b1390c772ab7269f856b2c45c (patch)
tree9631b5d76c25f563c566a76d0d57dc666d76c938
parentddd4aeda8f4fb8bfaf98d93ce26cdbae79936d40 (diff)
Add a test case to check minimizing a tiled task removes it from tiling
Bug: 396307610 Flag: com.android.window.flags.enable_tile_resizing Test: WMShellUnitTests Change-Id: Ia1d1d50b9855a80dcc2c7dfd517309d0de1bd654
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
index 058fb714427c..6bfd0765af92 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
@@ -3225,6 +3225,24 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
}
@Test
+ fun onDesktopWindowMinimize_triesToStopTiling() {
+ val task = setUpFreeformTask(displayId = DEFAULT_DISPLAY)
+ val transition = Binder()
+ whenever(
+ freeformTaskTransitionStarter.startMinimizedModeTransition(
+ any(),
+ anyInt(),
+ anyBoolean(),
+ )
+ )
+ .thenReturn(transition)
+
+ controller.minimizeTask(task, MinimizeReason.MINIMIZE_BUTTON)
+
+ verify(snapEventHandler).removeTaskIfTiled(eq(DEFAULT_DISPLAY), eq(task.taskId))
+ }
+
+ @Test
fun handleRequest_fullscreenTask_freeformVisible_returnSwitchToFreeformWCT() {
val homeTask = setUpHomeTask()
val freeformTask = setUpFreeformTask()