From 3df3ea0b863d7e0b5b0b5993ed86ba438bfc4cbf Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Mon, 29 Oct 2018 18:48:52 +0000 Subject: [PATCH] Bug 1501041 - Fix browser_UsageTelemetry_content*.js to consistently fail if there is an issue with the navigation event probe, and disable them due to current expiry. r=adw Differential Revision: https://phabricator.services.mozilla.com/D10070 --HG-- extra : moz-landing-system : lando --- browser/modules/test/browser/browser.ini | 2 ++ .../modules/test/browser/browser_UsageTelemetry_content.js | 5 +++++ .../test/browser/browser_UsageTelemetry_content_aboutHome.js | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/browser/modules/test/browser/browser.ini b/browser/modules/test/browser/browser.ini index 83e143d8a635..ebdf231cfc4c 100644 --- a/browser/modules/test/browser/browser.ini +++ b/browser/modules/test/browser/browser.ini @@ -50,5 +50,7 @@ support-files = usageTelemetrySearchSuggestions.sjs usageTelemetrySearchSuggestions.xml [browser_UsageTelemetry_content.js] +disabled = bug 1496764 - Telemetry probe needs extension [browser_UsageTelemetry_content_aboutHome.js] +disabled = bug 1496764 - Telemetry probe needs extension [browser_UsageTelemetry_content_aboutRestartRequired.js] diff --git a/browser/modules/test/browser/browser_UsageTelemetry_content.js b/browser/modules/test/browser/browser_UsageTelemetry_content.js index d5971666105a..244501869582 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_content.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_content.js @@ -27,6 +27,10 @@ add_task(async function setup() { ["dom.select_events.enabled", true], // We want select events to be fired. ]}); + // Enable local telemetry recording for the duration of the tests. + let oldCanRecord = Services.telemetry.canRecordExtended; + Services.telemetry.canRecordExtended = true; + // Enable event recording for the events tested here. Services.telemetry.setEventRecordingEnabled("navigation", true); @@ -37,6 +41,7 @@ add_task(async function setup() { Services.search.removeEngine(engineOneOff); await PlacesUtils.history.clear(); Services.telemetry.setEventRecordingEnabled("navigation", false); + Services.telemetry.canRecordExtended = oldCanRecord; }); }); diff --git a/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js b/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js index 987a8d50f464..a70963850909 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js @@ -27,6 +27,10 @@ add_task(async function setup() { let engineOneOff = Services.search.getEngineByName("MozSearch2"); Services.search.moveEngine(engineOneOff, 0); + // Enable local telemetry recording for the duration of the tests. + let oldCanRecord = Services.telemetry.canRecordExtended; + Services.telemetry.canRecordExtended = true; + // Enable event recording for the events tested here. Services.telemetry.setEventRecordingEnabled("navigation", true); @@ -37,6 +41,7 @@ add_task(async function setup() { Services.search.removeEngine(engineOneOff); await PlacesUtils.history.clear(); Services.telemetry.setEventRecordingEnabled("navigation", false); + Services.telemetry.canRecordExtended = oldCanRecord; }); });