Bug 132384

Summary: [GTK] unit test for tls redirection failure required
Product: WebKit Reporter: Brian Holt <brian.holt>
Component: WebKitGTKAssignee: Brian Holt <brian.holt>
Status: RESOLVED INVALID    
Severity: Normal CC: cgarcia, mario
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 131675    
Bug Blocks:    
Attachments:
Description Flags
WIP patch cgarcia: review-

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.