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

Unified Diff: test/mjsunit/wasm/instantiate-module-basic.js

Issue 2626693002: [wasm] add WebAssembly.instantiate (Closed)
Patch Set: test 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/instantiate-module-basic.js
diff --git a/test/mjsunit/wasm/instantiate-module-basic.js b/test/mjsunit/wasm/instantiate-module-basic.js
index 5e3d1095d24b6f7d69ddf3d4636c36bcbd3c82d4..927851e8682184dac383070d4aa7a6bb2cf2ff55 100644
--- a/test/mjsunit/wasm/instantiate-module-basic.js
+++ b/test/mjsunit/wasm/instantiate-module-basic.js
@@ -57,11 +57,20 @@ function CheckInstance(instance) {
}
// Official API
-let module = new WebAssembly.Module(buffer);
-CheckInstance(new WebAssembly.Instance(module));
+(function BasicJSAPITest() {
+ print("sync module compile...");
+ let module = new WebAssembly.Module(buffer);
+ print("sync module instantiate...");
+ CheckInstance(new WebAssembly.Instance(module));
-let promise = WebAssembly.compile(buffer);
-promise.then(module => CheckInstance(new WebAssembly.Instance(module)));
+ print("async module compile...");
+ let promise = WebAssembly.compile(buffer);
+ promise.then(module => CheckInstance(new WebAssembly.Instance(module)));
+
+ print("async instantiate...");
+ let instance_promise = WebAssembly.instantiate(buffer);
+ instance_promise.then(CheckInstance);
+})();
// Check that validate works correctly for a module.
assertTrue(WebAssembly.validate(buffer));
« 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