OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title> AbstractWorker terminate(): clear event queue </title> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <div id=log></div> |
| 6 <script> |
| 7 async_test(function() { |
| 8 var testResult; |
| 9 var worker = new Worker('./support/WorkerTerminate.js'); |
| 10 worker.onmessage = this.step_func(function(e) { |
| 11 testResult = e.data; |
| 12 if (testResult >= 10000) { |
| 13 worker.terminate(); |
| 14 worker.onmessage = this.unreached_func('Unexpected message event'); |
| 15 setTimeout(this.step_func_done(function() { |
| 16 assert_equals(testResult, 10000); |
| 17 }), 100); |
| 18 } |
| 19 }); |
| 20 worker.postMessage("ping"); |
| 21 }); |
| 22 </script> |
OLD | NEW |