Bug 1433324 - Part 1. Assume true for browser.newtabpage.activity-stream.aboutHome.enabled. r=ursula
authorEd Lee <edilee@mozilla.com>
Tue, 13 Feb 2018 14:48:49 -0800
changeset 403997 ad6392e366d4f97206dd8e1c97f7c094d8f972d9
parent 403955 dc9ba6649af7290170dc76be598ea669a169c6a2
child 403998 f3069763fab63f7c39d1cff9c54b1f32caf2ef5f
push id33450
push usernbeleuzu@mozilla.com
push dateFri, 16 Feb 2018 09:48:23 +0000
treeherdermozilla-central@6ba349d419dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersursula
bugs1433324
milestone60.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 1433324 - Part 1. Assume true for browser.newtabpage.activity-stream.aboutHome.enabled. r=ursula MozReview-Commit-ID: KOSX1qNBna8
browser/app/profile/firefox.js
browser/base/content/test/about/browser.ini
browser/base/content/test/about/browser_aboutHome_input.js
browser/base/content/test/about/browser_aboutHome_snippets.js
browser/base/content/test/about/browser_aboutHome_wrapsCorrectly.js
browser/components/about/AboutRedirector.cpp
browser/components/about/AboutRedirector.h
browser/components/privatebrowsing/test/browser/browser.ini
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js
browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1284,17 +1284,16 @@ pref("browser.newtabpage.rows", 3);
 pref("browser.newtabpage.columns", 5);
 
 // directory tiles download URL
 pref("browser.newtabpage.directory.source", "https://tiles.services.mozilla.com/v3/links/fetch/%LOCALE%/%CHANNEL%");
 
 // activates Activity Stream
 pref("browser.newtabpage.activity-stream.enabled", true);
 pref("browser.newtabpage.activity-stream.prerender", true);
-pref("browser.newtabpage.activity-stream.aboutHome.enabled", true);
 #ifndef RELEASE_OR_BETA
 pref("browser.newtabpage.activity-stream.debug", false);
 #endif
 
 pref("browser.library.activity-stream.enabled", true);
 
 // Enable the DOM fullscreen API.
 pref("full-screen-api.enabled", true);
--- a/browser/base/content/test/about/browser.ini
+++ b/browser/base/content/test/about/browser.ini
@@ -6,23 +6,24 @@ support-files =
   searchSuggestionEngine.sjs
   searchSuggestionEngine.xml
   test_bug959531.html
   POSTSearchEngine.xml
 
 [browser_aboutCertError.js]
 [browser_aboutHome_imitate.js]
 [browser_aboutHome_input.js]
-skip-if = os == "win" && debug && !e10s # Bug 1399648
+skip-if = true # Bug 1409054 to remove; previously skipped for intermittents, e.g., Bug 1399648
 [browser_aboutHome_search_POST.js]
 [browser_aboutHome_search_composing.js]
 skip-if = !debug && (os == "mac" || (os == "linux" && bits == 32)) # Bug 1400491, bug 1399648
 [browser_aboutHome_search_searchbar.js]
 [browser_aboutHome_search_suggestion.js]
 skip-if = os == "mac" || (os == "linux" && (!debug || bits == 64)) # Bug 1399648, bug 1402502
 [browser_aboutHome_search_telemetry.js]
 [browser_aboutHome_snippets.js]
+skip-if = true # Bug 1409054 to remove
 [browser_aboutHome_wrapsCorrectly.js]
-skip-if = os == "linux" && !debug # Bug 1395602
+skip-if = true # Bug 1409054 to remove; previously skipped for intermittents, e.g., Bug 1395602
 [browser_aboutNetError.js]
 [browser_aboutStopReload.js]
 [browser_aboutSupport.js]
 [browser_aboutSupport_newtab_security_state.js]
--- a/browser/base/content/test/about/browser_aboutHome_input.js
+++ b/browser/base/content/test/about/browser_aboutHome_input.js
@@ -2,24 +2,16 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 ChromeUtils.defineModuleGetter(this, "AppConstants",
   "resource://gre/modules/AppConstants.jsm");
 
 ignoreAllUncaughtExceptions();
 
