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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/wasm/wasm_local_iframe_test.html

Issue 2749503002: [wasm] enable wasm structured cloning in specific cases (Closed)
Patch Set: fixed idb test Created 3 years, 9 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
Index: third_party/WebKit/LayoutTests/http/tests/wasm/wasm_local_iframe_test.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_local_iframe_test.html b/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_local_iframe_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..df83aafcea7df6d4f6cc6f200aad5677fcfeba57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_local_iframe_test.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="resources/load_wasm.js"></script>
+<iframe src="resources/frame.html" id="iframe"></iframe>
+<script>
+ function TestSendToIFrame() {
jbroman 2017/03/27 18:50:52 As a matter of style, some of these console.log ca
Mircea Trofin 2017/03/27 20:52:32 The console were there for my debugging, thanks fo
jbroman 2017/03/28 15:27:25 async/await is the more recent (ES 2017) syntactic
+ var iframe = document.getElementById("iframe").contentWindow;
+ return createWasmModule()
+ .then(mod => {
+ console.log(mod instanceof WebAssembly.Module);
+ console.log("created module");
+ return new Promise((resolve, reject) => {
+ console.log("posted module");
+ iframe.postMessage(mod, "*");
+ iframe.onmessage = function(event) {
+ console.log("got reply");
+ resolve(event.data);
+ }
+ });
+ })
+ .then(ans => assert_equals(ans, 43))
+ .catch(assert_unreached);
+ }
+ promise_test(TestSendToIFrame, "send wasm module to worker");
jbroman 2017/03/27 18:50:52 to iframe, not worker, right?
Mircea Trofin 2017/03/27 20:52:33 Done.
+</script>

Powered by Google App Engine
This is Rietveld 408576698