diff options
author | Manuel Rego Casasnovas <rego@igalia.com> | 2013-03-12 21:18:43 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2013-03-13 04:02:35 +0800 |
commit | 2541eed4d1dfda432e6663fdaab48081c9fef38c (patch) | |
tree | 5d7319fd46ad797ab3765bb161e8d49bc2d4b990 /tests/ephy-test-utils.c | |
parent | 207ed7842e6f7d9be1bed66c3e630aa4bcaf7df8 (diff) | |
download | gsoc2013-epiphany-2541eed4d1dfda432e6663fdaab48081c9fef38c.tar gsoc2013-epiphany-2541eed4d1dfda432e6663fdaab48081c9fef38c.tar.gz gsoc2013-epiphany-2541eed4d1dfda432e6663fdaab48081c9fef38c.tar.bz2 gsoc2013-epiphany-2541eed4d1dfda432e6663fdaab48081c9fef38c.tar.lz gsoc2013-epiphany-2541eed4d1dfda432e6663fdaab48081c9fef38c.tar.xz gsoc2013-epiphany-2541eed4d1dfda432e6663fdaab48081c9fef38c.tar.zst gsoc2013-epiphany-2541eed4d1dfda432e6663fdaab48081c9fef38c.zip |
Fix EphyShell tests in WK2 waiting until views are loaded
/src/ephy-shell/tab_load and /src/ephy-shell/tab_from_external tests were
failing because of the same issue than session tests. We were not waiting till
the views reach the committed load status in order to check the address.
https://bugzilla.gnome.org/show_bug.cgi?id=695646
Diffstat (limited to 'tests/ephy-test-utils.c')
-rw-r--r-- | tests/ephy-test-utils.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ephy-test-utils.c b/tests/ephy-test-utils.c index 95a90ec2a..83272de44 100644 --- a/tests/ephy-test-utils.c +++ b/tests/ephy-test-utils.c @@ -41,6 +41,13 @@ ephy_test_utils_check_ephy_web_view_address (EphyWebView *view, g_assert_cmpstr (ephy_web_view_get_address (view), ==, address); } +void +ephy_test_utils_check_ephy_embed_address (EphyEmbed *embed, + const gchar *address) +{ + ephy_test_utils_check_ephy_web_view_address (ephy_embed_get_web_view (embed), address); +} + static void load_changed_cb (WebKitWebView *web_view, #ifdef HAVE_WEBKIT2 @@ -105,3 +112,26 @@ ephy_test_utils_ensure_web_views_are_loaded (GMainLoop *loop) g_assert_cmpint (web_view_ready_counter, ==, 0); g_main_loop_unref (loop); } + +GMainLoop* +ephy_test_utils_setup_wait_until_load_is_committed (EphyWebView *view) +{ + GMainLoop *loop; + + web_view_ready_counter = 1; + + loop = g_main_loop_new (NULL, FALSE); + wait_until_load_is_committed (WEBKIT_WEB_VIEW (view), loop); + + return loop; +} + +void +ephy_test_utils_wait_until_load_is_committed (GMainLoop *loop) +{ + if (web_view_ready_counter != 0) + g_main_loop_run (loop); + + g_assert_cmpint (web_view_ready_counter, ==, 0); + g_main_loop_unref (loop); +} |