Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /wasm/webapi/body.any.html - WPT Dashboard Interop Dashboard
- /wasm/webapi/body.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /wasm/webapi/body.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /wasm/webapi/body.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
// META: script=/wasm/jsapi/wasm-module-builder.js
for (const method of ["compileStreaming", "instantiateStreaming"]) {
promise_test(t => {
const buffer = new WasmModuleBuilder().toBuffer();
const argument = new Response(buffer, { headers: { "Content-Type": "application/wasm" } });
argument.arrayBuffer();
return promise_rejects_js(t, TypeError, WebAssembly[method](argument));
}, `${method} after consumption`);
promise_test(t => {
const buffer = new WasmModuleBuilder().toBuffer();
const argument = new Response(buffer, { headers: { "Content-Type": "application/wasm" } });
const promise = WebAssembly[method](argument);
argument.arrayBuffer();
return promise_rejects_js(t, TypeError, promise);
}, `${method} before consumption`);
}