summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/web-locks/crashtests/worker-termination.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/web-locks/crashtests/worker-termination.https.html')
-rw-r--r--testing/web-platform/tests/web-locks/crashtests/worker-termination.https.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/web-locks/crashtests/worker-termination.https.html b/testing/web-platform/tests/web-locks/crashtests/worker-termination.https.html
new file mode 100644
index 0000000000..b9b988b36c
--- /dev/null
+++ b/testing/web-platform/tests/web-locks/crashtests/worker-termination.https.html
@@ -0,0 +1,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>