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

Unified Diff: test/mjsunit/wasm/compiled-module-serialization.js

Issue 2339933003: [wasm] additional serialization test (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/compiled-module-serialization.js
diff --git a/test/mjsunit/wasm/compiled-module-serialization.js b/test/mjsunit/wasm/compiled-module-serialization.js
index 94cc894275c793bdc64f42798db5284aa04a56ac..00b9d19597074264d0dfd3eb575864019b32333d 100644
--- a/test/mjsunit/wasm/compiled-module-serialization.js
+++ b/test/mjsunit/wasm/compiled-module-serialization.js
@@ -77,4 +77,24 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertFalse(clone == undefined);
assertFalse(clone == compiled_module);
assertEquals(clone.constructor, compiled_module.constructor);
-})()
+})();
+
+(function SerializeAfterInstantiation() {
+ let builder = new WasmModuleBuilder();
+ builder.addFunction("main", kSig_i)
+ .addBody([kExprI8Const, 42])
+ .exportFunc();
+
+ var compiled_module = new WebAssembly.Module(builder.toBuffer());
+ var instance1 = new WebAssembly.Instance(compiled_module);
+ var instance2 = new WebAssembly.Instance(compiled_module);
+ var serialized = %SerializeWasmModule(compiled_module);
+ var clone = %DeserializeWasmModule(serialized);
+
+ assertNotNull(clone);
+ assertFalse(clone == undefined);
+ assertFalse(clone == compiled_module);
+ assertEquals(clone.constructor, compiled_module.constructor);
+ var instance3 = new WebAssembly.Instance(clone);
+ assertFalse(instance3 == undefined);
+})();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698