Bug 1423220 - Enable tab warming by default for Nightly builds. r=dao draft
authorMike Conley <mconley@mozilla.com>
Wed, 31 Jan 2018 12:10:03 -0500
changeset 768638 4c0c70730219aacb00a52495ee3953323d2a0bf3
parent 768637 4d5e960e879cf87a52f1b78617390c2296e77350
push id102939
push usermconley@mozilla.com
push dateFri, 16 Mar 2018 16:34:00 +0000
reviewersdao
bugs1423220
milestone61.0a1
Bug 1423220 - Enable tab warming by default for Nightly builds. r=dao MozReview-Commit-ID: 8bz1U1WSzy5
browser/app/profile/firefox.js
dom/base/test/browser_bug1303838.js
--- 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]]});