зеркало из https://github.com/mozilla/pjs.git
Bug 513420 - random failure in browser_privatebrowsing_windowtitle.js, r=mconnor. Further modified by me, r=ehsan
This commit is contained in:
Родитель
055c90d0fd
Коммит
91971fd031
|
@ -80,12 +80,19 @@ function test() {
|
|||
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// ensure that the test is run after the page onload event
|
||||
setTimeout(function() {
|
||||
setTimeout(function() {
|
||||
// ensure that the test is run after the titlebar has been updated
|
||||
let timer = null;
|
||||
let _updateTitlebar = gBrowser.updateTitlebar;
|
||||
gBrowser.updateTitlebar = function() {
|
||||
if (timer) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
timer = Cc["@mozilla.org/timer;1"].
|
||||
createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(function () {
|
||||
_updateTitlebar.apply(gBrowser, arguments);
|
||||
gBrowser.updateTitlebar = _updateTitlebar;
|
||||
is(document.title, expected_title, "The window title for " + url +
|
||||
" is correct (" + (insidePB ? "inside" : "outside") +
|
||||
" private browsing mode)");
|
||||
|
@ -95,20 +102,22 @@ function test() {
|
|||
win.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
// ensure that the test is run after delayedStartup
|
||||
setTimeout(function() {
|
||||
setTimeout(function() {
|
||||
let _delayedStartup = win.delayedStartup;
|
||||
win.delayedStartup = function() {
|
||||
_delayedStartup.apply(win, arguments);
|
||||
win.delayedStartup = _delayedStartup;
|
||||
|
||||
is(win.document.title, expected_title, "The window title for " + url +
|
||||
" detahced tab is correct (" + (insidePB ? "inside" : "outside") +
|
||||
" detached tab is correct (" + (insidePB ? "inside" : "outside") +
|
||||
" private browsing mode)");
|
||||
win.close();
|
||||
|
||||
funcNext();
|
||||
}, 0);
|
||||
}, 0);
|
||||
setTimeout(funcNext, 0);
|
||||
};
|
||||
}, false);
|
||||
}, 0);
|
||||
}, 0);
|
||||
}, true);
|
||||
}, 300, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
};
|
||||
|
||||
browser.loadURI(url);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче