Title: [206769] trunk/LayoutTests
Revision
206769
Author
[email protected]
Date
2016-10-04 08:15:35 -0700 (Tue, 04 Oct 2016)

Log Message

[mac-wk1] LayoutTest http/tests/security/cached-cross-origin-preloading-css-stylesheet.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=162791

Patch by Youenn Fablet <[email protected]> on 2016-10-04
Reviewed by Alex Christensen.

Flackiness was due to one preload sometimes arriving after the test was finished.
This causes the issue of not having the preload actually being checked against CORS and the console error was not displayed.
Making the test wait 1 second after all loads finish to ensure the preload will also finishes.

Cleaning the test and improving it by:
- making each load to take 1 second (so that preload is not finished when actual load happens
- adding some comments explaining each subtest
- printing DONE at the end of all loads.

* http/tests/security/cached-cross-origin-preloading-css-stylesheet-expected.txt:
* http/tests/security/cached-cross-origin-preloading-css-stylesheet.html:
* platform/mac-wk1/TestExpectations: Removed flaky expectation.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206768 => 206769)


--- trunk/LayoutTests/ChangeLog	2016-10-04 13:49:38 UTC (rev 206768)
+++ trunk/LayoutTests/ChangeLog	2016-10-04 15:15:35 UTC (rev 206769)
@@ -1,3 +1,23 @@
+2016-10-04  Youenn Fablet  <[email protected]>
+
+        [mac-wk1] LayoutTest http/tests/security/cached-cross-origin-preloading-css-stylesheet.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=162791
+
+        Reviewed by Alex Christensen.
+
+        Flackiness was due to one preload sometimes arriving after the test was finished.
+        This causes the issue of not having the preload actually being checked against CORS and the console error was not displayed.
+        Making the test wait 1 second after all loads finish to ensure the preload will also finishes.
+
+        Cleaning the test and improving it by:
+        - making each load to take 1 second (so that preload is not finished when actual load happens
+        - adding some comments explaining each subtest
+        - printing DONE at the end of all loads.
+
+        * http/tests/security/cached-cross-origin-preloading-css-stylesheet-expected.txt:
+        * http/tests/security/cached-cross-origin-preloading-css-stylesheet.html:
+        * platform/mac-wk1/TestExpectations: Removed flaky expectation.
+
 2016-10-03  Myles C. Maxfield  <[email protected]>
 
         Implement rendering of font-variation-settings

Modified: trunk/LayoutTests/http/tests/security/cached-cross-origin-preloading-css-stylesheet-expected.txt (206768 => 206769)


--- trunk/LayoutTests/http/tests/security/cached-cross-origin-preloading-css-stylesheet-expected.txt	2016-10-04 13:49:38 UTC (rev 206768)
+++ trunk/LayoutTests/http/tests/security/cached-cross-origin-preloading-css-stylesheet-expected.txt	2016-10-04 15:15:35 UTC (rev 206769)
@@ -1,8 +1,9 @@
 CONSOLE MESSAGE: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
 CONSOLE MESSAGE: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
 
-PASS: did not load http://localhost:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials (cors mode)
-PASS: loaded successfuly http://localhost:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss2.css&contentType=text/css&allowCredentials (cors mode)
-PASS: loaded successfuly http://localhost:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials (no-cors mode)
-PASS: loaded successfuly http://localhost:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss1.css&contentType=text/css&allowCredentials (cors mode)
-PASS: loaded successfuly http://localhost:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss2.css&contentType=text/css&allowCredentials (no-cors mode)
+PASS: did not load http://localhost:8000/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials (cors mode)
+PASS: loaded successfuly http://localhost:8000/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss2.css&contentType=text/css&allowCredentials (cors mode)
+PASS: loaded successfuly http://localhost:8000/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials (no-cors mode)
+PASS: loaded successfuly http://localhost:8080/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss1.css&contentType=text/css&allowCredentials (cors mode)
+PASS: loaded successfuly http://localhost:8080/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss2.css&contentType=text/css&allowCredentials (no-cors mode)
+DONE

Modified: trunk/LayoutTests/http/tests/security/cached-cross-origin-preloading-css-stylesheet.html (206768 => 206769)


--- trunk/LayoutTests/http/tests/security/cached-cross-origin-preloading-css-stylesheet.html	2016-10-04 13:49:38 UTC (rev 206768)
+++ trunk/LayoutTests/http/tests/security/cached-cross-origin-preloading-css-stylesheet.html	2016-10-04 15:15:35 UTC (rev 206769)
@@ -12,18 +12,14 @@
 {
     console.log("unexpected loading result for preload " + e);
 }
+
 </script>
-<link rel=preload _onerror_="errorPreload(1)" as=style href=""
-<link rel=preload _onerror_="errorPreload(2)" as=style href=""
-<link rel=preload _onerror_="errorPreload(3)" as=style crossorigin="with-credentials" href="" rel=preload _onload_="errorPreload(4)" as=style crossorigin="with-credentials" href=""
-<link rel=preload _onload_="errorPreload(4)" as=style crossorigin="with-credentials" href=""
+<link rel=preload _onerror_="errorPreload(1)" as=style href=""
+<link rel=preload _onerror_="errorPreload(2)" as=style href=""
+<link rel=preload _onerror_="errorPreload(3)" as=style crossorigin="with-credentials" href=""
+<link rel=preload _onload_="errorPreload(4)"  as=style crossorigin="with-credentials" href=""
 <div id="log"></div>
 <script>
-if (window.testRunner) {
-   testRunner.dumpAsText();
-   testRunner.waitUntilDone();
-}
-
 var maxResults = 5;
 var results = [];
 
@@ -35,9 +31,9 @@
     results.sort();
     for (value of results)
         log += "<br>" + value;
-    document.getElementById('log').innerHTML = log;
+    document.getElementById('log').innerHTML = log + "<br>DONE";
     if (window.testRunner)
-        testRunner.notifyDone();
+        setTimeout(() => { testRunner.notifyDone(); }, 1000);
 }
 
 function logOnLoad(url, isCORS, expectSuccess)
