Bug 1383876 - Part 2: Remove GroupedSHistory and Prerendering logic from JS code, r=freesamael
authorNika Layzell <nika@thelayzells.com>
Thu, 14 Dec 2017 16:03:28 -0600
changeset 399102 156088fcf75b204490765b88ce77c9c7047df2fe
parent 399101 156c6bee175292f31da108aae281a413d61600e6
child 399103 e89b001fd9f5da0581f47cec775f63e295670fe7
push id98894
push usernika@thelayzells.com
push dateFri, 12 Jan 2018 22:56:19 +0000
treeherdermozilla-inbound@6d9855f7bfdb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfreesamael
bugs1383876
milestone59.0a1
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
Bug 1383876 - Part 2: Remove GroupedSHistory and Prerendering logic from JS code, r=freesamael MozReview-Commit-ID: KwvOcgQKheK
browser/base/content/tabbrowser.xml
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_close_dependent_tabs.js
browser/components/sessionstore/SessionStore.jsm
browser/components/sessionstore/content/content-sessionStore.js
browser/components/sessionstore/test/browser.ini
browser/components/sessionstore/test/browser_grouped_session_store.js
docshell/test/browser/browser.ini
docshell/test/browser/browser_grouped_shistory_bfcache_cleaning.js
docshell/test/browser/browser_grouped_shistory_crossproc.js
docshell/test/browser/browser_grouped_shistory_dead_navigate.js
dom/base/test/chrome/chrome.ini
dom/base/test/chrome/test_groupedSHistory.xul
dom/base/test/chrome/window_groupedSHistory.xul
dom/tests/browser/browser.ini
dom/tests/browser/browser_prerendering.js
dom/tests/browser/prerender.html
dom/tests/browser/prerender_target.html
dom/xul/test/1061864.html
dom/xul/test/chrome.ini
dom/xul/test/file_bug1069772.xul
dom/xul/test/file_bug1271240.xul
dom/xul/test/test_bug1061864_1.xul
dom/xul/test/test_bug1061864_2.xul
dom/xul/test/test_bug1069772.xul
dom/xul/test/test_bug1271240.xul
toolkit/components/extensions/ext-browser-content.js
toolkit/modules/sessionstore/SessionHistory.jsm
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1727,17 +1727,16 @@
             var aForceNotRemote;
             var aPreferredRemoteType;
             var aNoReferrer;
             var aUserContextId;
             var aSameProcessAsFrameLoader;
             var aOriginPrincipal;
             var aOpener;
             var aOpenerBrowser;
-            var aIsPrerendered;
             var aCreateLazyBrowser;
             var aNextTabParentId;
             var aFocusUrlBar;
             var aName;
             if (arguments.length == 2 &&
                 typeof arguments[1] == "object" &&
                 !(arguments[1] instanceof Ci.nsIURI)) {
               let params = arguments[1];
@@ -1755,17 +1754,16 @@
               aForceNotRemote           = params.forceNotRemote;
               aPreferredRemoteType      = params.preferredRemoteType;
               aNoReferrer               = params.noReferrer;
               aUserContextId            = params.userContextId;
               aSameProcessAsFrameLoader = params.sameProcessAsFrameLoader;
               aOriginPrincipal          = params.originPrincipal;
               aOpener                   = params.opener;
               aOpenerBrowser            = params.openerBrowser;
-              aIsPrerendered            = params.isPrerendered;
               aCreateLazyBrowser        = params.createLazyBrowser;
               aNextTabParentId          = params.nextTabParentId;
               aFocusUrlBar              = params.focusUrlBar;
               aName                     = params.name;
             }
 
             var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
                          Services.prefs.getBoolPref("browser.tabs.loadInBackground");
@@ -1787,17 +1785,16 @@
                                   createLazyBrowser: aCreateLazyBrowser,
                                   preferredRemoteType: aPreferredRemoteType,
                                   noReferrer: aNoReferrer,
                                   userContextId: aUserContextId,
                                   originPrincipal: aOriginPrincipal,
                                   sameProcessAsFrameLoader: aSameProcessAsFrameLoader,
                                   opener: aOpener,
                                   openerBrowser: aOpenerBrowser,
-                                  isPrerendered: aIsPrerendered,
                                   nextTabParentId: aNextTabParentId,
                                   focusUrlBar: aFocusUrlBar,
                                   name: aName });
             if (!bgLoad)
               this.selectedTab = tab;
 
             return tab;
          ]]>
@@ -2196,32 +2193,28 @@
       </method>
 
       <method name="_createBrowser">
         <parameter name="aParams"/>
         <body>
           <![CDATA[
             // Supported parameters:
             // userContextId, remote, remoteType, isPreloadBrowser,
-            // uriIsAboutBlank, sameProcessAsFrameLoader, isPrerendered
+            // uriIsAboutBlank, sameProcessAsFrameLoader
 
             const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
             let b = document.createElementNS(NS_XUL, "browser");
             b.permanentKey = {};
             b.setAttribute("type", "content");
             b.setAttribute("message", "true");
             b.setAttribute("messagemanagergroup", "browsers");
             b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
             b.setAttribute("tooltip", this.getAttribute("contenttooltip"));
 
-            if (aParams.isPrerendered) {
-              b.setAttribute("prerendered", "true");
-            }
-
             if (aParams.userContextId) {
               b.setAttribute("usercontextid", aParams.userContextId);
             }
 
             // remote parameter used by some addons, use default in this case.
             if (aParams.remote && !aParams.remoteType) {
               aParams.remoteType = E10SUtils.DEFAULT_REMOTE_TYPE;
             }
@@ -2600,17 +2593,16 @@
             var aNoReferrer;
             var aUserContextId;
             var aEventDetail;
             var aSameProcessAsFrameLoader;
             var aOriginPrincipal;
             var aDisallowInheritPrincipal;
             var aOpener;
             var aOpenerBrowser;
-            var aIsPrerendered;
             var aCreateLazyBrowser;
             var aSkipBackgroundNotify;
             var aNextTabParentId;
             var aNoInitialLabel;
             var aFocusUrlBar;
             var aName;
             if (arguments.length == 2 &&
                 typeof arguments[1] == "object" &&
@@ -2632,17 +2624,16 @@
               aNoReferrer               = params.noReferrer;
               aUserContextId            = params.userContextId;
               aEventDetail              = params.eventDetail;
               aSameProcessAsFrameLoader = params.sameProcessAsFrameLoader;
               aOriginPrincipal          = params.originPrincipal;
               aDisallowInheritPrincipal = params.disallowInheritPrincipal;
               aOpener                   = params.opener;
               aOpenerBrowser            = params.openerBrowser;
-              aIsPrerendered            = params.isPrerendered;
               aCreateLazyBrowser        = params.createLazyBrowser;
               aSkipBackgroundNotify     = params.skipBackgroundNotify;
               aNextTabParentId          = params.nextTabParentId;
               aNoInitialLabel           = params.noInitialLabel;
               aFocusUrlBar              = params.focusUrlBar;
               aName                     = params.name;
             }
 
@@ -2690,20 +2681,16 @@
               if (isBlankPageURL(aURI)) {
                 t.setAttribute("label", gTabBrowserBundle.GetStringFromName("tabs.emptyTabTitle"));
               } else {
                 // Set URL as label so that the tab isn't empty initially.
                 this.setInitialTabTitle(t, aURI, { beforeTabOpen: true });
               }
             }
 
-            if (aIsPrerendered) {
-              t.setAttribute("hidden", "true");
-            }
-
             // Related tab inherits current tab's user context unless a different
             // usercontextid is specified
             if (aUserContextId == null && openerTab) {
               aUserContextId = openerTab.getAttribute("usercontextid") || 0;
             }
 
             if (aUserContextId) {
               t.setAttribute("usercontextid", aUserContextId);
@@ -2790,17 +2777,16 @@
 
               if (!b) {
                 // No preloaded browser found, create one.
                 b = this._createBrowser({ remoteType,
                                           uriIsAboutBlank,
                                           userContextId: aUserContextId,
                                           sameProcessAsFrameLoader: aSameProcessAsFrameLoader,
                                           openerWindow: aOpener,
-                                          isPrerendered: aIsPrerendered,
                                           nextTabParentId: aNextTabParentId,
                                           name: aName });
               }
 
               t.linkedBrowser = b;
 
               if (aFocusUrlBar) {
                 b._urlbarFocused = true;
@@ -5819,86 +5805,16 @@
 
                 notificationBox.appendNotification(message, "refresh-blocked",
                                                    "chrome://browser/skin/notification-icons/popup.svg",
                                                    notificationBox.PRIORITY_INFO_MEDIUM,
                                                    buttons);
               }
               break;
             }
-
-            case "Prerender:Request": {
-              let sendCancelPrerendering = () => {
-                browser.frameloader.messageManager.
-                  sendAsyncMessage("Prerender:Canceled", { id: data.id });
-              };
-
-              let tab = this.getTabForBrowser(browser);
-              if (!tab) {
-                // No tab?
-                sendCancelPrerendering();
-                break;
-              }
-
-              if (tab.hidden) {
-                // Skip prerender on hidden tab.
-                sendCancelPrerendering();
-                break;
-              }
-
-              if (browser.canGoForward) {
-                // Skip prerender on history navigation as we don't support it
-                // yet. Remove this check once bug 1323650 is implemented.
-                sendCancelPrerendering();
-                break;
-              }
-
-              if (!data.href) {
-                // If we don't have data.href, loadOneTab will load about:blank
-                // which is meaningless for prerendering.
-                sendCancelPrerendering();
-                break;
-              }
-
-              let groupedSHistory = browser.frameLoader.ensureGroupedSHistory();
-
-              let newTab = this.loadOneTab(data.href, {
-                referrerURI: (data.referrer ? makeURI(data.referrer) : null),
-                referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
-                postData: null,
-                allowThirdPartyFixup: true,
-                relatedToCurrent: true,
-                isPrerendered: true,
-                triggeringPrincipal: Utils.deserializePrincipal(data.triggeringPrincipal),
-              });
-              let partialSHistory = newTab.linkedBrowser.frameLoader.partialSHistory;
-              groupedSHistory.addPrerenderingPartialSHistory(partialSHistory, data.id);
-              break;
-            }
-
-            case "Prerender:Cancel": {
-              let groupedSHistory = browser.frameLoader.groupedSHistory;
-              if (groupedSHistory) {
-                groupedSHistory.cancelPrerendering(data.id);
-              }
-              break;
-            }
-
-            case "Prerender:Swap": {
-              let frameloader = browser.frameLoader;
-              let groupedSHistory = browser.frameLoader.groupedSHistory;
-              if (groupedSHistory) {
-                groupedSHistory.activatePrerendering(data.id).then(
-                  () => frameloader.messageManager.sendAsyncMessage("Prerender:Swapped", data),
-                  () => frameloader.messageManager.sendAsyncMessage("Prerender:Canceled", data),
-                );
-              }
-              break;
-            }
-
           }
           return undefined;
         ]]></body>
       </method>
 
       <method name="observe">
         <parameter name="aSubject"/>
         <parameter name="aTopic"/>
