ProcessSwap.UseSessionCookiesAfterProcessSwapInPrivateBrowsing API test is failing
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2018 23:56:07 +0000 (23:56 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2018 23:56:07 +0000 (23:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192362
<rdar://problem/46460360>

Reviewed by Ryosuke Niwa.

Move the call to _setCookieAcceptPolicy *after* we've constructed a WKWebView and thus
*after* we know for sure we have a network process to communicate the policy to.
This should address the failures on iOS.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

index a8bf60d..d6d765b 100644 (file)
@@ -1,3 +1,17 @@
+2018-12-07  Chris Dumez  <cdumez@apple.com>
+
+        ProcessSwap.UseSessionCookiesAfterProcessSwapInPrivateBrowsing API test is failing
+        https://bugs.webkit.org/show_bug.cgi?id=192362
+        <rdar://problem/46460360>
+
+        Reviewed by Ryosuke Niwa.
+
+        Move the call to _setCookieAcceptPolicy *after* we've constructed a WKWebView and thus
+        *after* we know for sure we have a network process to communicate the policy to.
+        This should address the failures on iOS.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
 2018-12-07  Jiewen Tan  <jiewen_tan@apple.com>
 
         Add keychain access entitlement to WebKitTestRunnerApp
index a2b6af2..0c6ab66 100644 (file)
@@ -2993,7 +2993,6 @@ TEST(ProcessSwap, UseSessionCookiesAfterProcessSwapInPrivateBrowsing)
     auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
     processPoolConfiguration.get().processSwapsOnNavigation = YES;
     auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
-    [processPool _setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
     RetainPtr<WKWebsiteDataStore> ephemeralStore = [WKWebsiteDataStore nonPersistentDataStore];
 
     auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
@@ -3010,6 +3009,8 @@ TEST(ProcessSwap, UseSessionCookiesAfterProcessSwapInPrivateBrowsing)
     auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
     [webView setNavigationDelegate:delegate.get()];
 
+    [processPool _setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"SetSessionCookie" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
     [webView loadRequest:request];