Restructure http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html to...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 01:51:13 +0000 (01:51 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 01:51:13 +0000 (01:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191211
<rdar://problem/45818606>

Unreviewed test gardening.

This test is flaky on the MacOS WK2 bot. The patch avoids a page navigation and
redirect which may avoid the code that changed in
https://trac.webkit.org/changeset/237735/webkit and made the test more flaky.

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

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

LayoutTests/ChangeLog
LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt
LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html

index 98578ae..52781b4 100644 (file)
@@ -1,3 +1,18 @@
+2019-01-14  John Wilander  <wilander@apple.com>
+
+        Restructure http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html to address flakiness
+        https://bugs.webkit.org/show_bug.cgi?id=191211
+        <rdar://problem/45818606>
+
+        Unreviewed test gardening.
+
+        This test is flaky on the MacOS WK2 bot. The patch avoids a page navigation and
+        redirect which may avoid the code that changed in
+        https://trac.webkit.org/changeset/237735/webkit and made the test more flaky.
+
+        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
+        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
+
 2019-01-14  Simon Fraser  <simon.fraser@apple.com>
 
         Animation and other code is too aggressive about invalidating layer composition
index 2d8d99b..fea8232 100644 (file)
@@ -11,13 +11,19 @@ TEST COMPLETE
 --------
 Frame: '<!--frame1-->'
 --------
+Set cookie.
+
+
+--------
+Frame: '<!--frame2-->'
+--------
 Should receive first-party cookie.
 Received cookie named 'firstPartyCookie'.
 Did not receive cookie named 'partitionedCookie'.
 Client-side document.cookie: firstPartyCookie=value
 
 --------
-Frame: '<!--frame2-->'
+Frame: '<!--frame3-->'
 --------
 Redirect case 1, should receive first-party cookie for 127.0.0.1.
 Received cookie named 'firstPartyCookie'.
@@ -25,13 +31,13 @@ Did not receive cookie named 'partitionedCookie'.
 Client-side document.cookie: firstPartyCookie=127.0.0.1
 
 --------
-Frame: '<!--frame3-->'
+Frame: '<!--frame4-->'
 --------
 Try to set third-party cookie in blocked mode.
 
 
 --------
-Frame: '<!--frame4-->'
+Frame: '<!--frame5-->'
 --------
 Should receive no cookie.
 Did not receive cookie named 'firstPartyCookie'.
@@ -39,7 +45,7 @@ Did not receive cookie named 'partitionedCookie'.
 Client-side document.cookie:
 
 --------
-Frame: '<!--frame5-->'
+Frame: '<!--frame6-->'
 --------
 Redirect case 2, should receive first-party cookie for 127.0.0.1.
 Received cookie named 'firstPartyCookie'.
index 61c7f17..f103b7b 100644 (file)
@@ -18,7 +18,6 @@
     const subPathToSetFirstPartyCookie = "/set-cookie.php?name=" + firstPartyCookieName + "&value=value";
     const partitionedCookieName = "partitionedCookie";
     const subPathToSetPartitionedCookie = "/set-cookie.php?name=" + partitionedCookieName + "&value=value";
-    const returnUrl = "http://" + partitionHost + "/resourceLoadStatistics/remove-blocking-in-redirect.html";
     const subPathToGetCookies = "/get-cookies.php?name1=" + firstPartyCookieName + "&name2=" + partitionedCookieName;
     const redirectChainUrl = thirdPartyOrigin + resourcePath + "/redirect.php?redirectTo=http://" + partitionHost + resourcePath + subPathToGetCookies;
 
         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='/'";
-                document.location.href = thirdPartyBaseUrl + subPathToSetFirstPartyCookie + "#" + returnUrl + "#step2";
+                if (window.testRunner)
+                    testRunner.setAlwaysAcceptCookies(true);
+                openIframe(thirdPartyBaseUrl + subPathToSetFirstPartyCookie + "&message=Set cookie.", runTest);
                 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);
                 break;
             case "#step3":