Title: [267415] branches/safari-610-branch/Tools
Revision
267415
Author
[email protected]
Date
2020-09-22 09:40:21 -0700 (Tue, 22 Sep 2020)

Log Message

Cherry-pick r267278. rdar://problem/69374947

    Make TLSVersion.NetworkSession API test more robust
    https://bugs.webkit.org/show_bug.cgi?id=216704
    <rdar://problem/68643674>

    Patch by Alex Christensen <[email protected]> on 2020-09-18
    Reviewed by Tim Horton.

    r265573 made preconnect attempts to legacy TLS servers fail.
    This caused the TLSVersion.NetworkSession to assert because the first connection attempt would fail
    (and the second would succeed if it was supposed to succeed with the conditions in the test).
    The test calls waitForDidFailProvisionalNavigation in cases where it is supposed to fail and
    waitForDidFinishNavigation in cases where it supposed to succeed.
    Like I did in r266100 with another test, use HTTPServer which allows a variable number of connection attempts.

    * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
    (TestWebKitAPI::TEST):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267278 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610-branch/Tools/ChangeLog (267414 => 267415)


--- branches/safari-610-branch/Tools/ChangeLog	2020-09-22 16:32:11 UTC (rev 267414)
+++ branches/safari-610-branch/Tools/ChangeLog	2020-09-22 16:40:21 UTC (rev 267415)
@@ -1,3 +1,44 @@
+2020-09-22  Ryan Haddad  <[email protected]>
+
+        Cherry-pick r267278. rdar://problem/69374947
+
+    Make TLSVersion.NetworkSession API test more robust
+    https://bugs.webkit.org/show_bug.cgi?id=216704
+    <rdar://problem/68643674>
+    
+    Patch by Alex Christensen <[email protected]> on 2020-09-18
+    Reviewed by Tim Horton.
+    
+    r265573 made preconnect attempts to legacy TLS servers fail.
+    This caused the TLSVersion.NetworkSession to assert because the first connection attempt would fail
+    (and the second would succeed if it was supposed to succeed with the conditions in the test).
+    The test calls waitForDidFailProvisionalNavigation in cases where it is supposed to fail and
+    waitForDidFinishNavigation in cases where it supposed to succeed.
+    Like I did in r266100 with another test, use HTTPServer which allows a variable number of connection attempts.
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
+    (TestWebKitAPI::TEST):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-09-18  Alex Christensen  <[email protected]>
+
+            Make TLSVersion.NetworkSession API test more robust
+            https://bugs.webkit.org/show_bug.cgi?id=216704
+            <rdar://problem/68643674>
+
+            Reviewed by Tim Horton.
+
+            r265573 made preconnect attempts to legacy TLS servers fail.
+            This caused the TLSVersion.NetworkSession to assert because the first connection attempt would fail
+            (and the second would succeed if it was supposed to succeed with the conditions in the test).
+            The test calls waitForDidFailProvisionalNavigation in cases where it is supposed to fail and
+            waitForDidFinishNavigation in cases where it supposed to succeed.
+            Like I did in r266100 with another test, use HTTPServer which allows a variable number of connection attempts.
+
+            * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
+            (TestWebKitAPI::TEST):
+
 2020-09-17  Alan Coon  <[email protected]>
 
         Cherry-pick r266290. rdar://problem/69101142

Modified: branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm (267414 => 267415)


--- branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-09-22 16:32:11 UTC (rev 267414)
+++ branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-09-22 16:40:21 UTC (rev 267415)
@@ -166,6 +166,7 @@
 
 TEST(TLSVersion, NetworkSession)
 {
+    HTTPServer server(HTTPServer::respondWithOK, HTTPServer::Protocol::HttpsWithLegacyTLS);
     static auto delegate = adoptNS([TestNavigationDelegate new]);
     auto makeWebViewWith = [&] (WKWebsiteDataStore *store) {
         WKWebViewConfiguration *configuration = [[[WKWebViewConfiguration alloc] init] autorelease];
@@ -179,21 +180,16 @@
         return webView;
     };
     {
-        TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);
         auto webView = makeWebViewWith([WKWebsiteDataStore defaultDataStore]);
         [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
         [delegate waitForDidFinishNavigation];
     }
     {
-        TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);
         auto webView = makeWebViewWith([WKWebsiteDataStore nonPersistentDataStore]);
         [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
         [delegate waitForDidFinishNavigation];
     }
     {
-        TCPServer server(TCPServer::Protocol::HTTPS, [](SSL *ssl) {
-            EXPECT_FALSE(ssl);
-        }, tls1_1);
         auto configuration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] initNonPersistentConfiguration]);
         [configuration setLegacyTLSEnabled:NO];
         auto dataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:configuration.get()]);
@@ -203,17 +199,11 @@
     }
     [[NSUserDefaults standardUserDefaults] setBool:NO forKey:defaultsKey];
     {
-        TCPServer server(TCPServer::Protocol::HTTPS, [](SSL *ssl) {
-            EXPECT_FALSE(ssl);
-        }, tls1_1);
         auto webView = makeWebViewWith([WKWebsiteDataStore defaultDataStore]);
         [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
         [delegate waitForDidFailProvisionalNavigation];
     }
     {
-        TCPServer server(TCPServer::Protocol::HTTPS, [](SSL *ssl) {
-            EXPECT_FALSE(ssl);
-        }, tls1_1);
         auto webView = makeWebViewWith([WKWebsiteDataStore nonPersistentDataStore]);
         [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
         [delegate waitForDidFailProvisionalNavigation];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to