From d8329d02ddf535b5ca8353360dd892f656627053 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Wed, 31 Jan 2018 12:10:03 -0500 Subject: [PATCH] Bug 1423220 - Enable tab warming by default for Nightly builds. r=dao MozReview-Commit-ID: 8bz1U1WSzy5 --HG-- extra : rebase_source : e5068c4a0a9ac9c302c139e7cbca11fa47527ddb --- browser/app/profile/firefox.js | 6 +++++- dom/base/test/browser_bug1303838.js | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 7e4816503435..4adfff98f013 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1541,8 +1541,12 @@ 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); diff --git a/dom/base/test/browser_bug1303838.js b/dom/base/test/browser_bug1303838.js index 9489d227a770..3d3864cc6b89 100644 --- a/dom/base/test/browser_bug1303838.js +++ b/dom/base/test/browser_bug1303838.js @@ -16,6 +16,18 @@ 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);