Worker-timeout-cancel-order.js (316B)
1 // The test will create 2 timeouts and cancel the first one. If only the second 2 // timeout executes then the test passes. 3 self.addEventListener('message', function(e) { 4 var t1 = setTimeout(function () { postMessage(1); }, 5); 5 setTimeout(function () { postMessage(2); }, 10); 6 clearTimeout(t1); 7 }, false);