summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/web-locks/crashtests/worker-termination.https.html
blob: b9b988b36c27e68bd0b1bb18763fb591f07d6845 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html class="test-wait">
<meta charset="utf-8">
<script>
  var worker = new Worker(URL.createObjectURL(new Blob([`
    postMessage("hi");
    (async () => {
      const abort = new AbortController()
      await navigator.locks.request("weblock_0", { signal: abort.signal }, () => {})
    })()
  `])));
  worker.onmessage = () => {
    worker.terminate();
    document.documentElement.classList.remove("test-wait");
  };
</script>