Bug 1378461 - Report other search engine names. r=mak, data-r=rweiss, a=gchang
authorMichael Kaply <mozilla@kaply.com>
Wed, 06 Sep 2017 17:36:07 -0500
changeset 424023 7e38724bec08788526762000fbc6cecf76b3fb10
parent 424022 719dcb3901275b053dedbd3bc3763d92c321b8b2
child 424024 6e0e2f09610e3f8c541f6e21f140c637539bec3e
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, gchang
bugs1378461
milestone56.0
Bug 1378461 - Report other search engine names. r=mak, data-r=rweiss, a=gchang
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
@@ -3961,18 +3961,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
@@ -22,24 +22,17 @@ const searchInNewTabMenuItem = document.
 );
 
 add_task(async function init() {
   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
@@ -98,22 +98,17 @@ function getOpenTabsAndWinsCounts() {
   return { tabCount, winCount };
 }
 
 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.