Create a unit test for GTK for bug 121548
Created attachment 230573 [details] WIP patch
I've uploaded a unit test which should test for the problem, but I'm having trouble with my environment - after running an TestSSL (with or without my patch) correctly the first time, any further runs hang.
Ah right, this is due to bug #131675, that broke a lot of unit tests.
Comment on attachment 230573 [details] WIP patch View in context: https://bugs.webkit.org/attachment.cgi?id=230573&action=review I think this test is actually showing that your patch was wrong, since we are failing with TLS errors for a non HTTPS connection. > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:222 > + // Load a page with an invalid certificate that redirects to http. > + test->loadURI(kHttpsServer->getURIForPath("/redirect-to-http").data()); > + test->waitUntilLoadFinished(); Shouldn't this fail?, the comment says it's a page with an invalid certificate. > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:226 > + // Now load a page with http and expect that the previous TLS failure should cause the load to fail. > + test->loadURI(kHttpsServer->getURIForPath("/index.html").data()); > + test->waitUntilLoadFailedWithTLSErrors(); I don't think this is correct. The errors of a previous load shouldn't affect new loads. The problem is supposed to happen with redirections, not with two independent loads. > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:252 > + } else if (g_str_equal(path, "/redirect-to-http/")) { > + soup_message_set_redirect(message, SOUP_STATUS_MOVED_PERMANENTLY, ""); I don't understand this either, this should redirect to another location, you should use a redirect uri instead of "".
Unit test was included in the patch landed in r168417 in the end, so this is no longer needed.