Bug 1393601 - Add telemetry for MOZ_UPDATER. r=Dexter, r=rweiss
authorAdam Gashlin <agashlin@mozilla.com>
Mon, 18 Sep 2017 09:50:10 -0700
changeset 666442 937a6f3af2bd156bc1982b519faaac7edda93c2f
parent 666441 64b9aee0d408a82e3a3cd2f236742ff1dbdd3f4a
child 666443 7fba2073e87027ba4d61196df519f5b32560857d
push id80410
push userbmo:ttromey@mozilla.com
push dateMon, 18 Sep 2017 19:18:46 +0000
reviewersDexter, rweiss
bugs1393601
milestone57.0a1
Bug 1393601 - Add telemetry for MOZ_UPDATER. r=Dexter, r=rweiss
toolkit/components/telemetry/TelemetryEnvironment.jsm
toolkit/components/telemetry/docs/data/environment.rst
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -1287,16 +1287,17 @@ EnvironmentCache.prototype = {
       applicationName: Services.appinfo.name || null,
       architecture: Services.sysinfo.get("arch"),
       buildId: Services.appinfo.appBuildID || null,
       version: Services.appinfo.version || null,
       vendor: Services.appinfo.vendor || null,
       platformVersion: Services.appinfo.platformVersion || null,
       xpcomAbi: Services.appinfo.XPCOMABI,
       hotfixVersion: Services.prefs.getStringPref(PREF_HOTFIX_LASTVERSION, null),
+      updaterAvailable: AppConstants.MOZ_UPDATER,
     };
 
     // Add |architecturesInBinary| only for Mac Universal builds.
     if ("@mozilla.org/xpcom/mac-utils;1" in Cc) {
       let macUtils = Cc["@mozilla.org/xpcom/mac-utils;1"].getService(Ci.nsIMacUtils);
       if (macUtils && macUtils.isUniversalBinary) {
         buildData.architecturesInBinary = macUtils.architecturesInBinary;
       }
--- a/toolkit/components/telemetry/docs/data/environment.rst
+++ b/toolkit/components/telemetry/docs/data/environment.rst
@@ -27,16 +27,17 @@ Structure:
         architecture: <string>, // e.g. "x86", build architecture for the active build
         architecturesInBinary: <string>, // e.g. "i386-x86_64", from nsIMacUtils.architecturesInBinary, only present for mac universal builds
         buildId: <string>, // e.g. "20141126041045"
         version: <string>, // e.g. "35.0"
         vendor: <string>, // e.g. "Mozilla"
         platformVersion: <string>, // e.g. "35.0"
         xpcomAbi: <string>, // e.g. "x86-msvc"
         hotfixVersion: <string>, // e.g. "20141211.01"
+        updaterAvailable: <bool>, // Whether the app was built with app update available (MOZ_UPDATER)
       },
       settings: {
         addonCompatibilityCheckEnabled: <bool>, // Whether application compatibility is respected for add-ons
         blocklistEnabled: <bool>, // true on failure
         isDefaultBrowser: <bool>, // null on failure and until session restore completes, not available on Android
         defaultSearchEngine: <string>, // e.g. "yahoo"
         defaultSearchEngineData: {, // data about the current default engine
           name: <string>, // engine name, e.g. "Yahoo"; or "NONE" if no default
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -397,16 +397,19 @@ function checkBuildSection(data) {
   Assert.equal(data.build.hotfixVersion, APP_HOTFIX_VERSION);
 
   if (gIsMac) {
     let macUtils = Cc["@mozilla.org/xpcom/mac-utils;1"].getService(Ci.nsIMacUtils);
     if (macUtils && macUtils.isUniversalBinary) {
       Assert.ok(checkString(data.build.architecturesInBinary));
     }
   }
+
+  Assert.equal(data.build.updaterAvailable, AppConstants.MOZ_UPDATER,
+               "build.updaterAvailable must equal AppConstants.MOZ_UPDATER");
 }
 
 function checkSettingsSection(data) {
   const EXPECTED_FIELDS_TYPES = {
     blocklistEnabled: "boolean",
     e10sEnabled: "boolean",
     e10sCohort: "string",
     telemetryEnabled: "boolean",