summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html')
-rw-r--r--testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html b/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html
new file mode 100644
index 0000000000..0ab41d25c9
--- /dev/null
+++ b/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>connect event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(t => {
+ const worker = new SharedWorker('connect-event.js');
+ worker.port.onmessage = t.step_func_done(e => {
+ assert_true(e.data[0], "e.data === ''");
+ assert_true(e.data[1], "e instanceof MessageEvent");
+ assert_true(e.data[2], "e.ports.length == 1");
+ });
+}, 'Test connect event for a shared worker');
+</script>