@@ -65,11 +61,16 @@
     return link;
 }
 
-document.body.appendChild(createLinkElement("http://localhost:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials", true, false));
-document.body.appendChild(createLinkElement("http://localhost:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials", false, true));
-document.body.appendChild(createLinkElement("http://localhost:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss1.css&contentType=text/css&allowCredentials", true, true));
-document.body.appendChild(createLinkElement("http://localhost:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss2.css&contentType=text/css&allowCredentials", true, true));
-document.body.appendChild(createLinkElement("http://localhost:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss2.css&contentType=text/css&allowCredentials", false, true));
+// Preload 1 (no-cors) with link element (cors): should fail
+document.body.appendChild(createLinkElement("http://localhost:8000/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials", true, false));
+// Preload 1 (no-cors) with link element (no-cors): should succeed
+document.body.appendChild(createLinkElement("http://localhost:8000/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss1.css&contentType=text/css&allowCredentials", false, true));
+// Preload 2 (no-cors) with link element (cors): should succeed since 127.0.0.1:8000 allowed
+document.body.appendChild(createLinkElement("http://localhost:8080/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss1.css&contentType=text/css&allowCredentials", true, true));
+// Preload 3 (cors) with link element (cors): should succeed
+document.body.appendChild(createLinkElement("http://localhost:8000/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2F127.0.0.1%3A8000&name=xorigincss2.css&contentType=text/css&allowCredentials", true, true));
+// Preload 4 (cors, preload should fail) with link element (no-cors): should succeed
+document.body.appendChild(createLinkElement("http://localhost:8080/security/resources/allow-if-origin.php?delay=1000&allowCache&origin=http%3A%2F%2Flocalhost%3A8080&name=xorigincss2.css&contentType=text/css&allowCredentials", false, true));
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (206768 => 206769)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-10-04 13:49:38 UTC (rev 206768)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-10-04 15:15:35 UTC (rev 206769)
@@ -259,6 +259,4 @@
 webkit.org/b/162591 [ Sierra+ ] css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html [ Pass ImageOnlyFailure ]
 webkit.org/b/162591 [ Sierra+ ] css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html [ Pass ImageOnlyFailure ]
 
-webkit.org/b/162791 http/tests/security/cached-cross-origin-preloading-css-stylesheet.html [ Pass Failure ]
-
 webkit.org/b/162507 http/tests/media/hls/hls-video-resize.html [ Pass Failure ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to