Backed out changeset 2ddf1fe9a47d (bug 1612270) for ESlint failure at ActivityStream.jsm. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Wed, 19 Feb 2020 00:58:47 +0200
changeset 514547 2fd89dbe725861f6d82000081c6708fa27f1e431
parent 514546 0f2375ca44f9a354c6a41e021e3e0c10701ac131
child 514548 beaad55e6508bdaf6c82499f452218cda0bd1798
push id107635
push usercbrindusan@mozilla.com
push dateTue, 18 Feb 2020 23:00:56 +0000
treeherderautoland@2fd89dbe7258 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1612270
milestone75.0a1
backs out2ddf1fe9a47d03fa83cf726e560a56ec1a8b2530
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
Backed out changeset 2ddf1fe9a47d (bug 1612270) for ESlint failure at ActivityStream.jsm. CLOSED TREE
browser/app/profile/firefox.js
browser/components/newtab/docs/v2-system-addon/preferences.md
browser/components/newtab/lib/ActivityStream.jsm
browser/components/newtab/test/unit/lib/ActivityStream.test.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1300,18 +1300,16 @@ pref("browser.newtabpage.activity-stream
 // These prefs control if Discovery Stream is enabled.
 pref("browser.newtabpage.activity-stream.discoverystream.enabled", true);
 pref("browser.newtabpage.activity-stream.discoverystream.hardcoded-basic-layout", false);
 pref("browser.newtabpage.activity-stream.discoverystream.spocs-endpoint", "");
 // List of langs that get the 7 row layout.
 pref("browser.newtabpage.activity-stream.discoverystream.lang-layout-config", "en");
 // List of regions that get stories by default.
 pref("browser.newtabpage.activity-stream.discoverystream.region-stories-config", "US,DE,CA");
-// List of regions that get spocs by default.
-pref("browser.newtabpage.activity-stream.discoverystream.region-spocs-config", "US");
 // Switch between different versions of the recommendation provider.
 pref("browser.newtabpage.activity-stream.discoverystream.personalization.version", 1);
 // Configurable keys used by personalization version 2.
 pref("browser.newtabpage.activity-stream.discoverystream.personalization.modelKeys", "nb_model_business, nb_model_career, nb_model_education, nb_model_entertainment, nb_model_environment, nb_model_food, nb_model_gaming, nb_model_health_fitness, nb_model_parenting, nb_model_personal_finance, nb_model_politics, nb_model_science, nb_model_self_improvement, nb_model_sports, nb_model_technology, nb_model_travel");
 
 // The pref controls if search hand-off is enabled for Activity Stream.
 #ifdef NIGHTLY_BUILD
   pref("browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar", true);
--- a/browser/components/newtab/docs/v2-system-addon/preferences.md
+++ b/browser/components/newtab/docs/v2-system-addon/preferences.md
@@ -180,23 +180,15 @@ Programmatically generated hash table wh
 #### `browser.newtabpage.activity-stream.discoverystream.region-stories-config`
 
 - Type: `string`
 - Default: `US,DE,CA`
 - Pref Type: Firefox
 
 A comma separated list of geos that by default have stories enabled in newtab. It matches the client's geo with that list, then looks for a matching locale.
 
-#### `browser.newtabpage.activity-stream.discoverystream.region-spocs-config`
-
-- Type: `string`
-- Default: `US`
-- Pref Type: Firefox
-
-A comma separated list of geos that by default have spocs enabled in newtab. It matches the client's geo with that list.
-
 #### `browser.newtabpage.activity-stream.discoverystream.spocs-endpoint`
 
 - Type: `string`
 - Default: `null`
 - Pref Type: Firefox
 
 Override to specify endpoint for SPOCs. Will take precedence over remote and hardcoded layout SPOC endpoints.
--- a/browser/components/newtab/lib/ActivityStream.jsm
+++ b/browser/components/newtab/lib/ActivityStream.jsm
@@ -131,25 +131,20 @@ const DEFAULT_SITES = new Map([
     "FR",
     "https://www.youtube.com/,https://www.facebook.com/,https://www.wikipedia.org/,https://www.amazon.fr/,https://www.leboncoin.fr/,https://twitter.com/",
   ],
 ]);
 const GEO_PREF = "browser.search.region";
 const REGION_STORIES_CONFIG =
   "browser.newtabpage.activity-stream.discoverystream.region-stories-config";
 const SPOCS_GEOS = ["US"];
-const REGION_SPOCS_CONFIG =
-  "browser.newtabpage.activity-stream.discoverystream.region-spocs-config";
 
 // Determine if spocs should be shown for a geo/locale
 function showSpocs({ geo }) {
-  const spocsGeoString =
-    Services.prefs.getStringPref(REGION_SPOCS_CONFIG) || "";
-  const spocsGeo = spocsGeoString.split(",").map(s => s.trim());
-  return spocsGeo.includes(geo);
+  return SPOCS_GEOS.includes(geo);
 }
 
 // Configure default Activity Stream prefs with a plain `value` or a `getValue`
 // that computes a value. A `value_local_dev` is used for development defaults.
 const PREFS_CONFIG = new Map([
   [
     "default.sites",
     {
--- a/browser/components/newtab/test/unit/lib/ActivityStream.test.js
+++ b/browser/components/newtab/test/unit/lib/ActivityStream.test.js
@@ -241,39 +241,16 @@ describe("ActivityStream", () => {
         .get(() => "de-DE");
 
       as._updateDynamicPrefs();
 
       assert.isTrue(
         JSON.parse(PREFS_CONFIG.get("discoverystream.config").value).enabled
       );
     });
-    it("should enable spocs based on region based pref", () => {
-      sandbox.stub(global.Services.prefs, "prefHasUserValue").returns(true);
-      const getStringPrefStub = sandbox.stub(
-        global.Services.prefs,
-        "getStringPref"
-      );
-      getStringPrefStub.withArgs("browser.search.region").returns("CA");
-      getStringPrefStub
-        .withArgs(
-          "browser.newtabpage.activity-stream.discoverystream.region-spocs-config"
-        )
-        .returns("US,CA");
-
-      sandbox
-        .stub(global.Services.locale, "appLocaleAsBCP47")
-        .get(() => "en-CA");
-
-      as._updateDynamicPrefs();
-
-      assert.isTrue(
-        JSON.parse(PREFS_CONFIG.get("discoverystream.config").value).show_spocs
-      );
-    });
   });
   describe("_updateDynamicPrefs topstories default value", () => {
     let getStringPrefStub;
     let appLocaleAsBCP47Stub;
     let prefHasUserValueStub;
     beforeEach(() => {
       prefHasUserValueStub = sandbox.stub(
         global.Services.prefs,