Backed out changeset 7878092679cf (bug 819202)
authorJosh Matthews <josh@joshmatthews.net>
Thu, 13 Dec 2012 21:11:11 -0500
changeset 116024 0a05fb0f9addff5e86827abc658b1fd83d92a148
parent 116023 65da8135423fd0ab65e9b31dff0d418587855c9e
child 116025 032490690d651535e1d9ec2017403db8e166d29c
push id24034
push useremorley@mozilla.com
push dateFri, 14 Dec 2012 15:28:57 +0000
treeherdermozilla-central@50d8f411d305 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs819202
milestone20.0a1
backs out7878092679cfc5bb217894bbced986a529f63aa9
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 7878092679cf (bug 819202)
browser/base/content/browser.js
browser/base/content/test/browser_private_browsing_window.js
browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_ui.js
browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_newwindow_stopcmd.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3489,26 +3489,27 @@ function OpenBrowserWindow(options)
 
   var charsetArg = new String();
   var handler = Components.classes["@mozilla.org/browser/clh;1"]
                           .getService(Components.interfaces.nsIBrowserHandler);
   var defaultArgs = handler.defaultArgs;
   var wintype = document.documentElement.getAttribute('windowtype');
 
   var extraFeatures = "";
+  var forcePrivate = false;
 #ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
-  if (typeof options == "object" && options.private) {
+  forcePrivate = typeof options == "object" && "private" in options && options.private;
 #else
-  if (gPrivateBrowsingUI.privateBrowsingEnabled) {
+  forcePrivate = gPrivateBrowsingUI.privateBrowsingEnabled;
 #endif
+
+  if (forcePrivate) {
     extraFeatures = ",private";
     // Force the new window to load about:privatebrowsing instead of the default home page
     defaultArgs = "about:privatebrowsing";
-  } else {
-    extraFeatures = ",non-private";
   }
 
   // if and only if the current window is a browser window and it has a document with a character
   // set, then extract the current charset menu setting from the current document and use it to
   // initialize the new browser window...
   var win;
   if (window && (wintype == "navigator:browser") && window.content && window.content.document)
   {
--- a/browser/base/content/test/browser_private_browsing_window.js
+++ b/browser/base/content/test/browser_private_browsing_window.js
@@ -1,24 +1,11 @@
 // Make sure that we can open private browsing windows
 
 function test() {
-  waitForExplicitFinish();
   var nonPrivateWin = OpenBrowserWindow();
   ok(!PrivateBrowsingUtils.isWindowPrivate(nonPrivateWin), "OpenBrowserWindow() should open a normal window");
   nonPrivateWin.close();
-
   var privateWin = OpenBrowserWindow({private: true});
   ok(PrivateBrowsingUtils.isWindowPrivate(privateWin), "OpenBrowserWindow({private: true}) should open a private window");
-
-  nonPrivateWin = OpenBrowserWindow({private: false});
-  ok(!PrivateBrowsingUtils.isWindowPrivate(nonPrivateWin), "OpenBrowserWindow({private: false}) should open a normal window");
-  nonPrivateWin.close();
-
-  whenDelayedStartupFinished(privateWin, function() {
-    nonPrivateWin = privateWin.OpenBrowserWindow({private: false});
-    ok(!PrivateBrowsingUtils.isWindowPrivate(nonPrivateWin), "privateWin.OpenBrowserWindow({private: false}) should open a normal window");
-    nonPrivateWin.close();
-    privateWin.close();
-    finish();
-  });
+  privateWin.close();
 }
 
--- a/browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_ui.js
+++ b/browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_ui.js
@@ -35,17 +35,17 @@ function test() {
             aCallback();
             Services.obs.removeObserver(observer2, "domwindowclosed");
           }, "domwindowclosed", false);
           aSubject.close();
         });
         Services.obs.removeObserver(observer1, "domwindowopened");
       }, false);
     }, "domwindowopened", false);
-    OpenBrowserWindow({private: PrivateBrowsingUtils.isWindowPrivate(window)});
+    OpenBrowserWindow();
   }
 
   // test the gPrivateBrowsingUI object
   ok(gPrivateBrowsingUI, "The gPrivateBrowsingUI object exists");
   is(pb.privateBrowsingEnabled, false, "The private browsing mode should not be started initially");
   is(gPrivateBrowsingUI.privateBrowsingEnabled, false, "gPrivateBrowsingUI should expose the correct private browsing status");
   is(PrivateBrowsingUtils.isWindowPrivate(window), false, "PrivateBrowsingUtils should expose the correct per-window private browsing status");
   ok(pbMenuItem, "The Private Browsing menu item exists");
--- a/browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_newwindow_stopcmd.js
+++ b/browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_newwindow_stopcmd.js
@@ -8,17 +8,17 @@
 function test() {
   // initialization
   let pb = Cc["@mozilla.org/privatebrowsing;1"].
            getService(Ci.nsIPrivateBrowsingService);
   waitForExplicitFinish();
 
   pb.privateBrowsingEnabled = true;
 
-  let win = OpenBrowserWindow({private: PrivateBrowsingUtils.isWindowPrivate(window)});
+  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");
 
       win.close();