@@ -6055,21 +5971,16 @@
           messageManager.addMessageListener("Browser:WindowCreated", this);
 
           // To correctly handle keypresses for potential FindAsYouType, while
           // the tab's find bar is not yet initialized.
           this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
           Services.prefs.addObserver("accessibility.typeaheadfind", this);
           messageManager.addMessageListener("Findbar:Keypress", this);
 
-          // Add listeners for prerender messages
-          messageManager.addMessageListener("Prerender:Request", this);
-          messageManager.addMessageListener("Prerender:Cancel", this);
-          messageManager.addMessageListener("Prerender:Swap", this);
-
           XPCOMUtils.defineLazyPreferenceGetter(this, "animationsEnabled",
                                                 "toolkit.cosmeticAnimations.enabled", true);
           XPCOMUtils.defineLazyPreferenceGetter(this, "schedulePressureDefaultCount",
                                                 "browser.schedulePressure.defaultCount", 3);
           XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingEnabled",
                                                 "browser.tabs.remote.warmup.enabled", false);
           XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingMax",
                                                 "browser.tabs.remote.warmup.maxTabs", 3);
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -583,11 +583,8 @@ tags = fullscreen
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_newWindowDrop.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_newwindow_focus.js]
 skip-if = (os == "linux" && !e10s) # Bug 1263254 - Perma fails on Linux without e10s for some reason.
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug1299667.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_close_dependent_tabs.js]
-skip-if = !e10s # GroupedSHistory is e10s-only
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
deleted file mode 100644
--- a/browser/base/content/test/general/browser_close_dependent_tabs.js
+++ /dev/null
@@ -1,78 +0,0 @@
-add_task(async function() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.groupedhistory.enabled", true],
-          ["dom.linkPrerender.enabled", true]]
-  });
-
-  // Wait for a process change and then fulfil the promise.
-  function awaitProcessChange(browser) {
-    return new Promise(resolve => {
-      browser.addEventListener("BrowserChangedProcess", function(e) {
-        ok(true, "The browser changed process!");
-        resolve();
-      }, {once: true});
-    });
-  }
-
-  // Wait for given number tabs being closed.
-  function awaitTabClose(number) {
-    return new Promise(resolve => {
-      let seen = 0;
-      gBrowser.tabContainer.addEventListener("TabClose", function f() {
-        if (++seen == number) {
-          gBrowser.tabContainer.removeEventListener("TabClose", f);
-          resolve();
-        }
-      });
-    });
-  }
-
-  // Test 1: Create prerendered browser, and don't switch to it, then close the tab
-  let closed1 = awaitTabClose(2);
-  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
-    // Set up the grouped SHEntry setup
-
-    let requestMade = new Promise(resolve => {
-      browser1.messageManager.addMessageListener("Prerender:Request", function f() {
-        browser1.messageManager.removeMessageListener("Prerender:Request", f);
-        ok(true, "Successfully received the prerender request");
-        resolve();
-      });
-    });
-
-    is(gBrowser.tabs.length, 2);
-    await ContentTask.spawn(browser1, null, function() {
-      let link = content.document.createElement("link");
-      link.setAttribute("rel", "prerender");
-      link.setAttribute("href", "data:text/html,b");
-      content.document.body.appendChild(link);
-    });
-    await requestMade;
-
-    is(gBrowser.tabs.length, 3);
-  });
-  await closed1;
-
-  // At this point prerendered tab should be closed
-  is(gBrowser.tabs.length, 1, "The new tab and the prerendered 'tab' should be closed");
-
-  // Test 2: Create prerendered browser, switch to it, then close the tab
-  let closed2 = awaitTabClose(2);
-  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
-    // Set up the grouped SHEntry setup
-    let tab2 = gBrowser.loadOneTab("data:text/html,b", {
-      referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
-      allowThirdPartyFixup: true,
-      relatedToCurrent: true,
-      isPrerendered: true,
-      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-    });
-    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
-    browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    await awaitProcessChange(browser1);
-  });
-  await closed2;
-
-  // At this point prerendered tab should be closed
-  is(gBrowser.tabs.length, 1, "The new tab and the prerendered 'tab' should be closed");
-});
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -3893,21 +3893,17 @@ var SessionStoreInternal = {
       uri = loadArguments.uri;
       if (loadArguments.userContextId) {
         browser.setAttribute("usercontextid", loadArguments.userContextId);
       }
     }
 
     this.markTabAsRestoring(aTab);
 
