Bug 1542842 - Fix remaining references to undefined Ci.nsITelemetry constant in WebExtensions tests. r=Standard8
authorLuca Greco <lgreco@mozilla.com>
Tue, 16 Apr 2019 12:58:30 +0000
changeset 469661 82531c8a2d73
parent 469658 f0c87ec1d694
child 469662 6c23754dcb40
push id35879
push usernerli@mozilla.com
push dateTue, 16 Apr 2019 22:01:48 +0000
treeherdermozilla-central@12a60898fdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1542842
milestone68.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 1542842 - Fix remaining references to undefined Ci.nsITelemetry constant in WebExtensions tests. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D27650
browser/components/extensions/test/browser/browser_ext_browserAction_contextMenu.js
toolkit/components/extensions/test/xpcshell/test_ext_incognito.js
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_contextMenu.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_contextMenu.js
@@ -67,17 +67,17 @@ function assertTelemetryMatches(events) 
     .map(relatedEvent => relatedEvent.slice(2, 6));
 
   // Events are now [method, object, value, extra] as expected.
   Assert.deepEqual(relatedEvents, events, "The events are recorded correctly");
 }
 
 add_task(async function test_setup() {
   // Clear any previosuly collected telemetry event.
-  Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
+  Services.telemetry.clearEvents();
 });
 
 add_task(async function browseraction_popup_contextmenu() {
   let extension = ExtensionTestUtils.loadExtension(extData);
   await extension.startup();
 
   await clickBrowserAction(extension, window);
 
--- a/toolkit/components/extensions/test/xpcshell/test_ext_incognito.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_incognito.js
@@ -7,17 +7,17 @@ const {AddonManager} = ChromeUtils.impor
 AddonTestUtils.init(this);
 AddonTestUtils.overrideCertDB();
 AddonTestUtils.createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
 AddonTestUtils.usePrivilegedSignatures = false;
 
 // Assert on the expected "addonsManager.action" telemetry events (and optional filter events to verify
 // by using a given actionType).
 function assertActionAMTelemetryEvent(expectedActionEvents, assertMessage, {actionType} = {}) {
-  const snapshot = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
+  const snapshot = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS, true);
 
   ok(snapshot.parent && snapshot.parent.length > 0, "Got parent telemetry events in the snapshot");
 
   const events = snapshot.parent.filter(([timestamp, category, method, object, value, extra]) => {
     return category === "addonsManager" && method === "action" && (
       !actionType ? true : extra && extra.action === actionType
     );
   }).map(([timestamp, category, method, object, value, extra]) => {