Bug 1607984 - P15. Wait for the load to start before setting the event handler. r=Jamie

addA11yLoadEvent gets the contentWindow and wait for the document from that window to fire the load event.

Enabling the DocumentChannel for parent process load (or here in non-e10s mode) we have one extra event loop before the load starts.
So the window passed to addAllyLoadEvent would have been of the about:blank page.

The current code was based on an observable behaviour which was that the load was occuring synchronously.

DocumentChannel broke that assumption.

Differential Revision: https://phabricator.services.mozilla.com/D70799
This commit is contained in:
Jean-Yves Avenard 2020-04-24 01:46:10 +00:00
Родитель e52d800eb6
Коммит 6392e85f33
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -135,6 +135,11 @@ function openBrowserWindowIntl() {
function startBrowserTests() {
if (gBrowserContext.startURL) {
// Make sure the window is the one loading our URL.
if (currentBrowser().contentWindow.location != gBrowserContext.startURL) {
setTimeout(startBrowserTests, 0);
return;
}
// wait for load
addA11yLoadEvent(gBrowserContext.testFunc, currentBrowser().contentWindow);
} else {