From 8b1740b965fcd3f623ffd53591270e70c1b3b2f2 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 22 May 2013 00:07:04 +0200 Subject: [PATCH] tests: Stop expander from failing The test was flaky without gtk_widget_wait_for_draw(). --- testsuite/gtk/expander.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/testsuite/gtk/expander.c b/testsuite/gtk/expander.c index 87b915f683..e651d8a10c 100644 --- a/testsuite/gtk/expander.c +++ b/testsuite/gtk/expander.c @@ -42,15 +42,17 @@ test_click_expander (void) /* check expanding */ simsuccess = gtk_test_widget_click (expander, 1, 0); g_assert (simsuccess == TRUE); - while (gtk_events_pending ()) /* let expander timeout/idle handlers update */ - gtk_main_iteration (); + + gtk_test_widget_wait_for_draw (expander); + expanded = gtk_expander_get_expanded (GTK_EXPANDER (expander)); g_assert (expanded); /* check collapsing */ simsuccess = gtk_test_widget_click (expander, 1, 0); g_assert (simsuccess == TRUE); - while (gtk_events_pending ()) /* let expander timeout/idle handlers update */ - gtk_main_iteration (); + + gtk_test_widget_wait_for_draw (expander); + expanded = gtk_expander_get_expanded (GTK_EXPANDER (expander)); g_assert (!expanded); } @@ -75,8 +77,9 @@ test_click_content_widget (void) g_assert (expanded); simsuccess = gtk_test_widget_click (entry, 1, 0); g_assert (simsuccess == TRUE); - while (gtk_events_pending ()) /* let expander timeout/idle handlers update */ - gtk_main_iteration (); + + gtk_test_widget_wait_for_draw (expander); + expanded = gtk_expander_get_expanded (GTK_EXPANDER (expander)); g_assert (expanded); }