https://github.com/web-platform-tests/wpt
Raw File
Tip revision: fa324625246ca3fa5e5d8fdb9caf43650b2943b9 authored by Guido Urdaneta on 03 October 2017, 11:44:18 UTC
Add SpeechRecognition Web Platform Tests
Tip revision: fa32462
wasm_local_iframe_test.html
<!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>
  promise_test(async function() {
    var mod = await createWasmModule();
    assert_true(mod instanceof WebAssembly.Module);
    var ans = await new Promise((resolve, reject) => {
      var iframe = document.getElementById("iframe").contentWindow;
      iframe.postMessage(mod, '*');
      window.addEventListener("message", (reply) => resolve(reply.data), false);
    });
    assert_equals(ans, 43);
  }, "send wasm module to iframe");
</script>
back to top