Bug 1357517 - Disable pref observer TelemetrySend test on platforms where the crash reporter component is not available (like asan). r=me
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Mon, 31 Jul 2017 19:28:27 +0200
changeset 420839 45821738caeb0294b7fec3a00e51413124955110
parent 420838 af4be30c258b531e06a6350f03604ca3fc3cb43c
child 420840 fa81cd2510dbadd71d657258c7e76de6d74775cc
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1357517
milestone56.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 1357517 - Disable pref observer TelemetrySend test on platforms where the crash reporter component is not available (like asan). r=me
toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
@@ -518,16 +518,22 @@ add_task(async function test_measurePing
   // Check that we recorded the ping sizes correctly into histograms.
   Assert.equal(histogramValueCount(histSuccessPingSize.snapshot()), 2,
     "Should have recorded 2 successful ping into histogram.");
   Assert.equal(histogramValueCount(histFailedPingSize.snapshot()), 1,
     "Should have recorded 1 failed ping into histogram.");
 });
 
 add_task(async function test_pref_observer() {
+  // This test requires the presence of the crash reporter component.
+  let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
+  if (!registrar.isContractIDRegistered("@mozilla.org/toolkit/crash-reporter;1")) {
+    return;
+  }
+
   await TelemetrySend.setup(true);
 
   let origTelemetryEnabled = Services.prefs.getBoolPref(TelemetryUtils.Preferences.TelemetryEnabled);
   let origFhrUploadEnabled = Services.prefs.getBoolPref(TelemetryUtils.Preferences.FhrUploadEnabled);
 
   Services.prefs.setBoolPref(TelemetryUtils.Preferences.TelemetryEnabled, true);
   Services.prefs.setBoolPref(TelemetryUtils.Preferences.FhrUploadEnabled, true);