diff --git a/accessible/tests/mochitest/browser.js b/accessible/tests/mochitest/browser.js index a396cd26b3bd..74256d434059 100644 --- a/accessible/tests/mochitest/browser.js +++ b/accessible/tests/mochitest/browser.js @@ -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 {