Bug 607482 - When in Private Mode, opening a new window causes FF button to flash orange and then turn purple; r=dao a=dietrich

This commit is contained in:
Ehsan Akhgari 2010-10-29 12:30:52 -04:00
parent 06f05e75ce
commit 56f296ce48
3 changed files with 16 additions and 22 deletions

View File

@ -1252,6 +1252,9 @@ function BrowserStartup() {
BookmarksMenuButton.init();
// initialize the private browsing UI
gPrivateBrowsingUI.init();
setTimeout(delayedStartup, 0, isLoadingBlank, mustLoadSidebar);
}
@ -1538,9 +1541,6 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
placesContext.addEventListener("popuphiding", updateEditUIVisibility, false);
#endif
// initialize the private browsing UI
gPrivateBrowsingUI.init();
gBrowser.mPanelContainer.addEventListener("InstallBrowserTheme", LightWeightThemeWebInstaller, false, true);
gBrowser.mPanelContainer.addEventListener("PreviewBrowserTheme", LightWeightThemeWebInstaller, false, true);
gBrowser.mPanelContainer.addEventListener("ResetBrowserThemePreview", LightWeightThemeWebInstaller, false, true);

View File

@ -47,17 +47,16 @@ function test() {
pb.privateBrowsingEnabled = true;
let win = OpenBrowserWindow();
Services.obs.addObserver(function(subject, topic, data) {
Services.obs.removeObserver(arguments.callee, "browser-delayed-startup-finished");
var notifiedWin = subject.QueryInterface(Ci.nsIDOMWindow);
is(win, notifiedWin, "sanity check");
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, false);
executeSoon(function() {
let cmd = win.document.getElementById("Tools:PrivateBrowsing");
ok(!cmd.hasAttribute("disabled"),
"The Private Browsing command in a new window should be enabled");
let cmd = win.document.getElementById("Tools:PrivateBrowsing");
ok(!cmd.hasAttribute("disabled"),
"The Private Browsing command in a new window should be enabled");
win.close();
pb.privateBrowsingEnabled = false;
finish();
}, "browser-delayed-startup-finished", false);
win.close();
pb.privateBrowsingEnabled = false;
finish();
});
}, false);
}

View File

@ -93,19 +93,14 @@ function test() {
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, false);
// ensure that the test is run after delayedStartup
let _delayedStartup = win.delayedStartup;
win.delayedStartup = function() {
_delayedStartup.apply(win, arguments);
win.delayedStartup = _delayedStartup;
executeSoon(function() {
is(win.document.title, expected_title, "The window title for " + url +
" detached tab is correct (" + (insidePB ? "inside" : "outside") +
" private browsing mode)");
win.close();
setTimeout(funcNext, 0);
};
});
}, false);
});
}, false);