Bug 1510678 - Change recommended addons for Firefox 64 CFR release. r=k88hudson a=jcristau
authorUrsula Sarracini <ursulasarracini@gmail.com>
Thu, 29 Nov 2018 17:43:06 +0000
changeset 501446 321f1fb3b41f
parent 501445 fa624a63f7d9
child 501447 05dcb777fbc3
push id1865
push userjcristau@mozilla.com
push dateMon, 03 Dec 2018 16:48:50 +0000
treeherdermozilla-release@321f1fb3b41f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersk88hudson, jcristau
bugs1510678
milestone64.0
Bug 1510678 - Change recommended addons for Firefox 64 CFR release. r=k88hudson a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D13437
browser/components/newtab/lib/CFRMessageProvider.jsm
browser/components/newtab/test/unit/asrouter/CFRMessageProvider.test.js
--- a/browser/components/newtab/lib/CFRMessageProvider.jsm
+++ b/browser/components/newtab/lib/CFRMessageProvider.jsm
@@ -43,16 +43,17 @@ const REDDIT_ENHANCEMENT_PARAMS = {
   sumo_path: "extensionrecommendations",
   min_frecency: 10000,
 };
 
 const CFR_MESSAGES = [
   {
     id: "AMAZON_ASSISTANT_1",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: AMAZON_ASSISTANT_PARAMS.sumo_path,
       },
@@ -95,16 +96,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(AMAZON_ASSISTANT_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(AMAZON_ASSISTANT_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${AMAZON_ASSISTANT_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: AMAZON_ASSISTANT_PARAMS.open_urls},
   },
   {
     id: "AMAZON_ASSISTANT_3",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: AMAZON_ASSISTANT_PARAMS.sumo_path,
       },
@@ -147,16 +149,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(AMAZON_ASSISTANT_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(AMAZON_ASSISTANT_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${AMAZON_ASSISTANT_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: AMAZON_ASSISTANT_PARAMS.open_urls},
   },
   {
     id: "FACEBOOK_CONTAINER_1",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: FACEBOOK_CONTAINER_PARAMS.sumo_path,
       },
@@ -251,16 +254,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(FACEBOOK_CONTAINER_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(FACEBOOK_CONTAINER_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${FACEBOOK_CONTAINER_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: FACEBOOK_CONTAINER_PARAMS.open_urls},
   },
   {
     id: "GOOGLE_TRANSLATE_1",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: GOOGLE_TRANSLATE_PARAMS.sumo_path,
       },
@@ -355,16 +359,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(GOOGLE_TRANSLATE_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(GOOGLE_TRANSLATE_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${GOOGLE_TRANSLATE_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: GOOGLE_TRANSLATE_PARAMS.open_urls},
   },
   {
     id: "YOUTUBE_ENHANCE_1",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: YOUTUBE_ENHANCE_PARAMS.sumo_path,
       },
@@ -459,16 +464,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(YOUTUBE_ENHANCE_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(YOUTUBE_ENHANCE_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${YOUTUBE_ENHANCE_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: YOUTUBE_ENHANCE_PARAMS.open_urls},
   },
   {
     id: "WIKIPEDIA_CONTEXT_MENU_SEARCH_1",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.sumo_path,
       },
@@ -511,16 +517,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.open_urls},
   },
   {
     id: "WIKIPEDIA_CONTEXT_MENU_SEARCH_3",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.sumo_path,
       },
@@ -563,16 +570,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.open_urls},
   },
   {
     id: "REDDIT_ENHANCEMENT_1",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: REDDIT_ENHANCEMENT_PARAMS.sumo_path,
       },
@@ -615,16 +623,17 @@ const CFR_MESSAGES = [
       (xpinstallEnabled == true) &&
       (${JSON.stringify(REDDIT_ENHANCEMENT_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(REDDIT_ENHANCEMENT_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${REDDIT_ENHANCEMENT_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: REDDIT_ENHANCEMENT_PARAMS.open_urls},
   },
   {
     id: "REDDIT_ENHANCEMENT_3",
     template: "cfr_doorhanger",
+    exclude: true,
     content: {
       bucket_id: "CFR_M1",
       notification_text: {string_id: "cfr-doorhanger-extension-notification"},
       heading_text: {string_id: "cfr-doorhanger-extension-heading"},
       info_icon: {
         label: {string_id: "cfr-doorhanger-extension-sumo-link"},
         sumo_path: REDDIT_ENHANCEMENT_PARAMS.sumo_path,
       },
@@ -668,14 +677,14 @@ const CFR_MESSAGES = [
       (${JSON.stringify(REDDIT_ENHANCEMENT_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
       (${JSON.stringify(REDDIT_ENHANCEMENT_PARAMS.open_urls)} intersect topFrecentSites[.frecency >= ${REDDIT_ENHANCEMENT_PARAMS.min_frecency}]|mapToProperty('host'))|length > 0`,
     trigger: {id: "openURL", params: REDDIT_ENHANCEMENT_PARAMS.open_urls},
   },
 ];
 
 const CFRMessageProvider = {
   getMessages() {
-    return CFR_MESSAGES;
+    return CFR_MESSAGES.filter(msg => !msg.exclude);
   },
 };
 this.CFRMessageProvider = CFRMessageProvider;
 
 const EXPORTED_SYMBOLS = ["CFRMessageProvider"];
--- a/browser/components/newtab/test/unit/asrouter/CFRMessageProvider.test.js
+++ b/browser/components/newtab/test/unit/asrouter/CFRMessageProvider.test.js
@@ -1,51 +1,32 @@
 import {CFRMessageProvider} from "lib/CFRMessageProvider.jsm";
 const messages = CFRMessageProvider.getMessages();
 
 const REGULAR_IDS = [
   "FACEBOOK_CONTAINER",
   "GOOGLE_TRANSLATE",
   "YOUTUBE_ENHANCE",
-  "WIKIPEDIA_CONTEXT_MENU_SEARCH",
-  "REDDIT_ENHANCEMENT",
+  // These are excluded for now.
+  // "WIKIPEDIA_CONTEXT_MENU_SEARCH",
+  // "REDDIT_ENHANCEMENT",
 ];
 
 describe("CFRMessageProvider", () => {
-  it("should have a total of 12 messages", () => {
-    assert.lengthOf(messages, 12);
+  it("should have a total of 3 messages", () => {
+    assert.lengthOf(messages, 3);
   });
-  it("should two variants for each of the five regular addons", () => {
+  it("should have one message each for the three regular addons", () => {
     for (const id of REGULAR_IDS) {
-      const cohort1 = messages.find(msg => msg.id === `${id}_1`);
-      assert.ok(cohort1, `contains one day cohort for ${id}`);
-      assert.deepEqual(cohort1.frequency, {lifetime: 1}, "one day cohort has the right frequency cap");
-      assert.include(cohort1.targeting, `(providerCohorts.cfr in ["one_per_day", "nightly"])`);
-
       const cohort3 = messages.find(msg => msg.id === `${id}_3`);
       assert.ok(cohort3, `contains three day cohort for ${id}`);
       assert.deepEqual(cohort3.frequency, {lifetime: 3}, "three day cohort has the right frequency cap");
       assert.include(cohort3.targeting, `(providerCohorts.cfr == "three_per_day")`);
-
-      assert.deepEqual(cohort1.content, cohort3.content, "cohorts should have the same content");
     }
   });
-  it("should have the two amazon cohorts", () => {
-    const cohort1 = messages.find(msg => msg.id === `AMAZON_ASSISTANT_1`);
-    const cohort3 = messages.find(msg => msg.id === `AMAZON_ASSISTANT_3`);
-    assert.deepEqual(cohort1.content, cohort3.content, "cohorts should have the same content");
-
-    assert.ok(cohort1, `contains one day cohort for amazon`);
-    assert.deepEqual(cohort1.frequency, {lifetime: 1}, "one day cohort has the right frequency cap");
-    assert.include(cohort1.targeting, `(providerCohorts.cfr == "one_per_day_amazon"`);
-
-    assert.ok(cohort3, `contains three day cohort for amazon`);
-    assert.deepEqual(cohort3.frequency, {lifetime: 3}, "three day cohort has the right frequency cap");
-    assert.include(cohort3.targeting, `(providerCohorts.cfr == "three_per_day_amazon")`);
-  });
   it("should always have xpinstallEnabled as targeting if it is an addon", () => {
     for (const message of messages) {
       // Ensure that the CFR messages that are recommending an addon have this targeting.
       // In the future when we can do targeting based on category, this test will change.
       // See bug 1494778 and 1497653
       assert.include(message.targeting, `(xpinstallEnabled == true)`);
     }
   });