Bug 1237632 - Enable support for environment/profile/creationDate on Android. r=gfritzsche, a=sylvestre
authorMark Finkle <mfinkle@mozilla.com>
Thu, 07 Jan 2016 14:13:27 -0500
changeset 310779 786ce281aa07bf6b5e07772969b635e6ffdd2dec
parent 310778 62a772079ed99c96a64961034a359bb34e53034e
child 310780 b0fbc87bf36137a4982f553e5e709e54b31690af
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, sylvestre
bugs1237632
milestone45.0a2
Bug 1237632 - Enable support for environment/profile/creationDate on Android. r=gfritzsche, a=sylvestre
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
@@ -694,20 +694,18 @@ function EnvironmentCache() {
     this._addonBuilder = {
       watchForChanges: function() {}
     };
   } else {
     this._addonBuilder = new EnvironmentAddonBuilder(this);
     p = [ this._addonBuilder.init() ];
   }
 
-  if (AppConstants.platform !== "android") {
-    this._currentEnvironment.profile = {};
-    p.push(this._updateProfile());
-  }
+  this._currentEnvironment.profile = {};
+  p.push(this._updateProfile());
 
   let setup = () => {
     this._initTask = null;
     this._startWatchingPrefs();
     this._addonBuilder.watchForChanges();
     this._updateGraphicsFeatures();
     return this.currentEnvironment;
   };
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -9,17 +9,16 @@ Cu.import("resource://gre/modules/XPCOMU
 Cu.import("resource://testing-common/AddonManagerTesting.jsm");
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://testing-common/MockRegistrar.jsm", this);
 
 // Lazy load |LightweightThemeManager|, we won't be using it on Gonk.
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
                                   "resource://gre/modules/LightweightThemeManager.jsm");
 
-// Lazy load |ProfileAge| as it is not available on Android.
 XPCOMUtils.defineLazyModuleGetter(this, "ProfileAge",
                                   "resource://gre/modules/ProfileAge.jsm");
 
 // The webserver hosting the addons.
 var gHttpServer = null;
 // The URL of the webserver root.
 var gHttpRoot = null;
 // The URL of the data directory, on the webserver.
@@ -143,21 +142,16 @@ function spoofGfxAdapter() {
     gfxInfo.spoofVendorID(GFX_VENDOR_ID);
     gfxInfo.spoofDeviceID(GFX_DEVICE_ID);
   } catch (x) {
     // If we can't test gfxInfo, that's fine, we'll note it later.
   }
 }
 
 function spoofProfileReset() {
-  if (gIsAndroid) {
-    // ProfileAge is not available on Android.
-    return true;
-  }
-
   let profileAccessor = new ProfileAge();
 
   return profileAccessor.writeTimes({
     created: PROFILE_CREATION_DATE_MS,
     reset: PROFILE_RESET_DATE_MS
   });
 }
 
@@ -288,22 +282,16 @@ function checkSettingsSection(data) {
   // Check "defaultSearchEngine" separately, as it can either be undefined or string.
   if ("defaultSearchEngine" in data.settings) {
     checkString(data.settings.defaultSearchEngine);
     Assert.equal(typeof data.settings.defaultSearchEngineData, "object");
   }
 }
 
 function checkProfileSection(data) {
-  if (gIsAndroid) {
-    Assert.ok(!("profile" in data),
-              "There must be no profile section in Environment on Android.");
-    return;
-  }
-
   Assert.ok("profile" in data, "There must be a profile section in Environment.");
   Assert.equal(data.profile.creationDate, truncateToDays(PROFILE_CREATION_DATE_MS));
   Assert.equal(data.profile.resetDate, truncateToDays(PROFILE_RESET_DATE_MS));
 }
 
 function checkPartnerSection(data, isInitial) {
   const EXPECTED_FIELDS = {
     distributionId: DISTRIBUTION_ID,