Title: [204383] trunk/Tools
Revision
204383
Author
achristen...@apple.com
Date
2016-08-11 13:20:05 -0700 (Thu, 11 Aug 2016)

Log Message

Fix Yosemite bots' cookie accept policies after r204365.
https://bugs.webkit.org/show_bug.cgi?id=160758

* TestWebKitAPI/Tests/WebKit2Cocoa/CookieAcceptPolicy.mm:
(TEST):
I didn't restore the cookieAcceptPolicy of the sharedHTTPCookieStorage after changing it with this API test.
On Yosemite, this is changing the cookieAcceptPolicy that DumpRenderTree uses.
On more recent Cocoa platforms, it is only changing the cookieAcceptPolicy that TestWebKitAPI uses, which isn't
causing any problems because there are no other API tests that do anything with cookies.
My solution will be to restore the original cookieAcceptPolicy after running this API test to clean up,
but first I am committing this patch setting the cookieAcceptPolicy to NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain
to reset any bots that have run tests since r204365.  I will commit a followup that sets it to originalCookieAcceptPolicy.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (204382 => 204383)


--- trunk/Tools/ChangeLog	2016-08-11 19:45:13 UTC (rev 204382)
+++ trunk/Tools/ChangeLog	2016-08-11 20:20:05 UTC (rev 204383)
@@ -1,3 +1,18 @@
+2016-08-11  Alex Christensen  <achristen...@webkit.org>
+
+        Fix Yosemite bots' cookie accept policies after r204365.
+        https://bugs.webkit.org/show_bug.cgi?id=160758
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/CookieAcceptPolicy.mm:
+        (TEST):
+        I didn't restore the cookieAcceptPolicy of the sharedHTTPCookieStorage after changing it with this API test.
+        On Yosemite, this is changing the cookieAcceptPolicy that DumpRenderTree uses.
+        On more recent Cocoa platforms, it is only changing the cookieAcceptPolicy that TestWebKitAPI uses, which isn't
+        causing any problems because there are no other API tests that do anything with cookies.
+        My solution will be to restore the original cookieAcceptPolicy after running this API test to clean up,
+        but first I am committing this patch setting the cookieAcceptPolicy to NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain
+        to reset any bots that have run tests since r204365.  I will commit a followup that sets it to originalCookieAcceptPolicy.
+
 2016-08-11  Aakash Jain  <aakash_j...@apple.com>
 
         EWS should check if the patch is still valid before executing every major step

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/CookieAcceptPolicy.mm (204382 => 204383)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/CookieAcceptPolicy.mm	2016-08-11 19:45:13 UTC (rev 204382)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/CookieAcceptPolicy.mm	2016-08-11 20:20:05 UTC (rev 204383)
@@ -26,6 +26,7 @@
 #include "config.h"
 
 #import "PlatformUtilities.h"
+#import <WebCore/CFNetworkSPI.h>
 #import <WebKit/WKProcessPool.h>
 #import <WebKit/WKProcessPoolPrivate.h>
 #import <WebKit/WKWebView.h>
@@ -52,6 +53,8 @@
 
 TEST(WebKit2, CookieAcceptPolicy)
 {
+    auto originalCookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
+    
     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     
     RetainPtr<WKProcessPool> processPool = adoptNS([[WKProcessPool alloc] init]);
@@ -67,6 +70,11 @@
     [webView loadRequest:request];
     TestWebKitAPI::Util::run(&receivedScriptMessage);
     EXPECT_STREQ([(NSString *)[lastScriptMessage body] UTF8String], "COOKIE:");
+    
+    // FIXME: Set back to originalCookieAcceptPolicy.
+    UNUSED_PARAM(originalCookieAcceptPolicy);
+    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
+    [[NSHTTPCookieStorage sharedHTTPCookieStorage] _saveCookies];
 }
 
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to