Bug 1383683 - Fix race in wpt /wasm/wasm_local_iframe_test.html (r=bz)
authorLuke Wagner <luke@mozilla.com>
Wed, 29 Nov 2017 12:07:12 -0600
changeset 394178 e219b2b152d795da623814d7aeae3a89b1d2726e
parent 394177 6b836b1873593a0cd210335fbbe90f8caabdcf75
child 394179 e2a1aee8ddf45bccd9a347170553b364e81d7834
push id97831
push userlwagner@mozilla.com
push dateWed, 29 Nov 2017 18:10:01 +0000
treeherdermozilla-inbound@e219b2b152d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1383683
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1383683 - Fix race in wpt /wasm/wasm_local_iframe_test.html (r=bz) MozReview-Commit-ID: AS9o85KiBMG
testing/web-platform/tests/wasm/wasm_local_iframe_test.html
--- a/testing/web-platform/tests/wasm/wasm_local_iframe_test.html
+++ b/testing/web-platform/tests/wasm/wasm_local_iframe_test.html
@@ -1,17 +1,19 @@
 <!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");
+  function runTests(iframe) {
+      iframe = iframe.contentWindow;
+      promise_test(async function() {
+        var mod = await createWasmModule();
+        assert_true(mod instanceof WebAssembly.Module);
+        var ans = await new Promise((resolve, reject) => {
+          iframe.postMessage(mod, '*');
+          window.addEventListener("message", (reply) => resolve(reply.data), false);
+        });
+        assert_equals(ans, 43);
+      }, "send wasm module to iframe");
+  }
 </script>
+<iframe src="resources/frame.html" onload="runTests(this)"></iframe>