Bug 1222503 - Fix Telemetry not reporting any GMPlugns. r=gfritzsche
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Fri, 06 Nov 2015 09:51:00 +0100
changeset 271748 51f9f0caec6052c6020b8b94f06bbbfc315527f1
parent 271569 2fe63f770d60eb93a919912d98d5afb5761b3366
child 271749 f478d8bdf1dbe4782fa46b413e9d97a910e9ccf7
push id29651
push userkwierso@gmail.com
push dateTue, 10 Nov 2015 00:48:28 +0000
treeherdermozilla-central@d5b4d4fc3bed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1222503
milestone45.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 1222503 - Fix Telemetry not reporting any GMPlugns. r=gfritzsche
toolkit/components/telemetry/TelemetryEnvironment.jsm
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -615,18 +615,18 @@ EnvironmentAddonBuilder.prototype = {
    * running this during addon manager shutdown.
    */
   _getActiveGMPlugins: Task.async(function* () {
     // Request plugins, asynchronously.
     let allPlugins = yield promiseGetAddonsByTypes(["plugin"]);
 
     let activeGMPlugins = {};
     for (let plugin of allPlugins) {
-      // Only get info for valid and enabled GMPlugins.
-      if (!plugin.isGMPlugin || !plugin.isValid || plugin.disabled) {
+      // Only get info for active GMplugins.
+      if (!plugin.isGMPlugin || !plugin.isActive) {
         continue;
       }
 
       activeGMPlugins[plugin.id] = {
         version: plugin.version,
         userDisabled: plugin.userDisabled,
         applyBackgroundUpdates: plugin.applyBackgroundUpdates,
       };
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -553,17 +553,20 @@ function checkTheme(data) {
                  f + " must have the correct type.");
   }
 
   // We check "description" separately, as it can be null.
   Assert.ok(checkNullOrString(data.description));
 }
 
 function checkActiveGMPlugin(data) {
-  Assert.equal(typeof data.version, "string");
+  // GMP plugin version defaults to null until GMPDownloader runs to update it.
+  if (data.version) {
+    Assert.equal(typeof data.version, "string");
+  }
   Assert.equal(typeof data.userDisabled, "boolean");
   Assert.equal(typeof data.applyBackgroundUpdates, "number");
 }
 
 function checkAddonsSection(data) {
   const EXPECTED_FIELDS = [
     "activeAddons", "theme", "activePlugins", "activeGMPlugins", "activeExperiment",
     "persona",