diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-06-21 17:27:10 +0200 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-06-24 13:34:43 +0200 |
commit | 6652006561a09e58a50b8f9003bc2c1baf7c8a4c (patch) | |
tree | 8676f577972dd20e9f230c0a74359f6bd81a1c42 /tests | |
parent | ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9 (diff) | |
download | epiphany-6652006561a09e58a50b8f9003bc2c1baf7c8a4c.tar.gz |
Port web view loading progress and feedback to WebKit2
https://bugzilla.gnome.org/show_bug.cgi?id=678532
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ephy-web-view-test.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/ephy-web-view-test.c b/tests/ephy-web-view-test.c index 31b6f78f8..0d5f627bd 100644 --- a/tests/ephy-web-view-test.c +++ b/tests/ephy-web-view-test.c @@ -64,7 +64,26 @@ server_callback (SoupServer *server, } #ifdef HAVE_WEBKIT2 -/* TODO: loader */ +static void +load_changed_cb (WebKitWebView *view, WebKitLoadEvent load_event, GMainLoop *loop) +{ + char *expected_url; + const char *loaded_url; + + if (load_event != WEBKIT_LOAD_FINISHED) + return; + + expected_url = g_object_get_data (G_OBJECT (view), "test.expected_url"); + g_assert (expected_url != NULL); + + loaded_url = webkit_web_view_get_uri (view); + g_assert_cmpstr (loaded_url, ==, expected_url); + + g_signal_handlers_disconnect_by_func (view, load_changed_cb, loop); + + g_free (expected_url); + g_main_loop_quit (loop); +} #else static void notify_load_status_cb (WebKitWebView *view, GParamSpec *spec, GMainLoop *loop) @@ -162,7 +181,8 @@ test_ephy_web_view_load_url () g_test_message ("[%s] \t-> %s", test.url, test.expected_url); #ifdef HAVE_WEBKIT2 - /* TODO: loader */ + g_signal_connect (view, "load-changed", + G_CALLBACK (load_changed_cb), loop); #else g_signal_connect (view, "notify::load-status", G_CALLBACK (notify_load_status_cb), loop); |