xref: /third_party/node/test/fixtures/wpt/wasm/webapi/empty-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
31cb0ef41Sopenharmony_ciconst invalidArguments = [
41cb0ef41Sopenharmony_ci  [() => new Response(undefined, { headers: { "Content-Type": "application/wasm" } }), "no body"],
51cb0ef41Sopenharmony_ci  [() => new Response("", { headers: { "Content-Type": "application/wasm" } }), "empty body"],
61cb0ef41Sopenharmony_ci];
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_cifor (const method of ["compileStreaming", "instantiateStreaming"]) {
91cb0ef41Sopenharmony_ci  for (const [argumentFactory, name] of invalidArguments) {
101cb0ef41Sopenharmony_ci    promise_test(t => {
111cb0ef41Sopenharmony_ci      const argument = argumentFactory();
121cb0ef41Sopenharmony_ci      return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly[method](argument));
131cb0ef41Sopenharmony_ci    }, `${method}: ${name}`);
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci    promise_test(t => {
161cb0ef41Sopenharmony_ci      const argument = Promise.resolve(argumentFactory());
171cb0ef41Sopenharmony_ci      return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly[method](argument));
181cb0ef41Sopenharmony_ci    }, `${method}: ${name} in a promise`);
191cb0ef41Sopenharmony_ci  }
201cb0ef41Sopenharmony_ci}
21

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