Chromium Code Reviews| 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> |