Bug 950342 - Random failures in toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js, r=ehsan

--HG--
extra : rebase_source : c1965dc68e125f1523ee102900afa77ed57ff922
This commit is contained in:
Olli Pettay 2013-12-19 14:54:58 +02:00
Родитель fbb2a33ead
Коммит 1aad93b696
2 изменённых файлов: 14 добавлений и 4 удалений

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

@ -18,6 +18,10 @@ function test() {
function doTest(aIsPrivateMode, aWindow, aTestURI, aCallback) {
aWindow.gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
if (aWindow.gBrowser.selectedBrowser.contentWindow.location != aTestURI) {
aWindow.gBrowser.selectedBrowser.contentWindow.location = aTestURI;
return;
}
aWindow.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
if (aCallback) {

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

@ -340,12 +340,18 @@ function DBConn(aForceNewConnection) {
return gDBConn.connectionReady ? gDBConn : null;
}
function whenDelayedStartupFinished(aWindow, aCallback) {
Services.obs.addObserver(function observer(aSubject, aTopic) {
if (aWindow == aSubject) {
Services.obs.removeObserver(observer, aTopic);
executeSoon(function() { aCallback(aWindow); });
}
}, "browser-delayed-startup-finished", false);
}
function whenNewWindowLoaded(aOptions, aCallback) {
let win = OpenBrowserWindow(aOptions);
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad, false);
aCallback(win);
}, false);
whenDelayedStartupFinished(win, aCallback);
}
/**