summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-01-15 02:00:09 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-01-15 08:06:06 -0500
commit31ba72bad25c34139f2adc885bf608e98d602cff (patch)
tree881615a61183742916003de821a767e8b66c5528
parent911528923fbbb371019bbe213612c2d900220ce9 (diff)
downloadgtk+-wip/matthiasc/css-values.tar.gz
testsuite: Don't print default styleswip/matthiasc/css-values
This somewhat defeats the point that we want to verify the regulars styles, not some weird initial conditions.
-rw-r--r--testsuite/css/style/test-css-style.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/testsuite/css/style/test-css-style.c b/testsuite/css/style/test-css-style.c
index 24f558aaea..71e4056ee0 100644
--- a/testsuite/css/style/test-css-style.c
+++ b/testsuite/css/style/test-css-style.c
@@ -99,11 +99,24 @@ done:
}
static void
+style_context_changed (GtkWidget *window, const char **output)
+{
+ GtkStyleContext *context;
+
+g_print ("style updated\n");
+ context = gtk_widget_get_style_context (window);
+
+ *output = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE |
+ GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE |
+ GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE);
+ g_main_context_wakeup (NULL);
+}
+
+static void
load_ui_file (GFile *file, gboolean generate)
{
GtkBuilder *builder;
GtkWidget *window;
- GtkStyleContext *context;
char *output, *diff;
char *ui_file, *css_file, *reference_file;
GtkCssProvider *provider;
@@ -125,11 +138,13 @@ load_ui_file (GFile *file, gboolean generate)
g_assert (window != NULL);
- context = gtk_widget_get_style_context (window);
+ output = NULL;
+ g_signal_connect (window, "map", G_CALLBACK (style_context_changed), &output);
+
+ gtk_widget_show (window);
- output = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE |
- GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE |
- GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE);
+ while (!output)
+ g_main_context_iteration (NULL, FALSE);
if (generate)
{