Bug 132384 - [GTK] unit test for tls redirection failure required
Summary: [GTK] unit test for tls redirection failure required
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brian Holt
Depends on: 131675
  Show dependency treegraph
Reported: 2014-04-30 09:03 PDT by Brian Holt
Modified: 2014-05-07 03:13 PDT (History)
2 users (show)

See Also:

WIP patch (3.80 KB, patch)
2014-05-01 03:26 PDT, Brian Holt
cgarcia: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Holt 2014-04-30 09:03:12 PDT
Create a unit test for GTK for bug 121548
Comment 1 Brian Holt 2014-05-01 03:26:40 PDT
Created attachment 230573 [details]
WIP patch
Comment 2 Brian Holt 2014-05-01 03:28:49 PDT
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.
Comment 3 Carlos Garcia Campos 2014-05-03 03:54:00 PDT
Ah right, this is due to bug #131675, that broke a lot of unit tests.
Comment 4 Carlos Garcia Campos 2014-05-03 04:45:55 PDT
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 "".
Comment 5 Carlos Garcia Campos 2014-05-07 03:13:25 PDT
Unit test was included in the patch landed in r168417 in the end, so this is no longer needed.