Index: LayoutTests/fast/workers/resources/worker-timeout-cancel-order.js |
diff --git a/LayoutTests/fast/workers/resources/worker-timeout-cancel-order.js b/LayoutTests/fast/workers/resources/worker-timeout-cancel-order.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8334e71cdb0a7cf4b9736c9b45baa3b04ccc91a1 |
--- /dev/null |
+++ b/LayoutTests/fast/workers/resources/worker-timeout-cancel-order.js |
@@ -0,0 +1,8 @@ |
+self.postMessage("Test started."); |
+// The test will create 3 timeouts with their intervals decreasing. |
+// If the timeouts execute in order then the test is PASS. |
+self.addEventListener('message', function(e) { |
+ var t1 = setTimeout(function () { postMessage(1); }, 5); |
+ setTimeout(function () { postMessage(2); postMessage("DONE"); }, 10); |
+ clearTimeout(t1); |
+}, false); |