Bug 1423220 - Enable tab warming by default for Nightly builds. r=dao
MozReview-Commit-ID: 8bz1U1WSzy5
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1536,18 +1536,22 @@ pref("privacy.userContext.longPressBehav
pref("privacy.userContext.extension", "");
// Start the browser in e10s mode
pref("browser.tabs.remote.autostart", true);
pref("browser.tabs.remote.desktopbehavior", true);
// For speculatively warming up tabs to improve perceived
// performance while using the async tab switcher.
-// Disabled until bug 1397426 is fixed.
+#if defined(NIGHTLY_BUILD)
+pref("browser.tabs.remote.warmup.enabled", true);
+#else
pref("browser.tabs.remote.warmup.enabled", false);
+#endif
+
pref("browser.tabs.remote.warmup.maxTabs", 3);
pref("browser.tabs.remote.warmup.unloadDelayMs", 2000);
// For the about:tabcrashed page
pref("browser.tabs.crashReporting.sendReport", true);
pref("browser.tabs.crashReporting.includeURL", false);
pref("browser.tabs.crashReporting.requestEmail", false);
pref("browser.tabs.crashReporting.emailMe", false);
--- a/dom/base/test/browser_bug1303838.js
+++ b/dom/base/test/browser_bug1303838.js
@@ -11,16 +11,28 @@
* link click if loadDivertedInBackground is set to true.
*/
"use strict";
const BASE_URL = "http://mochi.test:8888/browser/dom/base/test/";
add_task(async function() {
+ // On Linux, in our test automation, the mouse cursor floats over
+ // the first tab, which causes it to be warmed up when tab warming
+ // is enabled. The TabSwitchDone event doesn't fire until the warmed
+ // tab is evicted, which is after a few seconds. That means that
+ // this test ends up taking longer than we'd like, since its waiting
+ // for the TabSwitchDone event between tab switches.
+ //
+ // So now we make sure that warmed tabs are evicted very shortly
+ // after warming to avoid the test running too long.
+ await SpecialPowers.pushPrefEnv({
+ set: [["browser.tabs.remote.warmup.unloadDelayMs", 50]],
+ });
await testLinkClick(false, false);
await testLinkClick(false, true);
await testLinkClick(true, false);
await testLinkClick(true, true);
});
async function testLinkClick(withFrame, loadDivertedInBackground) {
await SpecialPowers.pushPrefEnv({"set": [["browser.tabs.loadDivertedInBackground", loadDivertedInBackground]]});