summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/Worker-timeout-cancel-order.html
blob: 78d930df783b9572395c6dcf1ead552dbb7da898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<title>Test setTimeOut,cancelTimeout in Web Workers.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(t => {
  let worker

  return new Promise(resolve => {
    worker = new Worker('support/Worker-timeout-cancel-order.js');
    worker.postMessage('start');
    worker.onmessage = resolve;
  }).then(evt => {
    assert_equals(evt.data, 2, 'Timeout not canceled');
  });
}, 'Tests setting and canceling timeout in workers.');
</script>