diff options
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); +} |