Bug 1433485 - Update test prefs for telemetry; r=mythmon,dexter
authorGeoff Brown <gbrown@mozilla.com>
Wed, 21 Feb 2018 10:57:04 -0700
changeset 404676 182c9af3ed1acd7a4459966f73043093312c32c2
parent 404675 655aa8e5fb99216d49b112ed0cc427f05d773ed5
child 404677 9fc0c79890cb95ea48d83cd358b19e8f90e030cc
push id100062
push usergbrown@mozilla.com
push dateWed, 21 Feb 2018 17:57:19 +0000
treeherdermozilla-inbound@182c9af3ed1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmythmon, dexter
bugs1433485
milestone60.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 1433485 - Update test prefs for telemetry; r=mythmon,dexter Set pref datareporting.healthreport.uploadEnabled=false during mochitests and set pref toolkit.telemetry.server to a dummy server during reftests (uploadEnabled was already false for reftest and the telemetry server was already set for mochitests - now these prefs are consistent). Some mochitests failed with this change; they are updated to set datareporting.healthreport.uploadEnabled where required.
browser/components/enterprisepolicies/tests/browser/browser_policy_disable_shield.js
browser/extensions/shield-recipe-client/test/browser/browser_RecipeRunner.js
layout/tools/reftest/reftest-preferences.js
testing/profiles/prefs_general.js
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_shield.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_shield.js
@@ -2,17 +2,19 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 add_task(async function test_policy_disable_shield() {
   const { RecipeRunner } = ChromeUtils.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", {});
 
   await SpecialPowers.pushPrefEnv({ set: [["extensions.shield-recipe-client.api_url",
-                                            "https://localhost/selfsupport-dummy/"]] });
+                                            "https://localhost/selfsupport-dummy/"],
+                                          ["datareporting.healthreport.uploadEnabled",
+                                            true]]});
 
   ok(RecipeRunner, "RecipeRunner exists");
   RecipeRunner.checkPrefs();
   is(RecipeRunner.enabled, true, "RecipeRunner is enabled");
 
   await setupPolicyEngineWithJson({
     "policies": {
       "DisableFirefoxStudies": true
--- a/browser/extensions/shield-recipe-client/test/browser/browser_RecipeRunner.js
+++ b/browser/extensions/shield-recipe-client/test/browser/browser_RecipeRunner.js
@@ -336,16 +336,17 @@ decorate_task(
     );
   }
 );
 
 // test init() in dev mode
 decorate_task(
   withPrefEnv({
     set: [
+      ["datareporting.healthreport.uploadEnabled", true],  // telemetry enabled
       ["extensions.shield-recipe-client.dev_mode", true],
       ["extensions.shield-recipe-client.first_run", false],
     ],
   }),
   withStub(RecipeRunner, "run"),
   withStub(RecipeRunner, "registerTimer"),
   async function testInitDevMode(runStub, registerTimerStub, updateRunIntervalStub) {
     await RecipeRunner.init();
@@ -353,16 +354,17 @@ decorate_task(
     ok(registerTimerStub.called, "RecipeRunner.init registers a timer");
   }
 );
 
 // Test init() during normal operation
 decorate_task(
   withPrefEnv({
     set: [
+      ["datareporting.healthreport.uploadEnabled", true],  // telemetry enabled
       ["extensions.shield-recipe-client.dev_mode", false],
       ["extensions.shield-recipe-client.first_run", false],
     ],
   }),
   withStub(RecipeRunner, "run"),
   withStub(RecipeRunner, "registerTimer"),
   async function testInit(runStub, registerTimerStub) {
     await RecipeRunner.init();
@@ -370,16 +372,17 @@ decorate_task(
     ok(registerTimerStub.called, "RecipeRunner.init registers a timer");
   }
 );
 
 // Test init() first run
 decorate_task(
   withPrefEnv({
     set: [
+      ["datareporting.healthreport.uploadEnabled", true],  // telemetry enabled
       ["extensions.shield-recipe-client.dev_mode", false],
       ["extensions.shield-recipe-client.first_run", true],
       ["extensions.shield-recipe-client.api_url", "https://example.com"],
     ],
   }),
   withStub(RecipeRunner, "run"),
   withStub(RecipeRunner, "registerTimer"),
   withStub(RecipeRunner, "watchPrefs"),
--- a/layout/tools/reftest/reftest-preferences.js
+++ b/layout/tools/reftest/reftest-preferences.js
@@ -81,16 +81,17 @@ user_pref("dom.allow_XUL_XBL_for_file", 
 user_pref("security.view-source.reachable-from-inner-protocol", true);
 
 // Skip data reporting policy notifications.
 user_pref("datareporting.policy.dataSubmissionPolicyBypassNotification", true);
 
 // Ensure that telemetry is disabled, so we don't connect to the telemetry
 // server in the middle of the tests.
 user_pref("toolkit.telemetry.enabled", false);
+user_pref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy/");
 user_pref("datareporting.healthreport.uploadEnabled", false);
 user_pref("experiments.enabled", false);
 // Likewise for safebrowsing.
 user_pref("browser.safebrowsing.phishing.enabled", false);
 user_pref("browser.safebrowsing.malware.enabled", false);
 user_pref("browser.safebrowsing.blockedURIs.enabled", false);
 user_pref("browser.safebrowsing.passwords.enabled", false);
 user_pref("browser.safebrowsing.downloads.enabled", false);
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -237,16 +237,17 @@ user_pref("browser.contentHandlers.types
 user_pref("browser.contentHandlers.types.1.uri", "http://test1.example.org/rss?url=%%s");
 user_pref("browser.contentHandlers.types.2.uri", "http://test1.example.org/rss?url=%%s");
 user_pref("browser.contentHandlers.types.3.uri", "http://test1.example.org/rss?url=%%s");
 user_pref("browser.contentHandlers.types.4.uri", "http://test1.example.org/rss?url=%%s");
 user_pref("browser.contentHandlers.types.5.uri", "http://test1.example.org/rss?url=%%s");
 
 // We want to collect telemetry, but we don't want to send in the results.
 user_pref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy/");
+user_pref("datareporting.healthreport.uploadEnabled", false);
 // Don't send 'new-profile' ping on new profiles during tests, otherwise the testing framework
 // might wait on the pingsender to finish and slow down tests.
 user_pref("toolkit.telemetry.newProfilePing.enabled", false);
 // Don't send 'bhr' ping during tests, otherwise the testing framework might
 // wait on the pingsender to finish and slow down tests.
 user_pref("toolkit.telemetry.bhrPing.enabled", false);
 // Don't send the 'shutdown' ping using the pingsender on the first session using
 // the 'pingsender' process. Valgrind marks the process as leaky (e.g. see bug 1364068