Bug 1378461 - Report other search engine names. r=mak, data-r=rweiss
authorMichael Kaply <mozilla@kaply.com>
Wed, 06 Sep 2017 17:36:07 -0500
changeset 429104 281a5532ea19ff3c90e3899031059b258104d6db
parent 429103 af8cb3153052d9ea583c96bf2723630d546715b1
child 429105 f42e4a61d6a5e0ecd932702ebc4fe5f7e9453c30
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1378461
milestone57.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 1378461 - Report other search engine names. r=mak, data-r=rweiss
browser/base/content/browser.js
browser/components/search/test/browser_oneOffContextMenu.js
browser/modules/BrowserUsageTelemetry.jsm
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3957,18 +3957,17 @@ const BrowserSearch = {
     openUILinkIn(this.searchEnginesURL, where);
   },
 
   _getSearchEngineId(engine) {
     if (engine && engine.identifier) {
       return engine.identifier;
     }
 
-    if (!engine || (engine.name === undefined) ||
-        !Services.prefs.getBoolPref("toolkit.telemetry.enabled"))
+    if (!engine || (engine.name === undefined))
       return "other";
 
     return "other-" + engine.name;
   },
 
   /**
    * Helper to record a search with Telemetry.
    *
--- a/browser/components/search/test/browser_oneOffContextMenu.js
+++ b/browser/components/search/test/browser_oneOffContextMenu.js
@@ -30,24 +30,17 @@ add_task(async function init() {
     searchbar, "anonid", "searchbar-search-button"
   );
 
   await promiseNewEngine(TEST_ENGINE_BASENAME, {
     setAsCurrent: false,
   });
 });
 
-add_task(async function extendedTelemetryDisabled() {
-  await SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.enabled", false]]});
-  await doTest();
-  checkTelemetry("other");
-});
-
-add_task(async function extendedTelemetryEnabled() {
-  await SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.enabled", true]]});
+add_task(async function telemetry() {
   await doTest();
   checkTelemetry("other-" + TEST_ENGINE_NAME);
 });
 
 async function doTest() {
   // Open the popup.
   let promise = promiseEvent(searchPopup, "popupshown");
   info("Opening search panel");
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -107,22 +107,17 @@ function getTabCount() {
   return getOpenTabsAndWinsCounts().tabCount;
 }
 
 function getSearchEngineId(engine) {
   if (engine) {
     if (engine.identifier) {
       return engine.identifier;
     }
-    // Due to bug 1222070, we can't directly check Services.telemetry.canRecordExtended
-    // here.
-    const extendedTelemetry = Services.prefs.getBoolPref("toolkit.telemetry.enabled");
-    if (engine.name && extendedTelemetry) {
-      // If it's a custom search engine only report the engine name
-      // if extended Telemetry is enabled.
+    if (engine.name) {
       return "other-" + engine.name;
     }
   }
   return "other";
 }
 
 let URICountListener = {
   // A set containing the visited domains, see bug 1271310.