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.
This commit is contained in:
Geoff Brown 2018-02-21 10:57:04 -07:00
parent 591bd52f5f
commit c86636e65f
4 changed files with 8 additions and 1 deletions

View File

@ -7,7 +7,9 @@ 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();

View File

@ -341,6 +341,7 @@ decorate_task(
decorate_task(
withPrefEnv({
set: [
["datareporting.healthreport.uploadEnabled", true], // telemetry enabled
["extensions.shield-recipe-client.dev_mode", true],
["extensions.shield-recipe-client.first_run", false],
],
@ -358,6 +359,7 @@ decorate_task(
decorate_task(
withPrefEnv({
set: [
["datareporting.healthreport.uploadEnabled", true], // telemetry enabled
["extensions.shield-recipe-client.dev_mode", false],
["extensions.shield-recipe-client.first_run", false],
],
@ -375,6 +377,7 @@ decorate_task(
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"],

View File

@ -86,6 +86,7 @@ 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.

View File

@ -242,6 +242,7 @@ user_pref("browser.contentHandlers.types.5.uri", "http://test1.example.org/rss?u
// 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);