diff --git a/browser/base/content/test/general/healthreport_testRemoteCommands.html b/browser/base/content/test/general/healthreport_testRemoteCommands.html index 550c198df904..cc9e70767084 100644 --- a/browser/base/content/test/general/healthreport_testRemoteCommands.html +++ b/browser/base/content/test/general/healthreport_testRemoteCommands.html @@ -1,267 +1,272 @@ - - - - - - - - - + + + + + + + + + diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js index 1537bf7a6185..0a9daab24ade 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js @@ -21,6 +21,7 @@ Cu.import("resource://gre/modules/Promise.jsm", this); Cu.import("resource://gre/modules/Preferences.jsm"); const PING_FORMAT_VERSION = 4; +const DELETION_PING_TYPE = "deletion"; const TEST_PING_TYPE = "test-ping-type"; const PLATFORM_VERSION = "1.9.2"; @@ -174,6 +175,25 @@ add_task(function* test_simplePing() { checkPingFormat(ping, TEST_PING_TYPE, false, false); }); +add_task(function* test_deletionPing() { + const isUnified = Preferences.get(PREF_UNIFIED, false); + if (!isUnified) { + // Skipping the test if unified telemetry is off, as no deletion ping will + // be generated. + return; + } + + // Disable FHR upload: this should trigger a deletion ping. + Preferences.set(PREF_FHR_UPLOAD_ENABLED, false); + + let request = yield gRequestIterator.next(); + let ping = decodeRequestPayload(request); + checkPingFormat(ping, DELETION_PING_TYPE, true, false); + + // Restore FHR Upload. + Preferences.set(PREF_FHR_UPLOAD_ENABLED, true); +}); + add_task(function* test_pingHasClientId() { // Send a ping with a clientId. yield sendPing(true, false); @@ -231,6 +251,14 @@ add_task(function* test_archivePings() { const uploadPref = isUnified ? PREF_FHR_UPLOAD_ENABLED : PREF_ENABLED; Preferences.set(uploadPref, false); + // If we're using unified telemetry, disabling ping upload will generate a "deletion" + // ping. Catch it. + if (isUnified) { + let request = yield gRequestIterator.next(); + let ping = decodeRequestPayload(request); + checkPingFormat(ping, DELETION_PING_TYPE, true, false); + } + // Register a new Ping Handler that asserts if a ping is received, then send a ping. registerPingHandler(() => Assert.ok(false, "Telemetry must not send pings if not allowed to.")); let pingId = yield sendPing(true, true);