mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 05:39:41 +02:00
Automatic update from web-platform-testsAdd some tests for invalid arguments to WebAssembly.*Streaming. -- Test some invalid HTTP statuses. -- Test cross-origin responses for WebAssembly. -- Add tests for case differences in the wasm content type. -- Add a test for empty bodies. -- Add a test for disturbed bodies. -- Add a test for passing a rejected Promise. -- Add some tests for instantiateStreaming(). -- wpt-commits: 99e7a8e331555e0637a2cee1bda193093df36d5b, 700452f6412a17cbf5586dfa24047a164661f89c, 939a2b9916c01fe18c5f240c09e27be1ff99f0b7, f0e55e90830a2fdea4e99e5fc019c959c3f7c982, 06c65c738bba5e0587d1bde349b4601dd8b932ac, b47da4fd4f519b1fe8bd77582ed57d2c5129e62d, 2832c5d39c644281ac644428c8d09c2443602eae, 36ed1aa52242875634e4b33a50e3fded2787656d wpt-pr: 13652
20 lines
806 B
JavaScript
20 lines
806 B
JavaScript
// META: global=window,worker
|
|
|
|
const invalidArguments = [
|
|
[() => new Response(undefined, { headers: { "Content-Type": "application/wasm" } }), "no body"],
|
|
[() => new Response("", { headers: { "Content-Type": "application/wasm" } }), "empty body"],
|
|
];
|
|
|
|
for (const method of ["compileStreaming", "instantiateStreaming"]) {
|
|
for (const [argumentFactory, name] of invalidArguments) {
|
|
promise_test(t => {
|
|
const argument = argumentFactory();
|
|
return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly[method](argument));
|
|
}, `${method}: ${name}`);
|
|
|
|
promise_test(t => {
|
|
const argument = Promise.resolve(argumentFactory());
|
|
return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly[method](argument));
|
|
}, `${method}: ${name} in a promise`);
|
|
}
|
|
}
|