Bug 1519480 - Update browser_webauthn_telemetry.js getParentProcessScalars with TelemetryTestUtils r=chutten,jcj
authorVarun Dey <varundey20@gmail.com>
Thu, 24 Jan 2019 14:47:21 +0000
changeset 515500 7013cb0056a24bf1638442c5328390f82331035c
parent 515499 1efd079a7f7a5dee46fa6b5fdd135524410a54ca
child 515501 49b9a79baf65069fea7b91d3498571eac30d28d5
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten, jcj
bugs1519480
milestone66.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 1519480 - Update browser_webauthn_telemetry.js getParentProcessScalars with TelemetryTestUtils r=chutten,jcj Replacing browser_webauthn_telemetry.js's custom getParentProcessScalars method with the method defined in TelemetryTestUtils module Differential Revision: https://phabricator.services.mozilla.com/D16568
dom/webauthn/tests/browser/browser_webauthn_telemetry.js
--- a/dom/webauthn/tests/browser/browser_webauthn_telemetry.js
+++ b/dom/webauthn/tests/browser/browser_webauthn_telemetry.js
@@ -1,26 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+ChromeUtils.defineModuleGetter(this, "TelemetryTestUtils",
+  "resource://testing-common/TelemetryTestUtils.jsm");
+
 const TEST_URL = "https://example.com/";
 
-// Return the scalars from the parent-process.
-function getParentProcessScalars(aKeyed = false, aClear = false) {
-  const scalars = aKeyed ?
-    Services.telemetry.getSnapshotForKeyedScalars("main", aClear)["parent"] :
-    Services.telemetry.getSnapshotForScalars("main", aClear)["parent"];
-  return scalars || {};
-}
-
 function getTelemetryForScalar(aName) {
-  let scalars = getParentProcessScalars(true);
+  let scalars = TelemetryTestUtils.getParentProcessScalars(
+    Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
   return scalars[aName] || 0;
 }
 
 function cleanupTelemetry() {
   Services.telemetry.clearScalars();
   Services.telemetry.clearEvents();
   Services.telemetry.getHistogramById("WEBAUTHN_CREATE_CREDENTIAL_MS").clear();
   Services.telemetry.getHistogramById("WEBAUTHN_GET_ASSERTION_MS").clear();