Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../../resources/testharness.js"></script> | |
| 3 <script src="../../../resources/testharnessreport.js"></script> | |
| 4 <script src="resources/load_wasm.js"></script> | |
| 5 <iframe src="resources/frame.html" id="iframe"></iframe> | |
| 6 <script> | |
| 7 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
| |
| 8 var iframe = document.getElementById("iframe").contentWindow; | |
| 9 return createWasmModule() | |
| 10 .then(mod => { | |
| 11 console.log(mod instanceof WebAssembly.Module); | |
| 12 console.log("created module"); | |
| 13 return new Promise((resolve, reject) => { | |
| 14 console.log("posted module"); | |
| 15 iframe.postMessage(mod, "*"); | |
| 16 iframe.onmessage = function(event) { | |
| 17 console.log("got reply"); | |
| 18 resolve(event.data); | |
| 19 } | |
| 20 }); | |
| 21 }) | |
| 22 .then(ans => assert_equals(ans, 43)) | |
| 23 .catch(assert_unreached); | |
| 24 } | |
| 25 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.
| |
| 26 </script> | |
| OLD | NEW |