-    // We need a new frameloader if we are reloading into a browser with a
-    // grouped session history (as we don't support restoring into browsers
-    // with grouped session histories directly).
-    let newFrameloader =
-      aOptions.newFrameloader || !!browser.frameLoader.groupedSHistory;
+    let newFrameloader = aOptions.newFrameloader;
 
     let isRemotenessUpdate;
     if (aOptions.remoteType !== undefined) {
       // We already have a selected remote type so we update to that.
       isRemotenessUpdate =
         tabbrowser.updateBrowserRemoteness(browser, !!aOptions.remoteType,
                                            { remoteType: aOptions.remoteType,
                                              newFrameloader });
--- a/browser/components/sessionstore/content/content-sessionStore.js
+++ b/browser/components/sessionstore/content/content-sessionStore.js
@@ -229,25 +229,17 @@ var MessageListener = {
       case "SessionStore:resetRestore":
         gContentRestore.resetRestore();
         break;
       case "SessionStore:flush":
         this.flush(data);
         break;
       case "SessionStore:becomeActiveProcess":
         let shistory = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory;
-        // Check if we are at the end of the current session history, if we are,
-        // it is safe for us to collect and transmit our session history, so
-        // transmit all of it. Otherwise, we only want to transmit our index changes,
-        // so collect from kLastIndex.
-        if (shistory.globalCount - shistory.globalIndexOffset == shistory.count) {
-          SessionHistoryListener.collect();
-        } else {
-          SessionHistoryListener.collectFrom(kLastIndex);
-        }
+        SessionHistoryListener.collect();
         break;
       default:
         debug("received unknown message '" + name + "'");
         break;
     }
   },
 
   restoreHistory({epoch, tabData, loadArguments, isRemotenessUpdate}) {
--- a/browser/components/sessionstore/test/browser.ini
+++ b/browser/components/sessionstore/test/browser.ini
@@ -253,18 +253,16 @@ skip-if = os == "linux" && !debug
 run-if = e10s
 [browser_background_tab_crash.js]
 run-if = e10s && crashreporter
 
 # Disabled on debug for frequent intermittent failures:
 [browser_undoCloseById.js]
 skip-if = debug
 [browser_docshell_uuid_consistency.js]
-[browser_grouped_session_store.js]
-skip-if = !e10s # GroupedSHistory is e10s-only
 
 [browser_closed_objects_changed_notifications_tabs.js]
 [browser_closed_objects_changed_notifications_windows.js]
 [browser_duplicate_history.js]
 [browser_tabicon_after_bg_tab_crash.js]
 skip-if = !crashreporter || !e10s # Tabs can't crash without e10s
 
 [browser_cookies.js]
deleted file mode 100644
--- a/browser/components/sessionstore/test/browser_grouped_session_store.js
+++ /dev/null
@@ -1,143 +0,0 @@
-add_task(async function() {
-  const URIs = [
-    "data:text/html,1",
-    "data:text/html,2",
-    "data:text/html,3",
-    "data:text/html,4",
-    "data:text/html,5",
-  ];
-
-  const {TabStateCache} = Cu.import("resource:///modules/sessionstore/TabStateCache.jsm", {});
-  const {TabStateFlusher} = Cu.import("resource:///modules/sessionstore/TabStateFlusher.jsm", {});
-
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.groupedhistory.enabled", true]]
-  });
-
-  // Check that the data stored in the TabStateCache is correct for the current state.
-  async function validate(browser, length, index) {
-    await TabStateFlusher.flush(browser);
-    let {history} = TabStateCache.get(browser);
-    is(history.entries.length, length, "Lengths match");
-    for (let i = 0; i < length; ++i) {
-      is(history.entries[i].url, URIs[i], "URI at index " + i + " matches");
-    }
-    is(history.index, index, "Index matches");
-    await ContentTask.spawn(browser, [index, length], async function([expectedIndex, expectedLength]) {
-      let webNav = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
-            .getInterface(Ci.nsIWebNavigation);
-      is(webNav.sessionHistory.globalIndexOffset + webNav.sessionHistory.index,
-         expectedIndex - 1, "In content index matches");
-      is(webNav.canGoForward, expectedIndex < expectedLength, "canGoForward is correct");
-      is(webNav.canGoBack, expectedIndex > 1, "canGoBack is correct");
-    });
-  }
-
-  // Wait for a process change, followed by a locationchange event, and then
-  // fulfil the promise.
-  function awaitProcessChange(browser) {
-    return new Promise(resolve => {
-      let locChangeListener = {
-        onLocationChange: () => {
-          gBrowser.removeProgressListener(locChangeListener);
-          resolve();
-        },
-      };
-
-      browser.addEventListener("BrowserChangedProcess", function(e) {
-        gBrowser.addProgressListener(locChangeListener);
-      }, {once: true});
-    });
-  }
-
-  // Order of events:
-  // Load [0], load [1], prerender [2], load [2], load [3]
-  // Back [2], Back [1], Forward [2], Back [0], Forward [3]
-  // Prerender [4], Back [0], Forward [2], Load [3'], Back [0].
-  await BrowserTestUtils.withNewTab({ gBrowser, url: URIs[0] }, async function(browser1) {
-    await validate(browser1, 1, 1);
-
-    browser1.loadURI(URIs[1], null, null);
-    await BrowserTestUtils.browserLoaded(browser1);
-    await validate(browser1, 2, 2);
-
-    // Create a new hidden prerendered tab to swap to.
-    let tab2 = gBrowser.loadOneTab(URIs[2], {
-      referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
-      allowThirdPartyFixup: true,
-      relatedToCurrent: true,
-      isPrerendered: true,
-      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-    });
-    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
-    browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    await awaitProcessChange(browser1);
-    await validate(browser1, 3, 3);
-
-    browser1.loadURI(URIs[3], null, null);
-    await BrowserTestUtils.browserLoaded(browser1);
-    await validate(browser1, 4, 4);
-
-    // In process navigate back.
-    let p = BrowserTestUtils.waitForContentEvent(browser1, "pageshow");
-    browser1.goBack();
-    await p;
-    await validate(browser1, 4, 3);
-
-    // Cross process navigate back.
-    browser1.goBack();
-    await awaitProcessChange(browser1);
-    await validate(browser1, 4, 2);
-
-    // Cross process navigate forward.
-    browser1.goForward();
-    await awaitProcessChange(browser1);
-    await validate(browser1, 4, 3);
-
-    // Navigate across process to a page which was not recently loaded.
-    browser1.gotoIndex(0);
-    await awaitProcessChange(browser1);
-    await validate(browser1, 4, 1);
-
-    // Navigate across process to a page which was not recently loaded in the other direction.
-    browser1.gotoIndex(3);
-    await awaitProcessChange(browser1);
-    await validate(browser1, 4, 4);
-
-    // Create a new hidden prerendered tab to swap to
-    let tab3 = gBrowser.loadOneTab(URIs[4], {
-      referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
-      allowThirdPartyFixup: true,
-      relatedToCurrent: true,
-      isPrerendered: true,
-      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-    });
-    await BrowserTestUtils.browserLoaded(tab3.linkedBrowser);
-    browser1.frameLoader.appendPartialSHistoryAndSwap(tab3.linkedBrowser.frameLoader);
-    await awaitProcessChange(browser1);
-    await validate(browser1, 5, 5);
-
-    browser1.gotoIndex(0);
-    await awaitProcessChange(browser1);
-    await validate(browser1, 5, 1);
-
-    browser1.gotoIndex(2);
-    await awaitProcessChange(browser1);
-    await validate(browser1, 5, 3);
-
-    // Load a new page and make sure it throws out all of the following entries.
-    URIs[3] = "data:text/html,NEW";
-    browser1.loadURI(URIs[3]);
-    await BrowserTestUtils.browserLoaded(browser1);
-    await validate(browser1, 4, 4);
-
-    browser1.gotoIndex(0);
-    await awaitProcessChange(browser1);
-    await validate(browser1, 4, 1);
-
-    // XXX: This will be removed automatically by the owning tab closing in the
-    // future, but this is not supported yet.
-    gBrowser.removeTab(tab2);
-    gBrowser.removeTab(tab3);
-  });
-});
--- a/docshell/test/browser/browser.ini
+++ b/docshell/test/browser/browser.ini
@@ -101,16 +101,10 @@ skip-if = os == 'win' && !debug # bug 13
 [browser_tab_touch_events.js]
 [browser_timelineMarkers-01.js]
 [browser_timelineMarkers-02.js]
 skip-if = true # Bug 1220415
 [browser_timelineMarkers-03.js]
 [browser_timelineMarkers-04.js]
 [browser_timelineMarkers-05.js]
 [browser_ua_emulation.js]
-[browser_grouped_shistory_dead_navigate.js]
-skip-if = !e10s
-[browser_grouped_shistory_crossproc.js]
-skip-if = !e10s
-[browser_grouped_shistory_bfcache_cleaning.js]
-skip-if = !e10s
 [browser_history_triggeringprincipal_viewsource.js]
 [browser_click_link_within_view_source.js]
