mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision d8b8e0b8efe993a37404d6c6fc75e16fdc16b7d8
This commit is contained in:
parent
abc0f50d20
commit
e07315e6af
221 changed files with 7334 additions and 774 deletions
28
tests/wpt/web-platform-tests/wasm/webapi/invalid-args.any.js
Normal file
28
tests/wpt/web-platform-tests/wasm/webapi/invalid-args.any.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
// META: global=window,worker
|
||||
|
||||
const invalidArguments = [
|
||||
[undefined],
|
||||
[null],
|
||||
[true],
|
||||
["test"],
|
||||
[Symbol()],
|
||||
[0],
|
||||
[0.1],
|
||||
[NaN],
|
||||
[{}, "Empty object"],
|
||||
[Response, "Response interface object"],
|
||||
[Response.prototype, "Response interface prototype object"],
|
||||
];
|
||||
|
||||
for (const method of ["compileStreaming", "instantiateStreaming"]) {
|
||||
for (const [argument, name = format_value(argument)] of invalidArguments) {
|
||||
promise_test(t => {
|
||||
return promise_rejects(t, new TypeError(), WebAssembly[method](argument));
|
||||
}, `${method}: ${name}`);
|
||||
|
||||
promise_test(t => {
|
||||
const promise = Promise.resolve(argument);
|
||||
return promise_rejects(t, new TypeError(), WebAssembly[method](argument));
|
||||
}, `${method}: ${name} in a promise`);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue