Title: [246440] trunk/LayoutTests
Revision
246440
Author
[email protected]
Date
2019-06-14 13:10:23 -0700 (Fri, 14 Jun 2019)

Log Message

Move http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html off of testRunner.setAlwaysAcceptCookies()
https://bugs.webkit.org/show_bug.cgi?id=198863
<rdar://problem/47854589>

Unreviewed test gardening.

testRunner.setAlwaysAcceptCookies() is not working right (tracked
in rdar://problem/51757107). Therefore, we need to change
http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
to make it work properly.


* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (246439 => 246440)


--- trunk/LayoutTests/ChangeLog	2019-06-14 18:59:18 UTC (rev 246439)
+++ trunk/LayoutTests/ChangeLog	2019-06-14 20:10:23 UTC (rev 246440)
@@ -1,3 +1,19 @@
+2019-06-14  John Wilander  <[email protected]>
+
+        Move http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html off of testRunner.setAlwaysAcceptCookies()
+        https://bugs.webkit.org/show_bug.cgi?id=198863
+        <rdar://problem/47854589>
+
+        Unreviewed test gardening.
+
+        testRunner.setAlwaysAcceptCookies() is not working right (tracked
+        in rdar://problem/51757107). Therefore, we need to change
+        http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
+        to make it work properly.
+
+        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
+        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
+
 2019-06-14  Saam Barati  <[email protected]>
 
         [WHLSL] Implement out-of-bounds and nullptr behavior

Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt (246439 => 246440)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt	2019-06-14 18:59:18 UTC (rev 246439)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt	2019-06-14 20:10:23 UTC (rev 246440)
@@ -11,43 +11,41 @@
 --------
 Frame: '<!--frame1-->'
 --------
-Set cookie.
+Should receive first-party cookie for localhost.
+Did not receive cookie named 'firstPartyCookieIP'.
+Received cookie named 'firstPartyCookieLocalhost'.
+Did not receive cookie named 'thirdPartyCookie'.
+Client-side document.cookie: firstPartyCookieLocalhost=localhost
 
-
 --------
 Frame: '<!--frame2-->'
 --------
-Should receive first-party cookie.
-Received cookie named 'firstPartyCookie'.
-Did not receive cookie named 'partitionedCookie'.
-Client-side document.cookie: firstPartyCookie=value
+Redirect case 1, should receive first-party cookie for 127.0.0.1.
+Received cookie named 'firstPartyCookieIP'.
+Did not receive cookie named 'firstPartyCookieLocalhost'.
+Did not receive cookie named 'thirdPartyCookie'.
+Client-side document.cookie: firstPartyCookieIP=127.0.0.1
 
 --------
 Frame: '<!--frame3-->'
 --------
-Redirect case 1, should receive first-party cookie for 127.0.0.1.
-Received cookie named 'firstPartyCookie'.
-Did not receive cookie named 'partitionedCookie'.
-Client-side document.cookie: firstPartyCookie=127.0.0.1
+Try to set third-party cookie for localhost in blocked mode.
 
+
 --------
 Frame: '<!--frame4-->'
 --------
-Try to set third-party cookie in blocked mode.
-
-
---------
-Frame: '<!--frame5-->'
---------
 Should receive no cookie.
-Did not receive cookie named 'firstPartyCookie'.
-Did not receive cookie named 'partitionedCookie'.
+Did not receive cookie named 'firstPartyCookieIP'.
+Did not receive cookie named 'firstPartyCookieLocalhost'.
+Did not receive cookie named 'thirdPartyCookie'.
 Client-side document.cookie:
 
 --------
-Frame: '<!--frame6-->'
+Frame: '<!--frame5-->'
 --------
 Redirect case 2, should receive first-party cookie for 127.0.0.1.
-Received cookie named 'firstPartyCookie'.
-Did not receive cookie named 'partitionedCookie'.
-Client-side document.cookie: firstPartyCookie=127.0.0.1
+Received cookie named 'firstPartyCookieIP'.
+Did not receive cookie named 'firstPartyCookieLocalhost'.
+Did not receive cookie named 'thirdPartyCookie'.
+Client-side document.cookie: firstPartyCookieIP=127.0.0.1

Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html (246439 => 246440)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html	2019-06-14 18:59:18 UTC (rev 246439)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html	2019-06-14 20:10:23 UTC (rev 246440)
@@ -14,11 +14,12 @@
     const thirdPartyOrigin = "http://localhost:8000";
     const resourcePath = "/resourceLoadStatistics/resources";
     const thirdPartyBaseUrl = thirdPartyOrigin + resourcePath;
-    const firstPartyCookieName = "firstPartyCookie";
-    const subPathToSetFirstPartyCookie = "/set-cookie.php?name=" + firstPartyCookieName + "&value=value";
-    const partitionedCookieName = "partitionedCookie";
-    const subPathToSetPartitionedCookie = "/set-cookie.php?name=" + partitionedCookieName + "&value=value";
-    const subPathToGetCookies = "/get-cookies.php?name1=" + firstPartyCookieName + "&name2=" + partitionedCookieName;
+    const firstPartyCookieNamePrefix = "firstPartyCookie";
+    const firstPartyCookieNameIP = firstPartyCookieNamePrefix + "IP";
+    const firstPartyCookieNameLocalhost = firstPartyCookieNamePrefix + "Localhost";
+    const thirdPartyCookieName = "thirdPartyCookie";
+    const subPathToSetThirdPartyCookie = "/set-cookie.php?name=" + thirdPartyCookieName + "&value=value";
+    const subPathToGetCookies = "/get-cookies.php?name1=" + firstPartyCookieNameIP + "&name2=" + firstPartyCookieNameLocalhost + "&name3=" + thirdPartyCookieName;
     const redirectChainUrl = thirdPartyOrigin + resourcePath + "/redirect.php?redirectTo=http://" + partitionHost + resourcePath + subPathToGetCookies;
 
     function openIframe(url, onLoadHandler) {
@@ -34,18 +35,18 @@
         switch (document.location.hash) {
             case "#step1":
                 // Set first-party cookies for 127.0.0.1 and localhost.
-                document.location.hash = "step2";
-                document.cookie = firstPartyCookieName + "=127.0.0.1;path='/'";
-                if (window.testRunner)
-                    testRunner.setAlwaysAcceptCookies(true);
-                openIframe(thirdPartyBaseUrl + subPathToSetFirstPartyCookie + "&message=Set cookie.", runTest);
+                if (document.location.origin === thirdPartyOrigin) {
+                    document.cookie = firstPartyCookieNameLocalhost + "=localhost;path='/'";
+                    document.location.href = ""
+                } else {
+                    document.cookie = firstPartyCookieNameIP + "=127.0.0.1;path='/'";
+                    document.location.href = ""
+                }
                 break;
             case "#step2":
                 // Check that the cookie gets sent for localhost under 127.0.0.1 since localhost is not prevalent.
                 document.location.hash = "step3";
-                if (window.testRunner)
-                    testRunner.setAlwaysAcceptCookies(false);
-                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should receive first-party cookie.", runTest);
+                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should receive first-party cookie for localhost.", runTest);
                 break;
             case "#step3":
                 document.location.hash = "step4";
@@ -64,7 +65,7 @@
             case "#step5":
                 // Try to set partitioned cookie for localhost under 127.0.0.1.
                 document.location.hash = "step6";
-                openIframe(thirdPartyBaseUrl + subPathToSetPartitionedCookie + "&message=Try to set third-party cookie in blocked mode.", runTest);
+                openIframe(thirdPartyBaseUrl + subPathToSetThirdPartyCookie + "&message=Try to set third-party cookie for localhost in blocked mode.", runTest);
                 break;
             case "#step6":
                 // Check that no cookie gets sent for localhost under 127.0.0.1 since localhost's cookies are blocked.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to