diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp | |
parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp')
-rw-r--r-- | Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp b/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp index a59cb9210..211fa8b82 100644 --- a/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp +++ b/Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp @@ -50,15 +50,9 @@ static void loadChangedCallback(WebKitWebView* webView, WebKitLoadEvent loadEven break; } case WEBKIT_LOAD_FINISHED: - if (!test->m_loadFailed) { - g_assert(!webkit_web_view_is_loading(webView)); + g_assert(!webkit_web_view_is_loading(webView)); + if (!test->m_loadFailed) g_assert_cmpstr(test->m_activeURI.data(), ==, webkit_web_view_get_uri(webView)); - } else if (!g_error_matches(test->m_error.get(), WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)) { - // When a new load is started before the previous one has finished, we receive the load-finished signal - // of the ongoing load while we already have a provisional URL for the new load. This is the only case - // where isloading is true when the load has finished. - g_assert(!webkit_web_view_is_loading(webView)); - } test->loadFinished(); break; default: @@ -69,24 +63,19 @@ static void loadChangedCallback(WebKitWebView* webView, WebKitLoadEvent loadEven static void loadFailedCallback(WebKitWebView* webView, WebKitLoadEvent loadEvent, const char* failingURI, GError* error, LoadTrackingTest* test) { test->m_loadFailed = true; - - g_assert(error); test->m_error.reset(g_error_copy(error)); - if (!g_error_matches(error, WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)) { - // When a new load is started before the previous one has finished, we receive the load-failed signal - // of the ongoing load while we already have a provisional URL for the new load. This is the only case - // where is-loading is true when the load has failed. - g_assert(!webkit_web_view_is_loading(webView)); - } - switch (loadEvent) { case WEBKIT_LOAD_STARTED: - g_assert_cmpstr(test->m_activeURI.data(), ==, failingURI); + g_assert(!webkit_web_view_is_loading(webView)); + g_assert_cmpstr(test->m_activeURI.data(), ==, webkit_web_view_get_uri(webView)); + g_assert(error); test->provisionalLoadFailed(failingURI, error); break; case WEBKIT_LOAD_COMMITTED: + g_assert(!webkit_web_view_is_loading(webView)); g_assert_cmpstr(test->m_activeURI.data(), ==, webkit_web_view_get_uri(webView)); + g_assert(error); test->loadFailed(failingURI, error); break; default: @@ -94,16 +83,6 @@ static void loadFailedCallback(WebKitWebView* webView, WebKitLoadEvent loadEvent } } -static gboolean loadFailedWithTLSErrorsCallback(WebKitWebView* webView, const char* failingURI, GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors, LoadTrackingTest* test) -{ - test->m_loadFailed = true; - g_assert(!webkit_web_view_is_loading(webView)); - g_assert_cmpstr(test->m_activeURI.data(), ==, failingURI); - g_assert(G_IS_TLS_CERTIFICATE(certificate)); - g_assert(tlsErrors); - return test->loadFailedWithTLSErrors(failingURI, certificate, tlsErrors); -} - static void estimatedProgressChangedCallback(GObject*, GParamSpec*, LoadTrackingTest* test) { test->estimatedProgressChanged(); @@ -115,7 +94,6 @@ LoadTrackingTest::LoadTrackingTest() { g_signal_connect(m_webView, "load-changed", G_CALLBACK(loadChangedCallback), this); g_signal_connect(m_webView, "load-failed", G_CALLBACK(loadFailedCallback), this); - g_signal_connect(m_webView, "load-failed-with-tls-errors", G_CALLBACK(loadFailedWithTLSErrorsCallback), this); g_signal_connect(m_webView, "notify::estimated-load-progress", G_CALLBACK(estimatedProgressChangedCallback), this); g_assert(!webkit_web_view_get_uri(m_webView)); @@ -165,12 +143,6 @@ void LoadTrackingTest::loadFailed(const gchar* failingURI, GError* error) m_loadEvents.append(LoadFailed); } -bool LoadTrackingTest::loadFailedWithTLSErrors(const gchar* /*failingURI*/, GTlsCertificate*, GTlsCertificateFlags) -{ - m_loadEvents.append(LoadFailedWithTLSErrors); - return false; -} - void LoadTrackingTest::estimatedProgressChanged() { double progress = webkit_web_view_get_estimated_load_progress(m_webView); @@ -202,14 +174,6 @@ void LoadTrackingTest::loadPlainText(const char* plainText) WebViewTest::loadPlainText(plainText); } -void LoadTrackingTest::loadBytes(GBytes* bytes, const char* mimeType, const char* encoding, const char* baseURI) -{ - m_loadEvents.clear(); - m_estimatedProgress = 0; - m_error.reset(); - WebViewTest::loadBytes(bytes, mimeType, encoding, baseURI); -} - void LoadTrackingTest::loadRequest(WebKitURIRequest* request) { m_loadEvents.clear(); |