From 3d7d2f245f2a849cf5f774c5aee570e120fd8074 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 28 Aug 2015 12:54:32 -0400 Subject: Work towards succeeding make check under Wayland Skip tests that don't work under Wayland, such as tests for GtkPlug and GtkSocket. --- testsuite/gtk/expander.c | 14 ++++++++++++ testsuite/gtk/notify.c | 25 ++++++++++++++++++++- testsuite/gtk/window.c | 57 ++++++++++++++++++++++++------------------------ 3 files changed, 67 insertions(+), 29 deletions(-) (limited to 'testsuite/gtk') diff --git a/testsuite/gtk/expander.c b/testsuite/gtk/expander.c index e651d8a10c..fc49bc0e76 100644 --- a/testsuite/gtk/expander.c +++ b/testsuite/gtk/expander.c @@ -23,6 +23,10 @@ */ #include +#ifdef GDK_WINDOWING_X11 +#include +#endif + static void test_click_expander (void) { @@ -65,6 +69,7 @@ test_click_content_widget (void) GtkWidget *entry = gtk_entry_new (); gboolean expanded; gboolean simsuccess; + gtk_container_add (GTK_CONTAINER (expander), entry); gtk_container_add (GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (window))), expander); gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE); @@ -89,7 +94,16 @@ main (int argc, char *argv[]) { gtk_test_init (&argc, &argv); + +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) ; + return 0; /* gtk_test functions don't work well elsewhere */ +#else + return 0; +#endif + g_test_add_func ("/expander/click-expander", test_click_expander); g_test_add_func ("/expander/click-content-widget", test_click_content_widget); + return g_test_run(); } diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c index 1ae3ab6fc2..91492cc1eb 100644 --- a/testsuite/gtk/notify.c +++ b/testsuite/gtk/notify.c @@ -19,6 +19,12 @@ #include #include #include +#ifdef GDK_WINDOWING_X11 +#include +#endif +#ifdef GDK_WINDOWING_WAYLAND +#include "gdk/wayland/gdkwayland.h" +#endif typedef struct { @@ -407,7 +413,24 @@ test_type (gconstpointer data) /* These rely on a d-bus session bus */ if (g_type_is_a (type, GTK_TYPE_MOUNT_OPERATION)) return; - + + /* Backend-specific */ +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) ; + else +#endif + if (g_type_is_a (type, GTK_TYPE_PLUG) || + g_type_is_a (type, GTK_TYPE_SOCKET)) + return; + +#ifdef GDK_WINDOWING_WAYLAND + if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) + { + if (g_type_is_a (type, GTK_TYPE_STATUS_ICON)) + return; + } +#endif + klass = g_type_class_ref (type); if (g_type_is_a (type, GTK_TYPE_SETTINGS)) diff --git a/testsuite/gtk/window.c b/testsuite/gtk/window.c index fa8dfc6b31..c28b8a07ed 100644 --- a/testsuite/gtk/window.c +++ b/testsuite/gtk/window.c @@ -375,34 +375,35 @@ test_hide_titlebar_when_maximized (void) gtk_main (); #ifdef GDK_WINDOWING_X11 - { - Atom type; - gint format; - gulong nitems; - gulong bytes_after; - gulong *hide = NULL; - - XGetWindowProperty (gdk_x11_get_default_xdisplay (), - GDK_WINDOW_XID (gtk_widget_get_window (window)), - gdk_x11_get_xatom_by_name ("_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"), - 0, - G_MAXLONG, - False, - XA_CARDINAL, - &type, - &format, - &nitems, - &bytes_after, - (guchar **) &hide); - - g_assert_cmpint (type, !=, None); - g_assert_cmpint (type, ==, XA_CARDINAL); - g_assert_cmpint (format, ==, 32); - g_assert_cmpint (nitems, ==, 1); - g_assert_cmpint (hide[0], ==, 1); - - XFree (hide); - } + if (GDK_IS_X11_SCREEN (gtk_widget_get_screen (window))) + { + Atom type; + gint format; + gulong nitems; + gulong bytes_after; + gulong *hide = NULL; + + XGetWindowProperty (gdk_x11_get_default_xdisplay (), + GDK_WINDOW_XID (gtk_widget_get_window (window)), + gdk_x11_get_xatom_by_name ("_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"), + 0, + G_MAXLONG, + False, + XA_CARDINAL, + &type, + &format, + &nitems, + &bytes_after, + (guchar **) &hide); + + g_assert_cmpint (type, !=, None); + g_assert_cmpint (type, ==, XA_CARDINAL); + g_assert_cmpint (format, ==, 32); + g_assert_cmpint (nitems, ==, 1); + g_assert_cmpint (hide[0], ==, 1); + + XFree (hide); + } #endif gtk_widget_destroy (window); -- cgit v1.2.1