Bug 945979 - Intermittent browser_privatebrowsing_geoprompt.js, r=ehsan

--HG--
extra : rebase_source : 2ccc3019b9912e34fc20824cbed6fee943d962e4
This commit is contained in:
Olli Pettay 2013-12-10 13:40:35 +02:00
parent 7a8b5132d5
commit e04ac8799a
2 changed files with 9 additions and 2 deletions

View File

@ -14,10 +14,14 @@ function test() {
win.removeEventListener("load", onLoad, false);
executeSoon(function() {
info("The second private window got loaded");
let newTab = win.gBrowser.addTab("about:home");
let newTab = win.gBrowser.addTab();
win.gBrowser.selectedTab = newTab;
let tabBrowser = win.gBrowser.getBrowserForTab(newTab);
tabBrowser.addEventListener("load", function tabLoadListener() {
if (win.content.location != "about:home") {
win.content.location = "about:home";
return;
}
tabBrowser.removeEventListener("load", tabLoadListener, true);
executeSoon(function() {
info("about:home got loaded");

View File

@ -14,6 +14,10 @@ function test() {
executeSoon(function() {
aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab();
aWindow.gBrowser.selectedBrowser.addEventListener("load", function () {
if (aWindow.content.location != testPageURL) {
aWindow.content.location = testPageURL;
return;
}
aWindow.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
function runTest() {
@ -36,7 +40,6 @@ function test() {
}
runTest();
}, true);
aWindow.content.location = testPageURL;
});
};