summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-04-02 19:26:16 +0200
committerJonas Ådahl <jadahl@gmail.com>2020-04-15 15:59:13 +0200
commit0a8286e0081ef1fde0909efdf52f0563e87584a3 (patch)
treef056e3875bf311860eb0d2f5bc259c9898db7d1c
parent42fecdb60ba6d77363ce397a0d93271919a8dca6 (diff)
downloadmutter-0a8286e0081ef1fde0909efdf52f0563e87584a3.tar.gz
tests/stacking: Add test for checking restored positions
Going maximized -> unmaximized should restore the previous position. The same for untiling, or going from tiled, to maximized, to floating. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1171
-rw-r--r--src/tests/meson.build1
-rw-r--r--src/tests/stacking/restore-position.metatest73
2 files changed, 74 insertions, 0 deletions
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 6a0a8d61a..928f48d61 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -144,6 +144,7 @@ stacking_tests = [
'restore-size',
'unmaximize-new-size',
'fullscreen-maximize',
+ 'restore-position',
]
foreach stacking_test: stacking_tests
diff --git a/src/tests/stacking/restore-position.metatest b/src/tests/stacking/restore-position.metatest
new file mode 100644
index 000000000..5390a2b47
--- /dev/null
+++ b/src/tests/stacking/restore-position.metatest
@@ -0,0 +1,73 @@
+# X11
+
+new_client x x11
+create x/1 csd
+show x/1
+
+move x/1 100 100
+assert_position x/1 100 100
+
+maximize x/1
+wait_reconfigure
+assert_position x/1 0 0
+
+unmaximize x/1
+wait_reconfigure
+assert_position x/1 100 100
+
+tile x/1 left
+wait
+assert_position x/1 0 0
+
+untile x/1
+wait
+assert_position x/1 100 100
+
+tile x/1 left
+wait
+assert_position x/1 0 0
+
+maximize x/1
+wait_reconfigure
+assert_position x/1 0 0
+
+unmaximize x/1
+wait_reconfigure
+assert_position x/1 100 100
+
+# Wayland
+
+new_client w wayland
+create w/1 csd
+show w/1
+
+move w/1 100 100
+assert_position w/1 100 100
+
+maximize w/1
+wait_reconfigure
+assert_position w/1 0 0
+
+unmaximize w/1
+wait_reconfigure
+assert_position w/1 100 100
+
+tile w/1 left
+wait_reconfigure
+assert_position w/1 0 0
+
+untile w/1
+wait
+assert_position w/1 100 100
+
+tile w/1 left
+wait
+assert_position w/1 0 0
+
+maximize w/1
+wait_reconfigure
+assert_position w/1 0 0
+
+unmaximize w/1
+wait_reconfigure
+assert_position w/1 100 100