summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html')
-rw-r--r--testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html
new file mode 100644
index 0000000000..8f27533ed1
--- /dev/null
+++ b/testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<title>Construction of Web Workers is deferred</title>
+<script src="utils.js"></script>
+<body>
+<script type="module">
+
+const bc = new PrerenderChannel('test-channel');
+const worker = new Worker('worker-post-timeOrigin.js');
+worker.onerror = e => bc.postMessage('Fail');
+await new Promise(resolve => worker.onmessage = resolve);
+bc.postMessage('Success');
+
+</script>
+</body>
+</html>