summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/wasm/webapi/instantiateStreaming-bad-imports.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/wasm/webapi/instantiateStreaming-bad-imports.any.js')
-rw-r--r--testing/web-platform/tests/wasm/webapi/instantiateStreaming-bad-imports.any.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/web-platform/tests/wasm/webapi/instantiateStreaming-bad-imports.any.js b/testing/web-platform/tests/wasm/webapi/instantiateStreaming-bad-imports.any.js
new file mode 100644
index 0000000000..38ecc40252
--- /dev/null
+++ b/testing/web-platform/tests/wasm/webapi/instantiateStreaming-bad-imports.any.js
@@ -0,0 +1,13 @@
+// META: global=window,worker
+// META: script=/wasm/jsapi/wasm-module-builder.js
+// META: script=/wasm/jsapi/bad-imports.js
+
+test_bad_imports((name, error, build, ...args) => {
+ promise_test(t => {
+ const builder = new WasmModuleBuilder();
+ build(builder);
+ const buffer = builder.toBuffer();
+ const response = new Response(buffer, { "headers": { "Content-Type": "application/wasm" } });
+ return promise_rejects_js(t, error, WebAssembly.instantiateStreaming(response, ...args));
+ }, name);
+});