Chromium Code Reviews| Index: LayoutTests/fast/workers/resources/worker-timeout-order.js |
| diff --git a/LayoutTests/fast/workers/resources/worker-timeout-order.js b/LayoutTests/fast/workers/resources/worker-timeout-order.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a8c1367d8045fea5c3c7fee71c8755bc78dcba0c |
| --- /dev/null |
| +++ b/LayoutTests/fast/workers/resources/worker-timeout-order.js |
| @@ -0,0 +1,18 @@ |
| +self.postMessage("Test started."); |
| +// The test will create timeouts in the following order |
| +// on first message - 1s, 2s. |
| +// on second message - 2s, 1s. |
| +// on third and final message - 3s, 2s, 1s. |
| +// if the timeouts in order then the test is PASS. |
| +self.addEventListener('message', function(e) { |
| + if(e.data == "TS1") { |
| + setTimeout(function () { postMessage(1); }, 100); |
|
jochen (gone - plz use gerrit)
2014/09/17 14:47:39
can you use lower timeouts 5, 10, 15? so the test
Mayur Kankanwadi
2014/09/18 14:34:25
Done.
|
| + setTimeout(function () { postMessage(2); }, 200); |
| + setTimeout(function () { postMessage(3); }, 300); |
| + } |
| + else if(e.data == "TS2") { |
| + setTimeout(function () { postMessage(3); postMessage("DONE"); }, 300); |
| + setTimeout(function () { postMessage(2); }, 200); |
| + setTimeout(function () { postMessage(1); }, 100); |
| + } |
| +}, false); |