Backed out changeset 44cb72be622d (bug 1081135)
authorTim Taubert <ttaubert@mozilla.com>
Mon, 13 Oct 2014 14:58:15 +0200
changeset 210105 43633c475f582976c10c8d2e0a190681618022b0
parent 210104 28b0797c12c163474e9a4d627dbb149ecbd9a37f
child 210106 5c865feae9f53350f713e0307194bd111363984a
push id9338
push userttaubert@mozilla.com
push dateMon, 13 Oct 2014 12:59:12 +0000
treeherderfx-team@2dda4e376d60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1081135
milestone35.0a1
backs out44cb72be622dc5581a944eab309738232ab104c3
Backed out changeset 44cb72be622d (bug 1081135)
browser/components/sessionstore/SessionStore.jsm
browser/components/sessionstore/test/browser_revive_windows.js
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -1012,16 +1012,20 @@ let SessionStoreInternal = {
 
       if (isFullyLoaded) {
         winData.title = tabbrowser.selectedBrowser.contentTitle || tabbrowser.selectedTab.label;
         winData.title = this._replaceLoadingTitle(winData.title, tabbrowser,
                                                   tabbrowser.selectedTab);
         SessionCookies.update([winData]);
       }
 
+      // Until we decide otherwise elsewhere, this window is part of a series
+      // of closing windows to quit.
+      RevivableWindows.add(winData);
+
       // Store the window's close date to figure out when each individual tab
       // was closed. This timestamp should allow re-arranging data based on how
       // recently something was closed.
       winData.closedAt = Date.now();
 
       // Save non-private windows if they have at
       // least one saveable tab or are the last window.
       if (!winData.isPrivate) {
@@ -1042,20 +1046,16 @@ let SessionStoreInternal = {
 
         if (hasSaveableTabs || isLastWindow) {
           // we don't want to save the busy state
           delete winData.busy;
 
           this._closedWindows.unshift(winData);
           this._capClosedWindows();
         }
-
-        // Until we decide otherwise elsewhere, this window
-        // is part of a series of closing windows to quit.
-        RevivableWindows.add(winData);
       }
 
       // clear this window from the list
       delete this._windows[aWindow.__SSi];
 
       // save the state without this window to disk
       this.saveStateDelayed();
     }
--- a/browser/components/sessionstore/test/browser_revive_windows.js
+++ b/browser/components/sessionstore/test/browser_revive_windows.js
@@ -34,26 +34,16 @@ add_task(function* test_revive_windows()
   for (let i = 0; i < 3; i++) {
     let win = yield promiseNewWindow();
     windows.push(win);
 
     let tab = win.gBrowser.addTab("about:mozilla");
     yield promiseBrowserLoaded(tab.linkedBrowser);
   }
 
-  // Create a private window.
-  // This window must not be revived.
-  {
-    let win = yield promiseNewWindow({private: true});
-    windows.push(win);
-
-    let tab = win.gBrowser.addTab("about:mozilla");
-    yield promiseBrowserLoaded(tab.linkedBrowser);
-  }
-
   // Close all windows.
   for (let win of windows) {
     yield promiseWindowClosed(win);
   }
 
   is(ss.getClosedWindowCount(), 1, "one window restorable");
 
   // Save to disk and read.
@@ -144,17 +134,17 @@ add_task(function* test_revive_windows_o
       ok(JSON.stringify(windows[1]).contains(URL_ADD_WINDOW2),
         "correct second additional window");
       ok(JSON.stringify(windows[2]).contains(URL_MAIN_WINDOW),
         "correct main window");
     }
   }
 });
 
-function promiseNewWindow(opts = {private: false}) {
-  return new Promise(resolve => whenNewWindowLoaded(opts, resolve));
+function promiseNewWindow() {
+  return new Promise(resolve => whenNewWindowLoaded({private: false}, resolve));
 }
 
 function forgetClosedWindows() {
   while (ss.getClosedWindowCount()) {
     ss.forgetClosedWindow(0);
   }
 }