⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267415 in webkit


Ignore:
Timestamp:
Sep 22, 2020, 9:40:21 AM (6 years ago)
Author:
Ryan Haddad
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 <achristensen@webkit.org> 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

Location:
branches/safari-610-branch/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610-branch/Tools/ChangeLog

    r267258 r267415  
     12020-09-22  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Cherry-pick r267278. rdar://problem/69374947
     4
     5    Make TLSVersion.NetworkSession API test more robust
     6    https://bugs.webkit.org/show_bug.cgi?id=216704
     7    <rdar://problem/68643674>
     8   
     9    Patch by Alex Christensen <achristensen@webkit.org> on 2020-09-18
     10    Reviewed by Tim Horton.
     11   
     12    r265573 made preconnect attempts to legacy TLS servers fail.
     13    This caused the TLSVersion.NetworkSession to assert because the first connection attempt would fail
     14    (and the second would succeed if it was supposed to succeed with the conditions in the test).
     15    The test calls waitForDidFailProvisionalNavigation in cases where it is supposed to fail and
     16    waitForDidFinishNavigation in cases where it supposed to succeed.
     17    Like I did in r266100 with another test, use HTTPServer which allows a variable number of connection attempts.
     18   
     19    * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
     20    (TestWebKitAPI::TEST):
     21   
     22    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     23
     24    2020-09-18  Alex Christensen  <achristensen@webkit.org>
     25
     26            Make TLSVersion.NetworkSession API test more robust
     27            https://bugs.webkit.org/show_bug.cgi?id=216704
     28            <rdar://problem/68643674>
     29
     30            Reviewed by Tim Horton.
     31
     32            r265573 made preconnect attempts to legacy TLS servers fail.
     33            This caused the TLSVersion.NetworkSession to assert because the first connection attempt would fail
     34            (and the second would succeed if it was supposed to succeed with the conditions in the test).
     35            The test calls waitForDidFailProvisionalNavigation in cases where it is supposed to fail and
     36            waitForDidFinishNavigation in cases where it supposed to succeed.
     37            Like I did in r266100 with another test, use HTTPServer which allows a variable number of connection attempts.
     38
     39            * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
     40            (TestWebKitAPI::TEST):
     41
    1422020-09-17  Alan Coon  <alancoon@apple.com>
    243
  • branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm

    r266423 r267415  
    167167TEST(TLSVersion, NetworkSession)
    168168{
     169    HTTPServer server(HTTPServer::respondWithOK, HTTPServer::Protocol::HttpsWithLegacyTLS);
    169170    static auto delegate = adoptNS([TestNavigationDelegate new]);
    170171    auto makeWebViewWith = [&] (WKWebsiteDataStore *store) {
     
    180181    };
    181182    {
    182         TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);
    183183        auto webView = makeWebViewWith([WKWebsiteDataStore defaultDataStore]);
    184184        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
     
    186186    }
    187187    {
    188         TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);
    189188        auto webView = makeWebViewWith([WKWebsiteDataStore nonPersistentDataStore]);
    190189        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
     
    192191    }
    193192    {
    194         TCPServer server(TCPServer::Protocol::HTTPS, [](SSL *ssl) {
    195             EXPECT_FALSE(ssl);
    196         }, tls1_1);
    197193        auto configuration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] initNonPersistentConfiguration]);
    198194        [configuration setLegacyTLSEnabled:NO];
     
    204200    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:defaultsKey];
    205201    {
    206         TCPServer server(TCPServer::Protocol::HTTPS, [](SSL *ssl) {
    207             EXPECT_FALSE(ssl);
    208         }, tls1_1);
    209202        auto webView = makeWebViewWith([WKWebsiteDataStore defaultDataStore]);
    210203        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
     
    212205    }
    213206    {
    214         TCPServer server(TCPServer::Protocol::HTTPS, [](SSL *ssl) {
    215             EXPECT_FALSE(ssl);
    216         }, tls1_1);
    217207        auto webView = makeWebViewWith([WKWebsiteDataStore nonPersistentDataStore]);
    218208        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
Note: See TracChangeset for help on using the changeset viewer.