summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/websockets/bug1793935.any.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/mozilla/tests/websockets/bug1793935.any.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/mozilla/tests/websockets/bug1793935.any.js')
-rw-r--r--testing/web-platform/mozilla/tests/websockets/bug1793935.any.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/mozilla/tests/websockets/bug1793935.any.js b/testing/web-platform/mozilla/tests/websockets/bug1793935.any.js
new file mode 100644
index 0000000000..4ef84b3da4
--- /dev/null
+++ b/testing/web-platform/mozilla/tests/websockets/bug1793935.any.js
@@ -0,0 +1,23 @@
+// The module has an import that's immediately called by the start function.
+const module = new Uint8Array([
+ 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96,
+ 0, 0, 2, 7, 1, 1, 97, 1, 98, 0, 0, 3,
+ 2, 1, 0, 8, 1, 1, 10, 6, 1, 4, 0, 16,
+ 0, 11, 0, 36, 16, 115, 111, 117, 114, 99, 101, 77,
+ 97, 112, 112, 105, 110, 103, 85, 82, 76, 18, 46, 47,
+ 114, 101, 108, 101, 97, 115, 101, 46, 119, 97, 115, 109,
+ 46, 109, 97, 112
+]);
+
+// The WebSocket server does not need to exist, because the bug occurs before
+// any connection is attempted.
+const imports = {
+ a: {
+ b: Reflect.construct.bind(null, WebSocket, ["ws://localhost:1234"])
+ }
+};
+
+promise_test(
+ () => WebAssembly.instantiate(module, imports),
+ "Ensure WebSockets can be constructed from WebAssembly"
+); \ No newline at end of file