Title: [266422] branches/safari-610-branch/Tools
Revision
266422
Author
[email protected]
Date
2020-09-01 18:18:51 -0700 (Tue, 01 Sep 2020)

Log Message

Cherry-pick r266100. rdar://problem/68160088

    Make TLSVersion.DefaultBehavior more robust
    https://bugs.webkit.org/show_bug.cgi?id=215791

    Patch by Alex Christensen <[email protected]> on 2020-08-24
    Reviewed by Darin Adler.

    After r265573 sometimes it would assert, which is not a problem because it was failing the first connection
    then succeeding the second connection as intended and as happens in the real internet.
    Use HTTPServer which accepts a variable number of connections to keep the test coverage.

    * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/cocoa/HTTPServer.h:
    * TestWebKitAPI/cocoa/HTTPServer.mm:
    (TestWebKitAPI::HTTPServer::respondWithChallengeThenOK):
    (TestWebKitAPI::HTTPServer::respondWithOK):

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

Modified Paths

Diff

Modified: branches/safari-610-branch/Tools/ChangeLog (266421 => 266422)


--- branches/safari-610-branch/Tools/ChangeLog	2020-09-02 01:18:48 UTC (rev 266421)
+++ branches/safari-610-branch/Tools/ChangeLog	2020-09-02 01:18:51 UTC (rev 266422)
@@ -1,3 +1,44 @@
+2020-09-01  Alan Coon  <[email protected]>
+
+        Cherry-pick r266100. rdar://problem/68160088
+
+    Make TLSVersion.DefaultBehavior more robust
+    https://bugs.webkit.org/show_bug.cgi?id=215791
+    
+    Patch by Alex Christensen <[email protected]> on 2020-08-24
+    Reviewed by Darin Adler.
+    
+    After r265573 sometimes it would assert, which is not a problem because it was failing the first connection
+    then succeeding the second connection as intended and as happens in the real internet.
+    Use HTTPServer which accepts a variable number of connections to keep the test coverage.
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
+    (TestWebKitAPI::TEST):
+    * TestWebKitAPI/cocoa/HTTPServer.h:
+    * TestWebKitAPI/cocoa/HTTPServer.mm:
+    (TestWebKitAPI::HTTPServer::respondWithChallengeThenOK):
+    (TestWebKitAPI::HTTPServer::respondWithOK):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-08-24  Alex Christensen  <[email protected]>
+
+            Make TLSVersion.DefaultBehavior more robust
+            https://bugs.webkit.org/show_bug.cgi?id=215791
+
+            Reviewed by Darin Adler.
+
+            After r265573 sometimes it would assert, which is not a problem because it was failing the first connection
+            then succeeding the second connection as intended and as happens in the real internet.
+            Use HTTPServer which accepts a variable number of connections to keep the test coverage.
+
+            * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
+            (TestWebKitAPI::TEST):
+            * TestWebKitAPI/cocoa/HTTPServer.h:
+            * TestWebKitAPI/cocoa/HTTPServer.mm:
+            (TestWebKitAPI::HTTPServer::respondWithChallengeThenOK):
+            (TestWebKitAPI::HTTPServer::respondWithOK):
+
 2020-08-21  Wenson Hsieh  <[email protected]>
 
         [macOS] Unable to copy text from the function browser panel in Numbers

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


--- branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-09-02 01:18:48 UTC (rev 266421)
+++ branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-09-02 01:18:51 UTC (rev 266422)
@@ -144,9 +144,11 @@
 const uint16_t tls1_1 = 0x0302;
 static NSString *defaultsKey = @"WebKitEnableLegacyTLS";
 
+#if HAVE(NETWORK_FRAMEWORK)
+
 TEST(TLSVersion, DefaultBehavior)
 {
-    TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);
+    HTTPServer server(HTTPServer::respondWithOK, HTTPServer::Protocol::HttpsWithLegacyTLS);
     auto delegate = adoptNS([TestNavigationDelegate new]);
     auto webView = adoptNS([WKWebView new]);
     [webView setNavigationDelegate:delegate.get()];
@@ -158,6 +160,8 @@
     [delegate waitForDidFinishNavigation];
 }
 
+#endif // HAVE(NETWORK_FRAMEWORK)
+
 #if HAVE(TLS_VERSION_DURING_CHALLENGE)
 
 TEST(TLSVersion, NetworkSession)

Modified: branches/safari-610-branch/Tools/TestWebKitAPI/cocoa/HTTPServer.h (266421 => 266422)


--- branches/safari-610-branch/Tools/TestWebKitAPI/cocoa/HTTPServer.h	2020-09-02 01:18:48 UTC (rev 266421)
+++ branches/safari-610-branch/Tools/TestWebKitAPI/cocoa/HTTPServer.h	2020-09-02 01:18:51 UTC (rev 266422)
@@ -54,8 +54,9 @@
     size_t totalRequests() const;
     void cancel();
 
+    static void respondWithOK(Connection);
     static void respondWithChallengeThenOK(Connection);
-    
+
 private:
     static RetainPtr<nw_parameters_t> listenerParameters(Protocol, CertificateVerifier&&, RetainPtr<SecIdentityRef>&&, Optional<uint16_t> port);
     static void respondToRequests(Connection, Ref<RequestData>);

Modified: branches/safari-610-branch/Tools/TestWebKitAPI/cocoa/HTTPServer.mm (266421 => 266422)


--- branches/safari-610-branch/Tools/TestWebKitAPI/cocoa/HTTPServer.mm	2020-09-02 01:18:48 UTC (rev 266421)
+++ branches/safari-610-branch/Tools/TestWebKitAPI/cocoa/HTTPServer.mm	2020-09-02 01:18:51 UTC (rev 266422)
@@ -150,17 +150,22 @@
         "Content-Length: 0\r\n"
         "WWW-Authenticate: Basic realm=\"testrealm\"\r\n\r\n";
         connection.send(challengeHeader, [connection] {
-            connection.receiveHTTPRequest([connection] (Vector<char>&&) {
-                connection.send(
-                    "HTTP/1.1 200 OK\r\n"
-                    "Content-Length: 13\r\n\r\n"
-                    "Hello, World!"
-                );
-            });
+            respondWithOK(connection);
         });
     });
 }
 
+void HTTPServer::respondWithOK(Connection connection)
+{
+    connection.receiveHTTPRequest([connection] (Vector<char>&&) {
+        connection.send(
+            "HTTP/1.1 200 OK\r\n"
+            "Content-Length: 13\r\n\r\n"
+            "Hello, World!"
+        );
+    });
+}
+
 size_t HTTPServer::totalRequests() const
 {
     return m_requestData->requestCount;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to