xref: /third_party/node/test/fixtures/wpt/wasm/webapi/body.any.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/wpt/wasm/webapi/
11cb0ef41Sopenharmony_ci// META: global=window,worker
21cb0ef41Sopenharmony_ci// META: script=/wasm/jsapi/wasm-module-builder.js
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_cifor (const method of ["compileStreaming", "instantiateStreaming"]) {
51cb0ef41Sopenharmony_ci  promise_test(t => {
61cb0ef41Sopenharmony_ci    const buffer = new WasmModuleBuilder().toBuffer();
71cb0ef41Sopenharmony_ci    const argument = new Response(buffer, { headers: { "Content-Type": "application/wasm" } });
81cb0ef41Sopenharmony_ci    argument.arrayBuffer();
91cb0ef41Sopenharmony_ci    return promise_rejects_js(t, TypeError, WebAssembly[method](argument));
101cb0ef41Sopenharmony_ci  }, `${method} after consumption`);
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci  promise_test(t => {
131cb0ef41Sopenharmony_ci    const buffer = new WasmModuleBuilder().toBuffer();
141cb0ef41Sopenharmony_ci    const argument = new Response(buffer, { headers: { "Content-Type": "application/wasm" } });
151cb0ef41Sopenharmony_ci    const promise = WebAssembly[method](argument);
161cb0ef41Sopenharmony_ci    argument.arrayBuffer();
171cb0ef41Sopenharmony_ci    return promise_rejects_js(t, TypeError, promise);
181cb0ef41Sopenharmony_ci  }, `${method} before consumption`);
191cb0ef41Sopenharmony_ci}
20

Indexes created Thu Nov 07 10:32:03 CST 2024