-add_task(async function setup() {
-  // The following prefs would affect tests so make sure to disable them
-  // before any tests start.
-  await SpecialPowers.pushPrefEnv({set: [
-    ["browser.newtabpage.activity-stream.aboutHome.enabled", false],
-  ]});
-});
-
 // The following two tests need to be skipped for the time being, since we're
 // no longer showing the launcher options on about:home. When we remove about:home
 // and all of it's code, we can delete these tests
 add_task(async function() {
   info("Pressing Space while the Addons button is focused should activate it");
 
   // Skip this test on Mac, because Space doesn't activate the button there.
   if (AppConstants.platform == "macosx") {
--- a/browser/base/content/test/about/browser_aboutHome_snippets.js
+++ b/browser/base/content/test/about/browser_aboutHome_snippets.js
@@ -7,17 +7,16 @@ ChromeUtils.defineModuleGetter(this, "Ab
 
 ignoreAllUncaughtExceptions();
 var gRightsVersion = Services.prefs.getIntPref("browser.rights.version");
 
 add_task(async function setup() {
   // The following prefs would affect tests so make sure to disable them
   // before any tests start.
   await SpecialPowers.pushPrefEnv({set: [
-    ["browser.newtabpage.activity-stream.aboutHome.enabled", false],
     ["browser.onboarding.enabled", false],
     ["network.cookie.cookieBehavior", 0],
     ["network.cookie.lifetimePolicy", 0],
     ["browser.rights.override", true],
     [`browser.rights.${gRightsVersion}.shown`, false]
   ]});
 });
 
--- a/browser/base/content/test/about/browser_aboutHome_wrapsCorrectly.js
+++ b/browser/base/content/test/about/browser_aboutHome_wrapsCorrectly.js
@@ -1,18 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 add_task(async function() {
-  // When about:home is set to Activity Stream, there are no 'narrow' attributes
-  // therefore for this test, we want to ensure we're using the original about:home
-  await SpecialPowers.pushPrefEnv({set: [
-    ["browser.newtabpage.activity-stream.aboutHome.enabled", false]
-  ]});
   let newWindow = await BrowserTestUtils.openNewBrowserWindow();
 
   let resizedPromise = BrowserTestUtils.waitForEvent(newWindow, "resize");
   newWindow.resizeTo(300, 300);
   await resizedPromise;
 
   await BrowserTestUtils.openNewForegroundTab(newWindow.gBrowser, "about:home");
 
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -17,17 +17,16 @@
 #include "nsServiceManagerUtils.h"
 
 namespace mozilla {
 namespace browser {
 
 NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)
 
 bool AboutRedirector::sActivityStreamEnabled = false;
-bool AboutRedirector::sActivityStreamAboutHomeEnabled = false;
 
 struct RedirEntry {
   const char* id;
   const char* url;
   uint32_t flags;
 };
 
 /*
@@ -118,18 +117,16 @@ GetAboutModuleName(nsIURI *aURI)
 
 void
 AboutRedirector::LoadActivityStreamPrefs()
 {
   static bool sASEnabledCacheInited = false;
   if (!sASEnabledCacheInited) {
     Preferences::AddBoolVarCache(&AboutRedirector::sActivityStreamEnabled,
                                  "browser.newtabpage.activity-stream.enabled");
-    Preferences::AddBoolVarCache(&AboutRedirector::sActivityStreamAboutHomeEnabled,
-                                 "browser.newtabpage.activity-stream.aboutHome.enabled");
     sASEnabledCacheInited = true;
   }
 }
 
 NS_IMETHODIMP
 AboutRedirector::NewChannel(nsIURI* aURI,
                             nsILoadInfo* aLoadInfo,
                             nsIChannel** result)
@@ -147,17 +144,17 @@ AboutRedirector::NewChannel(nsIURI* aURI
 
   LoadActivityStreamPrefs();
 
   for (auto & redir : kRedirMap) {
     if (!strcmp(path.get(), redir.id)) {
       nsAutoCString url;
 
       if (path.EqualsLiteral("newtab") ||
-          (path.EqualsLiteral("home") && sActivityStreamEnabled && sActivityStreamAboutHomeEnabled)) {
+          (path.EqualsLiteral("home") && sActivityStreamEnabled)) {
         // let the aboutNewTabService decide where to redirect
         nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
           do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
         NS_ENSURE_SUCCESS(rv, rv);
         rv = aboutNewTabService->GetDefaultURL(url);
         NS_ENSURE_SUCCESS(rv, rv);
       }
       // fall back to the specified url in the map
@@ -207,17 +204,17 @@ AboutRedirector::GetURIFlags(nsIURI *aUR
   LoadActivityStreamPrefs();
 
   for (auto & redir : kRedirMap) {
     if (name.Equals(redir.id)) {
 
       // Once ActivityStream is fully rolled out and we've removed Tiles,
       // this special case can go away and the flag can just become part
       // of the normal about:newtab entry in kRedirMap.
-      if (name.EqualsLiteral("newtab") || (name.EqualsLiteral("home") && sActivityStreamAboutHomeEnabled)) {
+      if (name.EqualsLiteral("newtab") || name.EqualsLiteral("home")) {
         if (sActivityStreamEnabled) {
           *result = redir.flags |
             nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
             nsIAboutModule::ENABLE_INDEXED_DB |
             nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT;
           return NS_OK;
         }
       }
--- a/browser/components/about/AboutRedirector.h
+++ b/browser/components/about/AboutRedirector.h
@@ -22,17 +22,16 @@ public:
   static nsresult
     Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 protected:
   virtual ~AboutRedirector() {}
 
 private:
   static bool sActivityStreamEnabled;
-  static bool sActivityStreamAboutHomeEnabled;
 
   static void LoadActivityStreamPrefs();
 };
 
 } // namespace browser
 } // namespace mozilla
 
 #endif // AboutRedirector_h__
--- a/browser/components/privatebrowsing/test/browser/browser.ini
+++ b/browser/components/privatebrowsing/test/browser/browser.ini
@@ -17,17 +17,16 @@ support-files =
   file_favicon.html
   file_favicon.png
   file_favicon.png^headers^
   file_triggeringprincipal_oa.html
 
 [browser_privatebrowsing_DownloadLastDirWithCPS.js]
 [browser_privatebrowsing_about.js]
 tags = trackingprotection
-[browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js]
 [browser_privatebrowsing_aboutSessionRestore.js]
 [browser_privatebrowsing_cache.js]
 [browser_privatebrowsing_certexceptionsui.js]
 [browser_privatebrowsing_concurrent.js]
 [browser_privatebrowsing_context_and_chromeFlags.js]
 [browser_privatebrowsing_crh.js]
 [browser_privatebrowsing_downloadLastDir.js]
 [browser_privatebrowsing_downloadLastDir_c.js]
deleted file mode 100644
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This test checks that the Session Restore "Restore Previous Session"
-// button on about:home is disabled in private mode
-add_task(async function test_no_sessionrestore_button() {
-  // Activity Stream page does not have a restore session button.
-  // We want to run this test only when Activity Stream is disabled from about:home.
-  await SpecialPowers.pushPrefEnv({set: [
-    ["browser.newtabpage.activity-stream.aboutHome.enabled", false]
-  ]});
-  // Opening, then closing, a private window shouldn't create session data.
-  (await BrowserTestUtils.openNewBrowserWindow({private: true})).close();
-
-  let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
-  let tab = win.gBrowser.addTab("about:home");
-  let browser = tab.linkedBrowser;
-
-  await BrowserTestUtils.browserLoaded(browser);
-
-  await ContentTask.spawn(browser, null, async function() {
-    let button = content.document.getElementById("restorePreviousSession");
-    Assert.equal(content.getComputedStyle(button).display, "none",
-      "The Session Restore about:home button should be disabled");
-  });
-
-  win.close();
-});
--- a/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js
+++ b/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js
@@ -32,71 +32,20 @@ add_task(async function setup() {
 
   // Make sure to restore the engine once we're done.
   registerCleanupFunction(async function() {
     Services.search.currentEngine = originalEngine;
     Services.search.removeEngine(engineDefault);
     Services.search.removeEngine(engineOneOff);
     await PlacesUtils.history.clear();
     Services.telemetry.setEventRecordingEnabled("navigation", false);
-    Services.prefs.clearUserPref("browser.newtabpage.activity-stream.aboutHome.enabled");
   });
 });
 
-add_task(async function test_abouthome_simpleQuery() {
-  // Make sure Activity Stream about:home is disabled.
-  Services.prefs.setBoolPref("browser.newtabpage.activity-stream.aboutHome.enabled", false);
-
-  // Let's reset the counts.
-  Services.telemetry.clearScalars();
-  Services.telemetry.clearEvents();
-  let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
-
-  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
-
-  info("Setup waiting for AboutHomeLoadSnippetsCompleted.");
-  let promiseAboutHomeLoaded = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "AboutHomeLoadSnippetsCompleted", true, null, true);
-
-  info("Load about:home.");
-  tab.linkedBrowser.loadURI("about:home");
-  info("Wait for AboutHomeLoadSnippetsCompleted.");
-  await promiseAboutHomeLoaded;
-
-  info("Wait for ContentSearchUI search provider to initialize.");
-  await ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    await ContentTaskUtils.waitForCondition(() => content.wrappedJSObject.gContentSearchController.defaultEngine);
-  });
-
-  info("Trigger a simple serch, just test + enter.");
-  let p = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
-  await typeInSearchField(tab.linkedBrowser, "test query", "searchText");
-  await BrowserTestUtils.synthesizeKey("VK_RETURN", {}, tab.linkedBrowser);
-  await p;
-
-  // Check if the scalars contain the expected values.
-  const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
-  checkKeyedScalar(scalars, SCALAR_ABOUT_HOME, "search_enter", 1);
-  Assert.equal(Object.keys(scalars[SCALAR_ABOUT_HOME]).length, 1,
-               "This search must only increment one entry in the scalar.");
-
-  // Make sure SEARCH_COUNTS contains identical values.
-  checkKeyedHistogram(search_hist, "other-MozSearch.abouthome", 1);
-
-  // Also check events.
-  let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
-  events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
-  checkEvents(events, [["navigation", "search", "about_home", "enter", {engine: "other-MozSearch"}]]);
-
-  await BrowserTestUtils.removeTab(tab);
-});
-
 add_task(async function test_abouthome_activitystream_simpleQuery() {
-  // Make sure Activity Stream about:home is enabled.
-  Services.prefs.setBoolPref("browser.newtabpage.activity-stream.aboutHome.enabled", true);
-
   // Let's reset the counts.
   Services.telemetry.clearScalars();
   Services.telemetry.clearEvents();
   let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
 
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
 
   info("Setup waiting for search input to initialise.");