deleted file mode 100644
--- a/docshell/test/browser/browser_grouped_shistory_bfcache_cleaning.js
+++ /dev/null
@@ -1,59 +0,0 @@
-add_task(async function() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.groupedhistory.enabled", true]]
-  });
-
-  // Wait for a process change and then fulfil the promise.
-  function awaitProcessChange(browser) {
-    return new Promise(resolve => {
-      browser.addEventListener("BrowserChangedProcess", function(e) {
-        ok(true, "The browser changed process!");
-        resolve();
-      }, {once: true});
-    });
-  }
-
-  function isAlive(tab) {
-    return tab.linkedBrowser &&
-      tab.linkedBrowser.frameLoader &&
-      !tab.linkedBrowser.frameLoader.isDead;
-  }
-
-  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
-    // Set up the grouped SHEntry setup
-    let tab2 = gBrowser.loadOneTab("data:text/html,b", {
-      referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
-      allowThirdPartyFixup: true,
-      relatedToCurrent: true,
-      isPrerendered: true,
-      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-    });
-    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
-    browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    await awaitProcessChange(browser1);
-    ok(isAlive(tab2));
-
-    // Load some URIs and make sure that we lose the old process once we are 3 history entries away.
-    browser1.loadURI("data:text/html,c", null, null);
-    await BrowserTestUtils.browserLoaded(browser1);
-    ok(isAlive(tab2), "frameloader should still be alive");
-    browser1.loadURI("data:text/html,d", null, null);
-    await BrowserTestUtils.browserLoaded(browser1);
-    ok(isAlive(tab2), "frameloader should still be alive");
-    browser1.loadURI("data:text/html,e", null, null);
-    await BrowserTestUtils.browserLoaded(browser1);
-    ok(isAlive(tab2), "frameloader should still be alive");
-
-    // The 4th navigation should kill the frameloader
-    browser1.loadURI("data:text/html,f", null, null);
-    await new Promise(resolve => {
-      tab2.addEventListener("TabClose", function() {
-        ok(true, "The tab is being closed!\n");
-        resolve();
-      }, {once: true});
-    });
-    // We don't check for !isAlive() as TabClose is called during
-    // _beginRemoveTab, which means that the frameloader may not be dead yet. We
-    // avoid races by not checking.
-  });
-});
deleted file mode 100644
--- a/docshell/test/browser/browser_grouped_shistory_crossproc.js
+++ /dev/null
@@ -1,52 +0,0 @@
-add_task(async function() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.groupedhistory.enabled", true]]
-  });
-
-  // Wait for a process change and then fulfil the promise.
-  function awaitProcessChange(browser) {
-    return new Promise(resolve => {
-      browser.addEventListener("BrowserChangedProcess", function(e) {
-        ok(true, "The browser changed process!");
-        resolve();
-      }, {once: true});
-    });
-  }
-
-  // Wait for the given tab being closed.
-  function awaitTabClose(tab) {
-    return new Promise(resolve => {
-      tab.addEventListener("TabClose", function() {
-        ok(true, "The tab is being closed!\n");
-        resolve();
-      }, {once: true});
-    });
-  }
-
-  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
-    // Set up the grouped SHEntry setup
-    let tab2 = gBrowser.loadOneTab("data:text/html,b", {
-      referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
-      allowThirdPartyFixup: true,
-      relatedToCurrent: true,
-      isPrerendered: true,
-      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-    });
-    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
-    browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    await awaitProcessChange(browser1);
-
-    // Load a URI which will involve loading in the parent process
-    let tabClose = awaitTabClose(tab2);
-    browser1.loadURI("about:config", Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
-    await BrowserTestUtils.browserLoaded(browser1);
-    let docshell = browser1.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
-    ok(docshell, "The browser should be loaded in the chrome process");
-    is(docshell.canGoForward, false, "canGoForward is correct");
-    is(docshell.canGoBack, true, "canGoBack is correct");
-    is(docshell.sessionHistory.count, 3, "Count is correct");
-    is(browser1.frameLoader.groupedSHistory, null,
-       "browser1's session history is now complete");
-    await tabClose;
-  });
-});
deleted file mode 100644
--- a/docshell/test/browser/browser_grouped_shistory_dead_navigate.js
+++ /dev/null
@@ -1,45 +0,0 @@
-add_task(async function() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.groupedhistory.enabled", true],
-          ["dom.ipc.processCount", 1]]
-  });
-
-  // Wait for a process change and then fulfil the promise.
-  function awaitProcessChange(browser) {
-    return new Promise(resolve => {
-      browser.addEventListener("BrowserChangedProcess", function(e) {
-        ok(true, "The browser changed process!");
-        resolve();
-      }, {once: true});
-    });
-  }
-
-  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
-    // Set up the grouped SHEntry setup
-    let tab2 = gBrowser.loadOneTab("data:text/html,b", {
-      referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
-      allowThirdPartyFixup: true,
-      relatedToCurrent: true,
-      isPrerendered: true,
-      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-    });
-    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
-    browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    await awaitProcessChange(browser1);
-
-    // Close tab2 such that the back frameloader is dead
-    await BrowserTestUtils.removeTab(tab2);
-    await BrowserTestUtils.waitForCondition(() => browser1.canGoBack);
-    browser1.goBack();
-    await BrowserTestUtils.browserLoaded(browser1);
-    await ContentTask.spawn(browser1, null, function() {
-      is(content.window.location + "", "data:text/html,a");
-      let webNav = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
-            .getInterface(Ci.nsIWebNavigation);
-      is(webNav.canGoForward, true, "canGoForward is correct");
-      is(webNav.canGoBack, false, "canGoBack is correct");
-    });
-    is(browser1.frameLoader.groupedSHistory, null,
-       "browser1's session history is now complete");
-  });
-});
--- a/dom/base/test/chrome/chrome.ini
+++ b/dom/base/test/chrome/chrome.ini
@@ -19,17 +19,16 @@ support-files =
   fileconstructor_file.png
   frame_bug814638.xul
   frame_custom_element_content.html
   custom_element_ep.js
   host_bug814638.xul
   window_nsITextInputProcessor.xul
   title_window.xul
   window_swapFrameLoaders.xul
-  window_groupedSHistory.xul
 
 [test_bug120684.xul]
 [test_bug206691.xul]
 [test_bug289714.xul]
 [test_bug339494.xul]
 [test_bug357450.xul]
 support-files = ../file_bug357450.js
 [test_bug380418.html]
@@ -71,10 +70,9 @@ support-files = ../file_bug357450.js
 [test_nsITextInputProcessor.xul]
 [test_permission_isHandlingUserInput.xul]
 support-files = ../dummy.html
 [test_range_getClientRectsAndTexts.html]
 [test_title.xul]
 support-files = file_title.xul
 [test_windowroot.xul]
 [test_swapFrameLoaders.xul]
-[test_groupedSHistory.xul]
 [test_bug1339722.html]
