Backed out changeset 9c92da2ea3d7 (bug 844561) for mochitest b-c orange.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 05 Mar 2013 12:53:43 -0500
changeset 123854 f29a926e2bdb97d236a5b5e55c19002ec79a6db5
parent 123853 45d4f7b16c2fa5b9ed1dabe51a2b78156932b6d4
child 123855 3d81fc67e6ed96566a1248538bc8d561aa071555
push id1401
push userpastithas@mozilla.com
push dateThu, 07 Mar 2013 07:26:45 +0000
treeherderfx-team@ee4879719f78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs844561
milestone22.0a1
backs out9c92da2ea3d7bdc5cf625e62f5fd1cf5c91c919d
Backed out changeset 9c92da2ea3d7 (bug 844561) for mochitest b-c orange.
browser/base/content/browser.js
browser/base/content/test/Makefile.in
browser/base/content/test/browser_private_no_prompt.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6393,46 +6393,45 @@ function warnAboutClosingWindow() {
   // Popups aren't considered full browser windows.
   let isPBWindow = PrivateBrowsingUtils.isWindowPrivate(window);
   if (!isPBWindow && !toolbar.visible)
     return gBrowser.warnAboutClosingTabs(true);
 
   // Figure out if there's at least one other browser window around.
   let e = Services.wm.getEnumerator("navigator:browser");
   let otherPBWindowExists = false;
-  let nonPopupPresent = false;
+  let warnAboutClosingTabs = false;
   while (e.hasMoreElements()) {
     let win = e.getNext();
     if (win != window) {
       if (isPBWindow && PrivateBrowsingUtils.isWindowPrivate(win))
         otherPBWindowExists = true;
       if (win.toolbar.visible)
-        nonPopupPresent = true;
+        warnAboutClosingTabs = true;
       // If the current window is not in private browsing mode we don't need to 
       // look for other pb windows, we can leave the loop when finding the 
       // first non-popup window. If however the current window is in private 
       // browsing mode then we need at least one other pb and one non-popup 
       // window to break out early.
-      if ((!isPBWindow || otherPBWindowExists) && nonPopupPresent)
+      if ((!isPBWindow || otherPBWindowExists) && warnAboutClosingTabs)
         break;
     }
   }
 
   if (isPBWindow && !otherPBWindowExists) {
     let exitingCanceled = Cc["@mozilla.org/supports-PRBool;1"].
                           createInstance(Ci.nsISupportsPRBool);
     exitingCanceled.data = false;
     Services.obs.notifyObservers(exitingCanceled,
                                  "last-pb-context-exiting",
                                  null);
     if (exitingCanceled.data)
       return false;
   }
-
-  if (!isPBWindow && nonPopupPresent)
+  if (warnAboutClosingTabs)
     return gBrowser.warnAboutClosingTabs(true);
 
   let os = Services.obs;
 
   let closingCanceled = Cc["@mozilla.org/supports-PRBool;1"].
                         createInstance(Ci.nsISupportsPRBool);
   os.notifyObservers(closingCanceled,
                      "browser-lastwindow-close-requested", null);
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -308,17 +308,16 @@ endif
                  download_page.html \
                  browser_URLBarSetURI.js \
                  browser_bookmark_titles.js \
                  browser_pageInfo_plugins.js \
                  browser_pageInfo.js \
                  feed_tab.html \
                  browser_pluginCrashCommentAndURL.js \
                  pluginCrashCommentAndURL.html \
-                 browser_private_no_prompt.js \
                  $(NULL)
 
 # Disable test on Windows due to frequent failures (bug 841341)
 ifneq (windows,$(MOZ_WIDGET_TOOLKIT))
 _BROWSER_FILES += \
                 browser_popupNotification.js \
                 $(NULL)
 endif
deleted file mode 100644
--- a/browser/base/content/test/browser_private_no_prompt.js
+++ /dev/null
@@ -1,13 +0,0 @@
-function test() {
-  waitForExplicitFinish();
-  var privateWin = OpenBrowserWindow({private: true});
-  privateWin.addEventListener("load", function onload() {
-    privateWin.removeEventListener("load", onload, false);
-    ok(true, "Load listener called");
-
-    privateWin.BrowserOpenTab();
-    privateWin.BrowserTryToCloseWindow();
-    ok(true, "didn't prompt");
-    finish();                        
-  }, false);
-}
\ No newline at end of file