Bug 1064333 - Init TelemetryPing in tests even if MOZILLA_OFFICIAL is not set. r=froydnj, a=lmandel
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Sun, 19 Oct 2014 20:45:15 +0200
changeset 225903 efb3c956dfef
parent 225902 ec67776fc5e3
child 225904 bda711062d08
push id4063
push usergeorg.fritzsche@googlemail.com
push date2014-11-02 23:54 +0000
treeherdermozilla-beta@1ca39da5df9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, lmandel
bugs1064333
milestone34.0
Bug 1064333 - Init TelemetryPing in tests even if MOZILLA_OFFICIAL is not set. r=froydnj, a=lmandel
toolkit/components/telemetry/TelemetryPing.jsm
--- a/toolkit/components/telemetry/TelemetryPing.jsm
+++ b/toolkit/components/telemetry/TelemetryPing.jsm
@@ -902,17 +902,17 @@ let Impl = {
     // If there is no previousBuildID preference, this._previousBuildID remains
     // undefined so no value is sent in the telemetry metadata.
     if (previousBuildID != thisBuildID) {
       this._previousBuildID = previousBuildID;
       Services.prefs.setCharPref(PREF_PREVIOUS_BUILDID, thisBuildID);
     }
 
 #ifdef MOZILLA_OFFICIAL
-    if (!Telemetry.canSend) {
+    if (!Telemetry.canSend && !aTesting) {
       // We can't send data; no point in initializing observers etc.
       // Only do this for official builds so that e.g. developer builds
       // still enable Telemetry based on prefs.
       Telemetry.canRecord = false;
       return;
     }
 #endif
     let enabled = false;