Changeset 266100 in webkit
- Timestamp:
- Aug 24, 2020, 8:36:45 PM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm (modified) (2 diffs)
-
TestWebKitAPI/cocoa/HTTPServer.h (modified) (1 diff)
-
TestWebKitAPI/cocoa/HTTPServer.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r266090 r266100 1 2020-08-24 Alex Christensen <achristensen@webkit.org> 2 3 Make TLSVersion.DefaultBehavior more robust 4 https://bugs.webkit.org/show_bug.cgi?id=215791 5 6 Reviewed by Darin Adler. 7 8 After r265573 sometimes it would assert, which is not a problem because it was failing the first connection 9 then succeeding the second connection as intended and as happens in the real internet. 10 Use HTTPServer which accepts a variable number of connections to keep the test coverage. 11 12 * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: 13 (TestWebKitAPI::TEST): 14 * TestWebKitAPI/cocoa/HTTPServer.h: 15 * TestWebKitAPI/cocoa/HTTPServer.mm: 16 (TestWebKitAPI::HTTPServer::respondWithChallengeThenOK): 17 (TestWebKitAPI::HTTPServer::respondWithOK): 18 1 19 2020-08-24 Wenson Hsieh <wenson_hsieh@apple.com> 2 20 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm
r265857 r266100 145 145 static NSString *defaultsKey = @"WebKitEnableLegacyTLS"; 146 146 147 #if HAVE(NETWORK_FRAMEWORK) 148 147 149 TEST(TLSVersion, DefaultBehavior) 148 150 { 149 TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);151 HTTPServer server(HTTPServer::respondWithOK, HTTPServer::Protocol::HttpsWithLegacyTLS); 150 152 auto delegate = adoptNS([TestNavigationDelegate new]); 151 153 auto webView = adoptNS([WKWebView new]); … … 158 160 [delegate waitForDidFinishNavigation]; 159 161 } 162 163 #endif // HAVE(NETWORK_FRAMEWORK) 160 164 161 165 #if HAVE(TLS_VERSION_DURING_CHALLENGE) -
trunk/Tools/TestWebKitAPI/cocoa/HTTPServer.h
r265150 r266100 55 55 void cancel(); 56 56 57 static void respondWithOK(Connection); 57 58 static void respondWithChallengeThenOK(Connection); 58 59 59 60 private: 60 61 static RetainPtr<nw_parameters_t> listenerParameters(Protocol, CertificateVerifier&&, RetainPtr<SecIdentityRef>&&, Optional<uint16_t> port); -
trunk/Tools/TestWebKitAPI/cocoa/HTTPServer.mm
r265150 r266100 151 151 "WWW-Authenticate: Basic realm=\"testrealm\"\r\n\r\n"; 152 152 connection.send(challengeHeader, [connection] { 153 connection.receiveHTTPRequest([connection] (Vector<char>&&) { 154 connection.send( 155 "HTTP/1.1 200 OK\r\n" 156 "Content-Length: 13\r\n\r\n" 157 "Hello, World!" 158 ); 159 }); 153 respondWithOK(connection); 160 154 }); 155 }); 156 } 157 158 void HTTPServer::respondWithOK(Connection connection) 159 { 160 connection.receiveHTTPRequest([connection] (Vector<char>&&) { 161 connection.send( 162 "HTTP/1.1 200 OK\r\n" 163 "Content-Length: 13\r\n\r\n" 164 "Hello, World!" 165 ); 161 166 }); 162 167 }
Note:
See TracChangeset
for help on using the changeset viewer.