Commit cc1c476f authored by Mircea Trofin's avatar Mircea Trofin Committed by Commit Bot

[wasm] Fail remote post message test if about:blank can't open

Instead of waiting until the test harness timeouts the test, we
wait for a set period of time for the about:blank window to open,
after which we fail the test.

Bug: chromium:765738
Change-Id: I8635c19683a3791801bc3e75a3fc3bf16872b6f2
Reviewed-on: https://chromium-review.googlesource.com/676283
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: default avatarBrad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504467}
parent 8602777b
......@@ -10,14 +10,19 @@ promise_test(async function() {
assert_true(mod instanceof WebAssembly.Module);
var remote;
await new Promise((resolve, reject) => {
var nr_of_tries = 0;
var i = setInterval(()=>{
try {
remote.document;
++nr_of_tries;
if(nr_of_tries > 30) {
reject();
}
} catch(e) {
clearInterval(i);
resolve();
}
}, 100);
}, 1000);
remote = window.open("about:blank");
remote.opener = null;
remote.location = remote_loc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment