[mutter] tests/wayland-fullscreen: Also test toggling fullscreen
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tests/wayland-fullscreen: Also test toggling fullscreen
- Date: Mon, 10 Oct 2022 19:12:55 +0000 (UTC)
commit 21cddbae950715189d2a481cc95058660d86c4be
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Sep 28 20:53:18 2022 +0200
tests/wayland-fullscreen: Also test toggling fullscreen
This tests that unfullscreen makes the black background disappear, and
that fullscreening again makes it re-appear.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2338>
.../wayland_toplevel_fullscreen-ref-test_2.ref.png | Bin 0 -> 6785 bytes
.../wayland_toplevel_fullscreen-ref-test_3.ref.png | Bin 0 -> 176 bytes
src/tests/wayland-fullscreen-test.c | 39 +++++++++++++++++++++
src/wayland/meta-window-wayland.h | 2 ++
4 files changed, 41 insertions(+)
---
diff --git a/src/tests/ref-tests/wayland_toplevel_fullscreen-ref-test_2.ref.png
b/src/tests/ref-tests/wayland_toplevel_fullscreen-ref-test_2.ref.png
new file mode 100644
index 0000000000..0822d9dfba
Binary files /dev/null and b/src/tests/ref-tests/wayland_toplevel_fullscreen-ref-test_2.ref.png differ
diff --git a/src/tests/ref-tests/wayland_toplevel_fullscreen-ref-test_3.ref.png
b/src/tests/ref-tests/wayland_toplevel_fullscreen-ref-test_3.ref.png
new file mode 100644
index 0000000000..e2d3801882
Binary files /dev/null and b/src/tests/ref-tests/wayland_toplevel_fullscreen-ref-test_3.ref.png differ
diff --git a/src/tests/wayland-fullscreen-test.c b/src/tests/wayland-fullscreen-test.c
index 10a94667c3..6a7d5d71a0 100644
--- a/src/tests/wayland-fullscreen-test.c
+++ b/src/tests/wayland-fullscreen-test.c
@@ -26,6 +26,7 @@
#include "tests/meta-wayland-test-utils.h"
#include "backends/native/meta-renderer-native.h"
#include "tests/meta-ref-test.h"
+#include "wayland/meta-window-wayland.h"
#include "wayland/meta-wayland-surface.h"
static MetaContext *test_context;
@@ -119,11 +120,49 @@ toplevel_fullscreen (void)
static void
toplevel_fullscreen_ref_test (void)
{
+ MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (test_window);
+ MetaRectangle rect;
+
wait_for_window_added (test_window);
+ assert_wayland_surface_size (test_window, 10, 10);
+ g_assert_true (meta_window_wayland_is_acked_fullscreen (wl_window));
meta_ref_test_verify_view (get_view (),
g_test_get_path (), 1,
meta_ref_test_determine_ref_test_flag ());
+
+ meta_window_unmake_fullscreen (test_window);
+
+ while (meta_window_wayland_is_acked_fullscreen (wl_window))
+ g_main_context_iteration (NULL, FALSE);
+
+ meta_window_move_frame (test_window, FALSE, 12, 13);
+
+ meta_window_get_frame_rect (test_window, &rect);
+ g_assert_cmpint (rect.width, ==, 10);
+ g_assert_cmpint (rect.height, ==, 10);
+ g_assert_cmpint (rect.x, ==, 12);
+ g_assert_cmpint (rect.y, ==, 13);
+ assert_wayland_surface_size (test_window, 10, 10);
+
+ meta_ref_test_verify_view (get_view (),
+ g_test_get_path (), 2,
+ meta_ref_test_determine_ref_test_flag ());
+
+ meta_window_make_fullscreen (test_window);
+ while (!meta_window_wayland_is_acked_fullscreen (wl_window))
+ g_main_context_iteration (NULL, FALSE);
+
+ meta_window_get_frame_rect (test_window, &rect);
+ g_assert_cmpint (rect.width, ==, 100);
+ g_assert_cmpint (rect.height, ==, 100);
+ g_assert_cmpint (rect.x, ==, 0);
+ g_assert_cmpint (rect.y, ==, 0);
+ assert_wayland_surface_size (test_window, 10, 10);
+
+ meta_ref_test_verify_view (get_view (),
+ g_test_get_path (), 3,
+ meta_ref_test_determine_ref_test_flag ());
}
static void
diff --git a/src/wayland/meta-window-wayland.h b/src/wayland/meta-window-wayland.h
index 709edc991e..e781065f41 100644
--- a/src/wayland/meta-window-wayland.h
+++ b/src/wayland/meta-window-wayland.h
@@ -32,6 +32,7 @@
G_BEGIN_DECLS
#define META_TYPE_WINDOW_WAYLAND (meta_window_wayland_get_type())
+META_EXPORT_TEST
G_DECLARE_FINAL_TYPE (MetaWindowWayland, meta_window_wayland,
META, WINDOW_WAYLAND,
MetaWindow)
@@ -81,6 +82,7 @@ gboolean meta_window_wayland_is_resize (MetaWindowWayland *wl_window,
int width,
int height);
+META_EXPORT_TEST
gboolean meta_window_wayland_is_acked_fullscreen (MetaWindowWayland *wl_window);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]