Title: [204223] trunk/LayoutTests
Revision
204223
Author
[email protected]
Date
2016-08-06 01:48:31 -0700 (Sat, 06 Aug 2016)

Log Message

LayoutTest http/tests/fetch/fetch-in-worker-crash.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=160510

Patch by Youenn Fablet <[email protected]> on 2016-08-06
Reviewed by Sam Weinig.

* http/tests/fetch/fetch-in-worker-crash.html:
* http/tests/fetch/fetch-in-worker.js:
Adding a new test based on a ReadableStream that is not closed and therefore Response.text promise cannot resolve.
Removing the blob resolve message as there is no guarantee that blob load will finish after the test is done.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (204222 => 204223)


--- trunk/LayoutTests/ChangeLog	2016-08-06 08:00:20 UTC (rev 204222)
+++ trunk/LayoutTests/ChangeLog	2016-08-06 08:48:31 UTC (rev 204223)
@@ -1,3 +1,15 @@
+2016-08-06  Youenn Fablet  <[email protected]>
+
+        LayoutTest http/tests/fetch/fetch-in-worker-crash.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=160510
+
+        Reviewed by Sam Weinig.
+
+        * http/tests/fetch/fetch-in-worker-crash.html:
+        * http/tests/fetch/fetch-in-worker.js:
+        Adding a new test based on a ReadableStream that is not closed and therefore Response.text promise cannot resolve.
+        Removing the blob resolve message as there is no guarantee that blob load will finish after the test is done.
+
 2016-08-05  Chris Dumez  <[email protected]>
 
         [Web IDL] Add support for USVString type

Modified: trunk/LayoutTests/http/tests/fetch/fetch-in-worker-crash.html (204222 => 204223)


--- trunk/LayoutTests/http/tests/fetch/fetch-in-worker-crash.html	2016-08-06 08:00:20 UTC (rev 204222)
+++ trunk/LayoutTests/http/tests/fetch/fetch-in-worker-crash.html	2016-08-06 08:48:31 UTC (rev 204223)
@@ -1,6 +1,6 @@
 <body>
 <p>Test that terminating an ongoing fetch in a worker does not cause a crash.</p> <script>
-    if (testRunner) {
+    if (window.testRunner) {
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
     }
@@ -15,7 +15,7 @@
             worker.terminate();
             setTimeout(() => {
                 document.body.innerHTML += "<p>PASS: No crash.</p>";
-                if (testRunner)
+                if (window.testRunner)
                     testRunner.notifyDone();
             }, 100);
         }

Modified: trunk/LayoutTests/http/tests/fetch/fetch-in-worker.js (204222 => 204223)


--- trunk/LayoutTests/http/tests/fetch/fetch-in-worker.js	2016-08-06 08:00:20 UTC (rev 204222)
+++ trunk/LayoutTests/http/tests/fetch/fetch-in-worker.js	2016-08-06 08:48:31 UTC (rev 204223)
@@ -9,11 +9,20 @@
         postMessage("FAIL: promise 1 rejected");
     });
 
-    var promise2 = new Request("test", {method: "POST", body: new Blob(["ab"])}).text().then(() => {
+    var stream = new ReadableStream({"start": function(controller) {
+        controller.enqueue("starting but not closing");
+    }});
+    var promise2 = new Response(stream).text().then(() => {
         postMessage("FAIL: promise 2 resolved");
     }, () => {
         postMessage("FAIL: promise 2 rejected");
     });
 
+    var promise3 = new Request("test", {method: "POST", body: new Blob(["ab"])}).text().then(() => {
+        // Not posting message as it could make the test flaky since we are not sure the test will end before the blob load finishes.
+    }, () => {
+        postMessage("FAIL: promise 3 rejected");
+    });
+
     postMessage(counter++);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to