From dfa311df812795fba3040f1249da8c8267d26c03 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 4 Nov 2010 18:20:42 -0400 Subject: [PATCH] Backed out changeset 119ed9cbd3c6 because of browser-chrome orange --- browser/base/content/browser.js | 6 ++--- ...owser_privatebrowsing_newwindow_stopcmd.js | 23 ++++++++++--------- .../browser_privatebrowsing_windowtitle.js | 9 ++++++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index dc95c9571028..65310db85584 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1252,9 +1252,6 @@ function BrowserStartup() { BookmarksMenuButton.init(); - // initialize the private browsing UI - gPrivateBrowsingUI.init(); - setTimeout(delayedStartup, 0, isLoadingBlank, mustLoadSidebar); } @@ -1540,6 +1537,9 @@ 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); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_newwindow_stopcmd.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_newwindow_stopcmd.js index 5562f296f907..c1c7b4e44470 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_newwindow_stopcmd.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_newwindow_stopcmd.js @@ -47,16 +47,17 @@ function test() { pb.privateBrowsingEnabled = true; let win = OpenBrowserWindow(); - 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"); + 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.close(); - pb.privateBrowsingEnabled = false; - finish(); - }); - }, false); + 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); } diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js index a0e8c6dae123..bc72e185198a 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js @@ -93,14 +93,19 @@ function test() { win.addEventListener("load", function() { win.removeEventListener("load", arguments.callee, false); - executeSoon(function() { + // ensure that the test is run after delayedStartup + 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 + " detached tab is correct (" + (insidePB ? "inside" : "outside") + " private browsing mode)"); win.close(); setTimeout(funcNext, 0); - }); + }; }, false); }); }, false);