Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: test/mjsunit/wasm/js-api.js

Issue 2628053004: [wasm] JS-APIs: more WebAssembly.compile tests (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/js-api.js
diff --git a/test/mjsunit/wasm/js-api.js b/test/mjsunit/wasm/js-api.js
index 1e91cfa5aeb912f77c88a7ed2b60ea8cce7736e4..1106853b43b8cf1c8fef8af5d9b7f20471de83d5 100644
--- a/test/mjsunit/wasm/js-api.js
+++ b/test/mjsunit/wasm/js-api.js
@@ -546,11 +546,14 @@ function assertCompileError(args, err, msg) {
//TODO assertEq(Boolean(error.message.match(msg)), true);
}
assertCompileError([], TypeError, /requires more than 0 arguments/);
-//TODO assertCompileError([undefined], TypeError, /first argument must be an ArrayBuffer or typed array object/);
-//TODO assertCompileError([1], TypeError, /first argument must be an ArrayBuffer or typed array object/);
-//TODO assertCompileError([{}], TypeError, /first argument must be an ArrayBuffer or typed array object/);
-//TODO assertCompileError([new Uint8Array()], CompileError, /failed to match magic number/);
-//TODO assertCompileError([new ArrayBuffer()], CompileError, /failed to match magic number/);
+assertCompileError([undefined], TypeError, /first argument must be an ArrayBuffer or typed array object/);
+assertCompileError([1], TypeError, /first argument must be an ArrayBuffer or typed array object/);
+assertCompileError([{}], TypeError, /first argument must be an ArrayBuffer or typed array object/);
+assertCompileError([new Uint8Array()], CompileError, /BufferSource argument is empty/);
+assertCompileError([new ArrayBuffer()], CompileError, /BufferSource argument is empty/);
+assertCompileError([new Uint8Array("hi!")], CompileError, /failed to match magic number/);
+assertCompileError([new ArrayBuffer("hi!")], CompileError, /failed to match magic number/);
+
function assertCompileSuccess(bytes) {
var module = null;
compile(bytes).then(m => module = m);
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698