Chromium Code Reviews| Index: LayoutTests/fast/events/message-port-start-and-close-same-microtask.html |
| diff --git a/LayoutTests/fast/events/message-port-close.html b/LayoutTests/fast/events/message-port-start-and-close-same-microtask.html |
| similarity index 62% |
| copy from LayoutTests/fast/events/message-port-close.html |
| copy to LayoutTests/fast/events/message-port-start-and-close-same-microtask.html |
| index 0dabcd830f60b1ba2cd64a5034db250616fb1fd5..45bc71fc9c44e536af468ee96e1ad0bb32bc8d72 100644 |
| --- a/LayoutTests/fast/events/message-port-close.html |
| +++ b/LayoutTests/fast/events/message-port-start-and-close-same-microtask.html |
| @@ -1,5 +1,5 @@ |
| <body> |
| -<p>Test Closed MessagePort Whether Receive Message Or Not.</p> |
| +<p>Test whether opening and closing a messageport in different microtasks correctly receives an in-flight message.</p> |
| <p>Should be a START message, followed with DONE.</p> |
| <pre id=log></pre> |
| <script> |
| @@ -16,13 +16,19 @@ if (window.testRunner) { |
| log("START"); |
| var channel = new MessageChannel; |
| -channel.port1.onmessage = function(evt) { |
| - log("Closed port receiving: FAIL. Got Message: " + evt.data + " after close"); |
| -} |
| -channel.port1.close(); |
| channel.port2.postMessage("This message can't be received"); |
| +openThenClose(); |
| done(); |
| +function openThenClose() { |
|
Sami
2014/11/12 16:47:34
Is there a better name we could use here to distin
|
| + setTimeout(function() { |
| + channel.port1.onmessage = function(evt) { |
| + log("Closed port receiving: FAIL. Got Message: " + evt.data + " after close"); |
| + } |
| + channel.port1.close(); |
| + }, 0); |
| +} |
| + |
| function done() { |
| // Wait a short period of time to ensure no messages come in from previous tests. |
| setTimeout(function() { |