deleted file mode 100644
--- a/dom/base/test/chrome/test_groupedSHistory.xul
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1276553
--->
-<window title="Mozilla Bug 1276553"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="loadTest();">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1276553"
-     target="_blank">Mozilla Bug 1276553</a>
-  </body>
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  /** Test for GroupedSHistory **/
-  SimpleTest.waitForExplicitFinish();
-  function loadTest() {
-    window.open("window_groupedSHistory.xul", "", "width=360,height=240,chrome");
-  }
-
-  ]]>
-  </script>
-</window>
deleted file mode 100644
--- a/dom/base/test/chrome/window_groupedSHistory.xul
+++ /dev/null
@@ -1,637 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<!--
-The test case creates 3 <xul:browser>s, load entries into them, modify the
-documents, and then check if grouped history merge / back / forward all work
-with bfcache preserved.
-
-Related bugs:
-https://bugzilla.mozilla.org/show_bug.cgi?id=1276553
-https://bugzilla.mozilla.org/show_bug.cgi?id=1310768
--->
-<window title="Test GroupedSHistory"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="run();">
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
-  Cu.import("resource://testing-common/TestUtils.jsm");
-  Cu.import("resource://testing-common/ContentTask.jsm");
-  Cu.import("resource://testing-common/BrowserTestUtils.jsm");
-  ContentTask.setTestScope(window.opener.wrappedJSObject);
-
-  let imports = ['SimpleTest', 'SpecialPowers', 'ok', 'is', 'info'];
-  for (let name of imports) {
-    window[name] = window.opener.wrappedJSObject[name];
-  }
-
-  function run() {
-    SpecialPowers.pushPrefEnv(
-      {'set' : [[ 'browser.groupedhistory.enabled', true ]]})
-    // Since we're not going to use GroupedSHistory in non-10s or
-    // chrome-only URLs, we don't test for non-remote browsers anymore.
-    //
-    // As a note, there are 2 known issues in non-10s:
-    // 1. nsDocShell::InternalLoad could start before nsFrameLoader calls
-    // EvictAllContentViewers, and causes RestoreFromHistory fails.
-    // 2. If using sendAsyncMessage, messages may be queued in
-    // SameProcessMessageQueue, and cause "pagehide" being delivered to the
-    // message manager of background <xul:browser> after swap.
-    .then(() => test(true))
-    .then(() => {
-      window.close();
-      SimpleTest.finish();
-    });
-  }
-
-  function test(remote) {
-    let act, bg1, bg2;
-    return Promise.resolve()
-
-    // create background browser 1 with 1 entry
-    .then(() => info('TEST-INFO | test create browser #1, remote=' + remote))
-    .then(() => createBrowser('pineapple', remote))
-    .then(b => bg1 = b)
-    .then(() => verifyBrowser(bg1, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    false      /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    false      /* partial */ ))
-    .then(() => addBfcachedText(bg1))
-
-     // create background browser 2 with 2 entries
-    .then(() => info('TEST-INFO | test create browser #2, remote=' + remote))
-    .then(() => createBrowser('apple', remote))
-    .then(b => bg2 = b)
-    .then(() => verifyBrowser(bg2, 'apple'     /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    false      /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    false      /* partial */ ))
-    .then(() => addBfcachedText(bg2))
-    .then(() => loadURI(bg2, getDummyHtml('pencil')))
-    .then(() => verifyBrowser(bg2, 'pencil'    /* title */,
-                                    1          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    false      /* partial */ ))
-    .then(() => addBfcachedText(bg2))
-
-    // create active browser with 1 entry
-    .then(() => info('TEST-INFO | test create browser #3, remote=' + remote))
-    .then(() => createBrowser('pen', remote, true))
-    .then(b => act = b)
-    .then(() => verifyBrowser(act, 'pen'       /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    false      /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    false      /* partial */ ))
-    .then(() => addBfcachedText(act))
-
-    // merge to 2 entries pen-pineapple
-    // act: pineapple
-    // bg1: pen
-    .then(() => info('TEST-INFO | test merge history #1, remote=' + remote))
-    .then(() => mergeHistory(act, bg1, 'pineapple'))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    2          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // merge to 4 entries pen-pineapple-apple-pencil
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test merge history #2, remote=' + remote))
-    .then(() => mergeHistory(act, bg2, 'pencil'))
-    .then(() => verifyBrowser(act, 'pencil'    /* title */,
-                                    1          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test go back
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test history go back #1, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.goBack.bind(act), 'pencil', 'apple'))
-    .then(() => verifyBrowser(act, 'apple'     /* title */,
-                                    0          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test go back
-    // act: pineapple
-    // bg1: pen
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test history go back #2, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.goBack.bind(act), 'apple', 'pineapple', bg2))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test go back
-    // act: pen
-    // bg1: pineapple
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test history go back #3, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.goBack.bind(act), 'pineapple', 'pen', bg1))
-    .then(() => verifyBrowser(act, 'pen'       /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    false      /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    0          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test go forward
-    // act: pineapple
-    // bg1: pen
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test history go forward #1, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.goForward.bind(act), 'pen', 'pineapple', bg1))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test go forward
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test history go forward #2, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.goForward.bind(act), 'pineapple', 'apple', bg2))
-    .then(() => verifyBrowser(act, 'apple'     /* title */,
-                                    0          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test go forward
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test history go forward #3, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.goForward.bind(act), 'apple', 'pencil'))
-    .then(() => verifyBrowser(act, 'pencil'    /* title */,
-                                    1          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test goto index
-    // act: pen
-    // bg1: apple-pencil
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test history goto index #1, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.gotoIndex.bind(act, 0), 'pencil', 'pen', bg1))
-    .then(() => verifyBrowser(act, 'pen'       /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    false      /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    0          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test goto index
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test history goto index #2, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.gotoIndex.bind(act, 2), 'pen', 'apple', bg1))
-    .then(() => verifyBrowser(act, 'apple'     /* title */,
-                                    0          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test goto index
-    // act: pineapple
-    // bg1: pen
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test history goto index #3, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.gotoIndex.bind(act, 1), 'apple', 'pineapple', bg2))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test goto index
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test history goto index #4, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.gotoIndex.bind(act, 3), 'pineapple', 'pencil', bg2))
-    .then(() => verifyBrowser(act, 'pencil'    /* title */,
-                                    1          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test content go back
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test content history go back #1, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGoBack.bind(null, act), 'pencil', 'apple'))
-    .then(() => verifyBrowser(act, 'apple'     /* title */,
-                                    0          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test content go back
-    // act: pineapple
-    // bg1: pen
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test content history go back #2, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGoBack.bind(null, act), 'apple', 'pineapple', bg2))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test content go back
-    // act: pen
-    // bg1: pineapple
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test content history go back #3, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGoBack.bind(null, act), 'pineapple', 'pen', bg1))
-    .then(() => verifyBrowser(act, 'pen'       /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    false      /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    0          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test content go forward
-    // act: pineapple
-    // bg1: pen
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test content history go forward #1, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGoForward.bind(null, act), 'pen', 'pineapple', bg1))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test content go forward
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test content history go forward #2, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGoForward.bind(null, act), 'pineapple', 'apple', bg2))
-    .then(() => verifyBrowser(act, 'apple'     /* title */,
-                                    0          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test content go forward
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test content history go forward #3, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGoForward.bind(null, act), 'apple', 'pencil'))
-    .then(() => verifyBrowser(act, 'pencil'    /* title */,
-                                    1          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test content go
-    // act: pen
-    // bg1: apple-pencil
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test content history go #1, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGo.bind(null, act, -3), 'pencil', 'pen', bg1))
-    .then(() => verifyBrowser(act, 'pen'       /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    false      /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    0          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test content go
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test content history go #2, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGo.bind(null, act, 2), 'pen', 'apple', bg1))
-    .then(() => verifyBrowser(act, 'apple'     /* title */,
-                                    0          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test content go
-    // act: pineapple
-    // bg1: pen
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test content history go #3, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGo.bind(null, act, -1), 'apple', 'pineapple', bg2))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-    // test content go
-    // act: apple-pencil
-    // bg1: pen
-    // bg2: pineapple
-    .then(() => info('TEST-INFO | test content history go #4, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, contentGo.bind(null, act, 2), 'pineapple', 'pencil', bg2))
-    .then(() => verifyBrowser(act, 'pencil'    /* title */,
-                                    1          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    true       /* partial */,
-                                    2          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // test history change to 3 entries pen-pineapple-banana
-    // act: pineapple
-    // bg1: pen
-    // bg2: apple-pencil
-    .then(() => info('TEST-INFO | test history change, remote=' + remote))
-    .then(() => wrapHistoryNavFn(act, act.gotoIndex.bind(act, 1), 'pencil', 'pineapple', bg2))
-    .then(() => verifyBrowser(act, 'pineapple' /* title */,
-                                    0          /* index */,
-                                    1          /* length */,
-                                    true       /* canGoBack */,
-                                    true       /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    4          /* globalLength */,
-                                    true       /* bfcached */ ))
-
-    // act: pineapple-banana
-    // bg1: pen
-    // bg2: (removed from group)
-    .then(() => loadURI(act, getDummyHtml('banana')))
-    .then(() => verifyBrowser(act, 'banana'    /* title */,
-                                    1          /* index */,
-                                    2          /* length */,
-                                    true       /* canGoBack */,
-                                    false      /* canGoForward */,
-                                    true       /* partial */,
-                                    1          /* offset */,
-                                    3          /* globalLength */ ))
-  }
-
-  function getDummyHtml(title) {
-    return 'data:text/html;charset=UTF-8,' +
-     '<html><head><title>' + title + '</title><script>' +
-     'window.addEventListener("pageshow", e => document.dispatchEvent(' +
-     '  new CustomEvent("test:content-pageshow", {detail: document.title})));' +
-     'window.addEventListener("pagehide", e => document.dispatchEvent(' +
-     '  new CustomEvent("test:content-pagehide", {detail: document.title})));' +
-     'window.addEventListener("visibilitychange", e => document.dispatchEvent(' +
-     '  new CustomEvent("test:content-visibilitychange", {detail: ' +
-     '    {title: document.title, visibility: document.visibilityState}})));' +
-     '</script></head><body><h1>' + title + '</h1><p id="p1"></p></body></html>';
-  }
-
-  let gBrowserCount = 0;
-  function createBrowser(title, remote, active = false) {
-    let browser = document.createElement('browser');
-    browser.testId = ++gBrowserCount; // for debugging
-    browser.setAttribute('type', 'content');
-    browser.setAttribute('remote', remote);
-    browser.setAttribute('src', getDummyHtml(title));
-    browser.docShellIsActive = active;
-    document.getElementById('stack').appendChild(browser);
-    return BrowserTestUtils.browserLoaded(browser)
-           .then(() => {
-             // Register our own event listeners.
-             //
-             // We don't use BrowserTestUtils.waitForContentEvents, because when
-             // swapping frameloaders, the event listeners at content side are
-             // also swapped to another browser. The message listener registered
-             // by waitForContentEvents will never receive messages consequently.
-             browser.messageManager.loadFrameScript('data:,' +
-               'addEventListener("test:content-pageshow", e => {' +
-                 'if (e.target == content.document) {' +
-                   'sendAsyncMessage("test:content-pageshow", { title: e.detail });' +
-                 '}' +
-               '}, true, true);' +
-               'addEventListener("test:content-pagehide", e => {' +
-                 'if (e.target == content.document) {' +
-                   'sendAsyncMessage("test:content-pagehide", { title: e.detail });' +
-                 '}' +
-               '}, true, true);' +
-               'addEventListener("test:content-visibilitychange", e => {' +
-                 'sendAsyncMessage("test:content-visibilitychange", e.detail);' +
-               '}, true, true);',
-               true);
-
-             // Log for debugging purpose.
-             browser.messageManager.addMessageListener('test:content-pageshow',
-               msg => info('TEST-INFO | pageshow#' + browser.testId + ' ' + JSON.stringify(msg.data)));
-             browser.messageManager.addMessageListener('test:content-pagehide',
-               msg => info('TEST-INFO | pagehide#' + browser.testId + ' ' + JSON.stringify(msg.data)));
-             browser.messageManager.addMessageListener('test:content-visibilitychange',
-               msg => info('TEST-INFO | visibilitychange#' + browser.testId + ' ' + JSON.stringify(msg.data)));
-           })
-           .then(() => {
-             // A trick to ensure webProgress object is created for e10s case.
-             // Otherwise canGoBack / canGoForward won't be updated.
-             ok(browser.webProgress, 'check browser.webProgress exists');
-             return browser;
-           });
-  }
-
-  function addBfcachedText(browser) {
-    return ContentTask.spawn(browser, null, () => {
-      content.document.getElementById('p1').textContent = 'modified';
-    });
-  }
-
-  function loadURI(browser, uri) {
-    let promise = BrowserTestUtils.browserLoaded(browser, false);
-    browser.loadURI(uri);
-    return promise;
-  }
-
-  function mergeHistory(b1, b2, title) {
-    let promises = [];
-    let pagehide1, pagehide2;
-
-    promises.push(BrowserTestUtils.waitForMessage(b1.messageManager,
-      'test:content-visibilitychange', msg => msg.data &&
-        (msg.data.title == title) && (msg.data.visibility == 'visible')));
-
-    // For swapping remote browsers, we'll also receive Content:LocationChange
-    if (b1.isRemoteBrowser) {
-      // It's guaranteed location change can be delivered to b1's message
-      // manager, since frameloader is synchronously swapping on main thread
-      // after calling PartialSHistory::OnActive(). Therefore the message could
-      // only be handled after swapping.
-      promises.push(BrowserTestUtils.waitForMessage(b1.messageManager, 'Content:LocationChange'));
-    }
-
-    promises.push(Promise.resolve().then(() => {
-      let f1 = b1.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
-      let f2 = b2.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
-      return f1.appendPartialSHistoryAndSwap(f2);
-    }));
-
-    return Promise.all(promises);
-  }
-
-  function wrapHistoryNavFn(browser, navFn, prevTitle, nextTitle, browserToSwap) {
-    let promises = [];
-
-    // Expecting pagehide from previous page, and a pageshow from next page.
-    //
-    // "Pagehide" is sent before calling OnRequestCrossBrowserNavigation(),
-    // so it should be handled before swapping. "Pageshow" on the other hand
-    // should be handled after swapping cause frameloader is synchronously
-    // swapping on main thread after calling PartialSHistory::OnActive().
-    //
-    // Therefore both messages should be delivered to browser.messageManager.
-    promises.push(BrowserTestUtils.waitForMessage(browser.messageManager,
-      'test:content-pagehide', msg => msg.data && (msg.data.title == prevTitle)));
-    promises.push(BrowserTestUtils.waitForMessage(browser.messageManager,
-      'test:content-pageshow', msg => msg.data && (msg.data.title == nextTitle)));
-    promises.push(navFn() || Promise.resolve());
-
-    // For swapping remote browsers, we'll also receive Content:LocationChange
-    if (browserToSwap && browser.isRemoteBrowser) {
-      promises.push(BrowserTestUtils.waitForMessage(browser.messageManager,
-        'Content:LocationChange'));
-    }
-
-    return Promise.all(promises);
-  }
-
-  function contentGoBack(browser) {
-    ContentTask.spawn(browser, null, () => content.history.back());
-  }
-
-  function contentGoForward(browser) {
-    ContentTask.spawn(browser, null, () => content.history.forward());
-  }
-
-  function contentGo(browser, offset) {
-    ContentTask.spawn(browser, { offset },
-      ({ offset }) => content.history.go(offset));
-  }
-
-  function verifyBrowser(browser, title, index, length, canGoBack, canGoForward,
-                         partial, offset = 0, globalLength = length, bfcached = false) {
-    is(browser.canGoBack, canGoBack, 'check browser.canGoBack');
-    is(browser.canGoForward, canGoForward, 'check browser.canGoForward');
-    if (partial) {
-      let frameLoader = browser.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
-      is(frameLoader.groupedSHistory.count, globalLength, 'check groupedSHistory.count');
-    }
-
-    return ContentTask.spawn(browser,
-        { title, index, length, canGoBack, canGoForward, partial, offset, globalLength, bfcached },
-        ({ title, index, length, canGoBack, canGoForward, partial, offset, globalLength, bfcached }) => {
-      let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
-      let shistory = webNav.sessionHistory;
-      is(webNav.canGoBack, canGoBack, 'check webNav.canGoBack');
-      is(webNav.canGoForward, canGoForward, 'check webNav.canGoForward');
-      is(shistory.index, index, 'check shistory.index');
-      is(shistory.count, length, 'check shistory.count');
-      is(shistory.isPartial, partial, 'check shistory.isPartial');
-      is(shistory.globalIndexOffset, offset, 'check shistory.globalIndexOffset');
-      is(shistory.globalCount, globalLength, 'check shistory.globalCount');
-      is(content.document.title, title, 'check title');
-      is(content.document.getElementById('p1').textContent, bfcached ? 'modified' : '', 'check bfcached content');
-      is(content.history.length, globalLength, 'check history.legnth');
-    });
-  }
-
-  ]]>
-  </script>
-  <stack id="stack" flex="1" />
-</window>
--- a/dom/tests/browser/browser.ini
+++ b/dom/tests/browser/browser.ini
@@ -62,18 +62,13 @@ support-files =
 tags = openwindow
 skip-if = toolkit == 'android'  || (os == "linux" && debug) # see bug 1261495 for Linux debug time outs
 support-files =
   test_new_window_from_content_child.html
 [browser_test_toolbars_visibility.js]
 support-files =
   test_new_window_from_content_child.html
 [browser_xhr_sandbox.js]
-[browser_prerendering.js]
-support-files =
-  prerender.html
-  prerender_target.html
-skip-if = true || !e10s # Prerendering requires e10s, turned off for e10s-multi Bug 1315042
 [browser_noopener.js]
 support-files =
   test_noopener_source.html
   test_noopener_target.html
 [browser_noopener_null_uri.js]
deleted file mode 100644
--- a/dom/tests/browser/browser_prerendering.js
+++ /dev/null
@@ -1,177 +0,0 @@
-const URL = "https://example.com/browser/dom/tests/browser/prerender.html";
-const PRERENDERED_URL = "https://example.com/browser/dom/tests/browser/prerender_target.html";
-
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
-                                  "resource://gre/modules/PlacesUtils.jsm");
-
-// Returns a promise which resolves to whether or not PRERENDERED_URL has been visited.
-function prerenderedVisited() {
-  let uri = Services.io.newURI(PRERENDERED_URL);
-  return new Promise(resolve => {
-    PlacesUtils.asyncHistory.isURIVisited(uri, (aUri, aIsVisited) => {
-      resolve(aIsVisited);
-    });
-  });
-}
-
-// Wait for a process change and then fulfil the promise.
-function awaitProcessChange(browser) {
-  return new Promise(resolve => {
-    browser.addEventListener("BrowserChangedProcess", function(e) {
-      info("The browser changed process!");
-      resolve();
-    }, {once: true});
-  });
-}
-
-// Wait for onbeforeunload dialog, and dismiss it immediately.
-function awaitAndCloseBeforeUnloadDialog() {
-  return new Promise(resolve => {
-    function onDialogShown(node) {
-      info("Found onbeforeunload dialog");
-      Services.obs.removeObserver(onDialogShown,
-        "tabmodal-dialog-loaded");
-      let dismissButton = node.ui.button0;
-      dismissButton.click();
-      resolve();
-    }
-
-    Services.obs.addObserver(onDialogShown, "tabmodal-dialog-loaded");
-  });
-}
-
-add_task(async function() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.groupedhistory.enabled", true],
-          ["dom.linkPrerender.enabled", true],
-          ["dom.require_user_interaction_for_beforeunload", false]]
-  });
-});
-
-// Test 1: Creating a prerendered browser, and clicking on a link to that browser,
-// will cause changes.
-add_task(async function() {
-  await PlacesUtils.history.clear();
-
-  let tab = BrowserTestUtils.addTab(gBrowser, URL);
-
-  is(await prerenderedVisited(), false, "Should not have been visited");
-
-  await new Promise(resolve => {
-    tab.linkedBrowser.messageManager.addMessageListener("Prerender:Request", function f() {
-      tab.linkedBrowser.messageManager.removeMessageListener("Prerender:Request", f);
-      info("Successfully received the prerender request");
-      resolve();
-    });
-  });
-  await BrowserTestUtils.switchTab(gBrowser, tab);
-
-  is(await prerenderedVisited(), false, "Should not have been visited");
-
-  // Check that visibilityState is set correctly in the prerendered tab. We
-  // check all of the tabs because we have no easy way to tell which one is
-  // which.
-  let foundTab;
-  for (let i = 0; i < gBrowser.tabs.length; ++i) {
-    foundTab = await ContentTask.spawn(gBrowser.tabs[i].linkedBrowser, null,
-                                       () => content.document.visibilityState == "prerender");
-    if (foundTab) {
-      break;
-    }
-  }
-  ok(foundTab, "The prerender tab was found!");
-
-  let dialogShown = awaitAndCloseBeforeUnloadDialog();
-  ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    let anchor = content.document.querySelector("a");
-    anchor.click();
-  });
-  await dialogShown;
-
-  await awaitProcessChange(tab.linkedBrowser);
-
-  await ContentTask.spawn(tab.linkedBrowser, PRERENDERED_URL, async function(PRERENDERED_URL) {
-    is(content.document.location.toString(), PRERENDERED_URL);
-    isnot(content.document.visibilityState, "prerender",
-          "VisibilityState of formerly prerendered window must not be prerender");
-  });
-
-  is(await prerenderedVisited(), true, "Should have been visited");
-
-  let groupedSHistory = tab.linkedBrowser.frameLoader.groupedSHistory;
-  is(groupedSHistory.count, 2, "Check total length of grouped shistory.");
-  is(gBrowser.tabs.length, 3, "Check number of opened tabs.");
-
-  // We don't touch the about:blank tab opened when browser mochitest runs.
-  // The tabs under test are the other 2 tabs, so we're expecting 2 TabClose.
-  let closed = new Promise(resolve => {
-    let seen = 0;
-    gBrowser.tabContainer.addEventListener("TabClose", function f() {
-      if (++seen == 2) {
-        gBrowser.tabContainer.removeEventListener("TabClose", f);
-        resolve();
-      }
-    });
-  });
-
-  await BrowserTestUtils.removeTab(tab);
-  await closed;
-
-  is(await prerenderedVisited(), true, "Should have been visited");
-
-  is(gBrowser.tabs.length, 1);
-});
-
-// Test 2: Creating a prerendered browser, and navigating to a different url,
-// succeeds, and closes the prerendered browser.
-add_task(async function() {
-  await PlacesUtils.history.clear();
-
-  let tab = BrowserTestUtils.addTab(gBrowser, URL);
-
-  is(await prerenderedVisited(), false, "Should not have been visited");
-
-  await Promise.all([
-    BrowserTestUtils.browserLoaded(tab.linkedBrowser),
-    new Promise(resolve => {
-      tab.linkedBrowser.messageManager.addMessageListener("Prerender:Request", function f() {
-        tab.linkedBrowser.messageManager.removeMessageListener("Prerender:Request", f);
-        info("Successfully received the prerender request");
-        resolve();
-      });
-    }),
-    BrowserTestUtils.switchTab(gBrowser, tab),
-  ]);
-
-  let dialogShown = awaitAndCloseBeforeUnloadDialog();
-  ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    let anchor = content.document.querySelector("a");
-    anchor.setAttribute("href", "data:text/html,something_else");
-    anchor.click();
-  });
-  await dialogShown;
-
-  is(await prerenderedVisited(), false, "Should not have been visited");
-
-  await Promise.all([
-    BrowserTestUtils.browserLoaded(tab.linkedBrowser),
-    new Promise(resolve => {
-      let seen = false;
-      gBrowser.tabContainer.addEventListener("TabClose", function() {
-        if (!seen) {
-          seen = true;
-          info("The tab was closed");
-          resolve();
-        }
-      }, {once: true});
-    }),
-  ]);
-
-  await ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    is(content.document.location.toString(), "data:text/html,something_else");
-  });
-
-  is(await prerenderedVisited(), false, "Should not have been visited");
-
-  await BrowserTestUtils.removeTab(tab);
-});
deleted file mode 100644
--- a/dom/tests/browser/prerender.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<head><title>Prerender Test</title></head>
-<body onbeforeunload="return 'stay with me';">
-<link rel="prerender" href="https://example.com/browser/dom/tests/browser/prerender_target.html">
-<a href="https://example.com/browser/dom/tests/browser/prerender_target.html">clicky here</a>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tests/browser/prerender_target.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<!doctype html>
-<body>
-    <p>This is just a random HTML document which will be loaded as a target for prerendering.</p>
-</body>
deleted file mode 100644
--- a/dom/xul/test/1061864.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<body>
-<script>
-</script>
-<iframe id="childiframe" src="data:text/html,Test">
-</iframe>
-</body>
-</html>
--- a/dom/xul/test/chrome.ini
+++ b/dom/xul/test/chrome.ini
@@ -1,19 +1,16 @@
 [DEFAULT]
 support-files =
   398289-resource.xul
   bug497875-iframe.xul
   overlay1_bug335375.xul
   overlay2_bug335375.xul
   window_bug583948.xul
   window_bug757137.xul
-  1061864.html
-  file_bug1271240.xul
-  file_bug1069772.xul
 
 [test_bug199692.xul]
 [test_bug233643.xul]
 [test_bug311681.xul]
 [test_bug335375.xul]
 [test_bug391002.xul]
 [test_bug398289.html]
 [test_bug403868.xul]
@@ -22,17 +19,11 @@ support-files =
 [test_bug445177.xul]
 [test_bug449457.xul]
 [test_bug468176.xul]
 [test_bug497875.xul]
 [test_bug583948.xul]
 [test_bug640158_overlay_persist.xul]
 [test_bug757137.xul]
 [test_bug775972.xul]
-[test_bug1061864_1.xul]
-[test_bug1061864_2.xul]
 [test_bug1070049_throw_from_script.xul]
 [test_import_xul_to_content.xul]
-[test_bug1271240.xul]
-skip-if = os == "android"
-[test_bug1069772.xul]
-skip-if = os == "android"
 [test_bug1290965.xul]
deleted file mode 100644
--- a/dom/xul/test/file_bug1069772.xul
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1069772
--->
-<window title="Mozilla Bug 1069772"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="run();">
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
-  Cu.import("resource://testing-common/ContentTask.jsm");
-  Cu.import("resource://testing-common/BrowserTestUtils.jsm");
-  Cu.import("resource://gre/modules/Services.jsm");
-  ContentTask.setTestScope(window.opener.wrappedJSObject);
-
-  let imports = ['SimpleTest', 'ok', 'is'];
-  for (let name of imports) {
-    window[name] = window.opener.wrappedJSObject[name];
-  }
-
-  /** Test for Bug 1069772 **/
-  function run() {
-    // test the transition:
-    // prerender => visible => hidden => visible
-    // on a non-remote browser
-    createPrerenderedBrowser(false)
-    .then(browser => verifyBrowser(browser, true, false))
-    .then(browser => verifyVisibility(browser, 'prerender'))
-    .then(browser => makePrerenderedBrowserActive(browser))
-    .then(browser => verifyBrowser(browser, false, false))
-    .then(browser => verifyVisibility(browser, 'visible'))
-    .then(browser => hideBrowser(browser))
-    .then(browser => verifyBrowser(browser, false, false))
-    .then(browser => verifyVisibility(browser, 'hidden'))
-    .then(browser => showBrowser(browser))
-    .then(browser => verifyBrowser(browser, false, false))
-    .then(browser => verifyVisibility(browser, 'visible'))
-
-    // test the transition:
-    // prerender => visible => hidden => visible
-    // on a remote browser
-    .then(() => createPrerenderedBrowser(true))
-    .then(browser => verifyBrowser(browser, true, true))
-    .then(browser => verifyVisibility(browser, 'prerender'))
-    .then(browser => makePrerenderedBrowserActive(browser))
-    .then(browser => verifyBrowser(browser, false, true))
-    .then(browser => verifyVisibility(browser, 'visible'))
-    .then(browser => hideBrowser(browser))
-    .then(browser => verifyBrowser(browser, false, true))
-    .then(browser => verifyVisibility(browser, 'hidden'))
-    .then(browser => showBrowser(browser))
-    .then(browser => verifyBrowser(browser, false, true))
-    .then(browser => verifyVisibility(browser, 'visible'))
-
-    // finish test
-    .then(() => {
-      window.close();
-      SimpleTest.finish();
-    });
-  }
-
-  function createPrerenderedBrowser(remote) {
-    let browser = document.createElement('browser');
-    browser.setAttribute('type', 'content');
-    browser.setAttribute('prerendered', true);
-    browser.setAttribute('remote', remote);
-    browser.setAttribute('src', 'data:text/html;charset=UTF-8,<html><body>' +
-     '<iframe id="iframe" src="data:text/html;charset=UTF-8,Hello Frame!">' +
-     '</iframe></body></html>');
-
-    // wait for 'load' and 'pageshow'
-    let promises = [];
-    promises.push(BrowserTestUtils.browserLoaded(browser));
-    promises.push(new Promise(resolve =>
-      Services.mm.addMessageListener('test:pageshow', resolve)));
-    Services.mm.loadFrameScript('data:,' +
-      'addEventListener("pageshow", ' +
-      '() => sendAsyncMessage("test:pageshow", null), false);',
-      true);
-
-    document.getElementById('stack').appendChild(browser);
-    return Promise.all(promises).then(() => browser);
-  }
-
-  function verifyBrowser(browser, prerendered, remote) {
-    let docShellOrTabParent = remote ?
-      browser.frameLoader.tabParent : browser.frameLoader.docShell;
-    ok(docShellOrTabParent, 'docShellOrTabParent should not be null');
-    is(docShellOrTabParent.isPrerendered, prerendered,
-      'isPrerendered should be ' + prerendered);
-    return browser;
-  }
-
-  function verifyVisibility(browser, visibility) {
-    return ContentTask.spawn(browser, visibility, (v) => {
-      let iframe = content.document.getElementById('iframe');
-      is(content.document.visibilityState, v, 'check doc.visibilityState');
-      is(content.document.hidden, v != 'visible', 'check doc.hidden');
-      is(iframe.contentDocument.visibilityState, v, 'check iframe doc.visibilityState');
-      is(iframe.contentDocument.hidden, v != 'visible', 'check iframe doc.hidden');
-    }).then(() => browser);
-  }
-
-  function makePrerenderedBrowserActive(browser) {
-    let promise = waitForVisibilityChange(browser);
-    browser.removeAttribute('prerendered');
-    browser.frameLoader.makePrerenderedLoaderActive();
-    return promise.then(() => browser);
-  }
-
-  function hideBrowser(browser) {
-    let promise = waitForVisibilityChange(browser);
-    browser.docShellIsActive = false;
-    return promise.then(() => browser);
-  }
-
-  function showBrowser(browser) {
-    let promise = waitForVisibilityChange(browser);
-    browser.docShellIsActive = true;
-    return promise.then(() => browser);
-  }
-
-  function waitForVisibilityChange(browser) {
-    return ContentTask.spawn(browser, null, () => {
-      return new Promise(resolve => {
-        let iframe = content.document.getElementById('iframe');
-        iframe.contentDocument.addEventListener('visibilitychange', function listener() {
-          iframe.contentDocument.removeEventListener('visibilitychange', listener);
-          resolve();
-        });
-      });
-    });
-  }
-
-  ]]>
-  </script>
-  <stack id="stack" flex="1" />
-</window>
deleted file mode 100644
--- a/dom/xul/test/file_bug1271240.xul
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1271240
--->
-<window title="Mozilla Bug 1271240"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="run();">
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  function ok(cond, msg) {
-    opener.wrappedJSObject.ok(cond, msg);
-  }
-
-  function is(actual, expected, msg) {
-    opener.wrappedJSObject.is(actual, expected, msg);
-  }
-
-  /** Test for Bug 1271240 **/
-  function run() {
-    // test non-remote, non-prerendered browser
-    createBrowser(false, false)
-    .then(browser => verifyBrowser(browser, false, false))
-
-    // test non-remote, prerendered browser
-    .then(() => createBrowser(true, false))
-    .then(browser => verifyBrowser(browser, true, false))
-    .then(browser => makePrerenderedBrowserActive(browser))
-    .then(browser => verifyBrowser(browser, false, false))
-
-    // test remote, non-prerendered browser
-    .then(() => createBrowser(false, true))
-    .then(browser => verifyBrowser(browser, false, true))
-
-    // test remote, prerendered browser
-    .then(() => createBrowser(true, true))
-    .then(browser => verifyBrowser(browser, true, true))
-    .then(browser => makePrerenderedBrowserActive(browser))
-    .then(browser => verifyBrowser(browser, false, true))
-
-    // finish test
-    .then(() => {
-      opener.postMessage('finish', '*');
-      window.close();
-    });
-  }
-
-  function createBrowser(prerendered, remote) {
-    return new Promise(resolve => {
-      var browser = document.createElement('browser');
-      browser.setAttribute('type', 'content');
-      browser.setAttribute('prerendered', prerendered);
-      browser.setAttribute('remote', remote);
-      document.documentElement.appendChild(browser);
-      browser.loadURI('example.com');
-      resolve(browser);
-    });
-  }
-
-  function verifyBrowser(browser, prerendered, remote) {
-    var docShellOrTabParent = remote ?
-      browser.frameLoader.tabParent : browser.frameLoader.docShell;
-    ok(docShellOrTabParent, 'docShellOrTabParent should not be null');
-    is(docShellOrTabParent.isPrerendered, prerendered,
-      'isPrerendered should be ' + prerendered);
-    return browser;
-  }
-
-  function makePrerenderedBrowserActive(browser) {
-    browser.frameLoader.makePrerenderedLoaderActive();
-    return browser;
-  }
-
-  ]]>
-  </script>
-  <!-- <browser type="content" flex="1" id="content" />
-  <browser type="content" flex="1" id="content-remote" remote="true" /> -->
-</window>
deleted file mode 100644
--- a/dom/xul/test/test_bug1061864_1.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1061864
--->
-<window title="Mozilla Bug 1061864"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="RunTest();">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  /** Test for Bug 1061864 **/
-  SimpleTest.waitForExplicitFinish();
-
-  function RunTest()
-  {
-    // Test that the docshell belonging to a prerendered frame loader will
-    // be created with the correct prerendered flag.
-    test(false, function() {
-      test(true, function() {
-        SimpleTest.finish();
-      });
-    });
-  }
-
-  function test(prerendered, callback) {
-    var parentIframe = document.createElement("iframe");
-    if (prerendered) {
-      parentIframe.setIsPrerendered();
-    }
-    parentIframe.onload = function() {
-      var docShell = parentIframe.frameLoader.docShell;
-      is(docShell.isPrerendered, prerendered, "The docshell is" + (prerendered ? "" : " not") + " prerendered");
-      callback();
-    }
-    document.documentElement.appendChild(parentIframe);
-  }
-  ]]>
-  </script>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061864"
-     target="_blank">Mozilla Bug 1061864</a>
-  </body>
-</window>
deleted file mode 100644
--- a/dom/xul/test/test_bug1061864_2.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1061864
--->
-<window title="Mozilla Bug 1061864"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="RunTest();">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  /** Test for Bug 1061864 **/
-  SimpleTest.waitForExplicitFinish();
-
-  function RunTest()
-  {
-    // Test that the docshell prerendered flag will be correctly inherited in
-    // prerendered documents.
-    test(false, function() {
-      test(true, function() {
-        SimpleTest.finish();
-      });
-    });
-  }
-
-  function test(prerendered, callback) {
-    var parentIframe = document.createElement("iframe");
-    if (prerendered) {
-      parentIframe.setIsPrerendered();
-    }
-    parentIframe.setAttribute("src", "1061864.html");
-    parentIframe.onload = function() {
-      var childIframe = parentIframe.contentDocument.getElementById("childiframe");
-      var childDocShell = childIframe.frameLoader.docShell;
-      is(childDocShell.isPrerendered, prerendered, "The docshell is" + (prerendered ? "" : " not") + " prerendered");
-      callback();
-    }
-    document.documentElement.appendChild(parentIframe);
-  }
-  ]]>
-  </script>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061864"
-     target="_blank">Mozilla Bug 1061864</a>
-  </body>
-</window>
deleted file mode 100644
--- a/dom/xul/test/test_bug1069772.xul
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1069772
--->
-<window title="Mozilla Bug 1069772"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="loadTest();">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069772"
-     target="_blank">Mozilla Bug 1069772</a>
-  </body>
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  /** Test for Bug 1069772 **/
-  SimpleTest.waitForExplicitFinish();
-  function loadTest() {
-    window.open("file_bug1069772.xul", "", "width=360,height=240,chrome");
-  }
-
-  ]]>
-  </script>
-</window>
deleted file mode 100644
--- a/dom/xul/test/test_bug1271240.xul
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1271240
--->
-<window title="Mozilla Bug 1271240"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="loadTest();">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1271240"
-     target="_blank">Mozilla Bug 1271240</a>
-  </body>
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-
-  /** Test for Bug 1271240 **/
-  SimpleTest.waitForExplicitFinish();
-  window.addEventListener('message', (event) => {
-    if (event.data == 'finish') {
-      SimpleTest.finish();
-    }
-  });
-
-  function loadTest() {
-    window.open("file_bug1271240.xul", "", "chrome");
-  }
-
-  ]]>
-  </script>
-</window>
--- a/toolkit/components/extensions/ext-browser-content.js
+++ b/toolkit/components/extensions/ext-browser-content.js
@@ -322,22 +322,15 @@ var WebBrowserChrome = {
 
   shouldLoadURIInThisProcess(URI) {
     return E10SUtils.shouldLoadURIInThisProcess(URI);
   },
 
   reloadInFreshProcess(docShell, URI, referrer, triggeringPrincipal, loadFlags) {
     return false;
   },
-
-  startPrerenderingDocument(href, referrer, triggeringPrincipal) {
-  },
-
-  shouldSwitchToPrerenderedDocument(href, referrer, success, failure) {
-    return false;
-  },
 };
 
 if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
   let tabchild = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsITabChild);
   tabchild.webBrowserChrome = WebBrowserChrome;
 }
--- a/toolkit/modules/sessionstore/SessionHistory.jsm
+++ b/toolkit/modules/sessionstore/SessionHistory.jsm
@@ -118,27 +118,17 @@ var SessionHistoryInternal = {
         data.entries.push({
           url: uri,
           triggeringPrincipal_base64: Utils.SERIALIZED_SYSTEMPRINCIPAL
         });
         data.index = 1;
       }
     }
 
-    // Transform the entries from local to global index space.
-    data.index += ihistory.globalIndexOffset;
-    data.fromIdx = aFromIdx + ihistory.globalIndexOffset;
-
-    // If we are not the most recent partialSHistory in our groupedSHistory, we
-    // need to make certain that we don't replace the entries from the following
-    // SHistories - so we replace only the number of entries which our SHistory
-    // takes up.
-    if (ihistory.globalIndexOffset + ihistory.count < ihistory.globalCount) {
-      data.toIdx = data.fromIdx + ihistory.count;
-    }
+    data.fromIdx = aFromIdx;
 
     return data;
   },
 
   /**
    * Get an object that is a serialized representation of a History entry.
    *
    * @param shEntry