mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1260312 - Retry mochitest-chrome redirection to improve reliability; r=jmaher
The mochitest-chrome harness sends a custom "contentEvent" event from redirect.html to a listener in browser-test.js. It is possible for redirect.html to be loaded and send contentEvent before the listener is set up in browser-test.js. In the absence of a better synchronization strategy, redirect.html now retries the send after a few seconds. If the first contentEvent was received, the second will be ignored; if the first contentEvent was not received, the second should avoid an intermittent harness hang and timeout.
This commit is contained in:
parent
935d7cfd4b
commit
9552c26f47
@ -27,6 +27,8 @@
|
||||
// added until then.
|
||||
window.addEventListener("MozAfterPaint", function() {
|
||||
setTimeout(redirectToHarness, 0);
|
||||
// In case the listener was not ready, try again after a few seconds.
|
||||
setTimeout(redirectToHarness, 5000);
|
||||
}, {once: true});
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user