Stop using promise_rejects in wasm tests
diff --git a/wasm/jsapi/constructor/compile.any.js b/wasm/jsapi/constructor/compile.any.js
index 817b178..6c41239 100644
--- a/wasm/jsapi/constructor/compile.any.js
+++ b/wasm/jsapi/constructor/compile.any.js
@@ -60,12 +60,12 @@
promise_test(t => {
const buffer = new Uint8Array();
- return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly.compile(buffer));
+ return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly.compile(buffer));
}, "Empty buffer");
promise_test(t => {
const buffer = new Uint8Array(Array.from(emptyModuleBinary).concat([0, 0]));
- return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly.compile(buffer));
+ return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly.compile(buffer));
}, "Invalid code");
promise_test(() => {
diff --git a/wasm/jsapi/constructor/instantiate.any.js b/wasm/jsapi/constructor/instantiate.any.js
index 7f5f1f0..0218de2 100644
--- a/wasm/jsapi/constructor/instantiate.any.js
+++ b/wasm/jsapi/constructor/instantiate.any.js
@@ -135,12 +135,12 @@
promise_test(t => {
const buffer = new Uint8Array();
- return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly.instantiate(buffer));
+ return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly.instantiate(buffer));
}, "Empty buffer");
promise_test(t => {
const buffer = new Uint8Array(Array.from(emptyModuleBinary).concat([0, 0]));
- return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly.instantiate(buffer));
+ return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly.instantiate(buffer));
}, "Invalid code");
promise_test(() => {
diff --git a/wasm/webapi/abort.any.js b/wasm/webapi/abort.any.js
index 839de16..8de8870 100644
--- a/wasm/webapi/abort.any.js
+++ b/wasm/webapi/abort.any.js
@@ -9,8 +9,8 @@
const signal = controller.signal;
controller.abort();
const request = fetch('../incrementer.wasm', { signal });
- return promise_rejects(t, 'AbortError', WebAssembly[method](request),
- `${method} should reject`);
+ return promise_rejects_dom(t, 'AbortError', WebAssembly[method](request),
+ `${method} should reject`);
}, `${method}() on an already-aborted request should reject with AbortError`);
promise_test(async t => {
@@ -19,7 +19,7 @@
const request = fetch('../incrementer.wasm', { signal });
const promise = WebAssembly[method](request);
controller.abort();
- return promise_rejects(t, 'AbortError', promise, `${method} should reject`);
+ return promise_rejects_dom(t, 'AbortError', promise, `${method} should reject`);
}, `${method}() synchronously followed by abort should reject with AbortError`);
promise_test(async t => {
diff --git a/wasm/webapi/empty-body.any.js b/wasm/webapi/empty-body.any.js
index 2f4d5ab..0771647 100644
--- a/wasm/webapi/empty-body.any.js
+++ b/wasm/webapi/empty-body.any.js
@@ -9,12 +9,12 @@
for (const [argumentFactory, name] of invalidArguments) {
promise_test(t => {
const argument = argumentFactory();
- return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly[method](argument));
+ return promise_rejects_js(t, 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));
+ return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly[method](argument));
}, `${method}: ${name} in a promise`);
}
}
diff --git a/wasm/webapi/invalid-code.any.js b/wasm/webapi/invalid-code.any.js
index 522f423..2b901ae 100644
--- a/wasm/webapi/invalid-code.any.js
+++ b/wasm/webapi/invalid-code.any.js
@@ -10,6 +10,6 @@
promise_test(t => {
const buffer = new Uint8Array(Array.from(emptyModuleBinary).concat([0, 0]));
const response = new Response(buffer, { headers: { "Content-Type": "application/wasm" } });
- return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly[method](response));
+ return promise_rejects_js(t, WebAssembly.CompileError, WebAssembly[method](response));
}, `Invalid code: ${method}`);
}
diff --git a/wasm/webapi/rejected-arg.any.js b/wasm/webapi/rejected-arg.any.js
index c6da1e5..49018db 100644
--- a/wasm/webapi/rejected-arg.any.js
+++ b/wasm/webapi/rejected-arg.any.js
@@ -4,6 +4,6 @@
promise_test(t => {
const error = { "name": "custom error" };
const promise = Promise.reject(error);
- return promise_rejects(t, error, WebAssembly[method](promise));
+ return promise_rejects_exactly(t, error, WebAssembly[method](promise));
}, `${method}`);
}