зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1429153 - Add policy for disabling telemetry. r=Felipe
MozReview-Commit-ID: 6fGGuJzZUhU --HG-- extra : rebase_source : bdbcd6837879231a85b9e87ef694032a3bf89c2a
This commit is contained in:
Родитель
057d540744
Коммит
fd746e9933
|
@ -233,6 +233,15 @@ var Policies = {
|
|||
}
|
||||
},
|
||||
|
||||
"DisableTelemetry": {
|
||||
onBeforeAddons(manager, param) {
|
||||
if (param) {
|
||||
setAndLockPref("datareporting.healthreport.uploadEnabled", false);
|
||||
setAndLockPref("datareporting.policy.dataSubmissionEnabled", false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"DisplayBookmarksToolbar": {
|
||||
onBeforeUIStartup(manager, param) {
|
||||
let value = (!param).toString();
|
||||
|
|
|
@ -185,6 +185,14 @@
|
|||
"type": "boolean"
|
||||
},
|
||||
|
||||
"DisableTelemetry": {
|
||||
"description": "Turns off telemetry.",
|
||||
"first_available": "60.0",
|
||||
"enterprise_only": true,
|
||||
|
||||
"type": "boolean"
|
||||
},
|
||||
|
||||
"DisplayBookmarksToolbar": {
|
||||
"description": "Causes the bookmarks toolbar to be displayed by default.",
|
||||
"first_available": "60.0",
|
||||
|
|
|
@ -34,6 +34,7 @@ support-files =
|
|||
[browser_policy_disable_privatebrowsing.js]
|
||||
[browser_policy_disable_safemode.js]
|
||||
[browser_policy_disable_shield.js]
|
||||
[browser_policy_disable_telemetry.js]
|
||||
[browser_policy_display_bookmarks.js]
|
||||
[browser_policy_display_menu.js]
|
||||
[browser_policy_extensions.js]
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function test_policy_disable_telemetry() {
|
||||
const { TelemetryReportingPolicy } = ChromeUtils.import("resource://gre/modules/TelemetryReportingPolicy.jsm", {});
|
||||
|
||||
ok(TelemetryReportingPolicy, "TelemetryReportingPolicy exists");
|
||||
is(TelemetryReportingPolicy.canUpload(), true, "Telemetry is enabled");
|
||||
|
||||
await setupPolicyEngineWithJson({
|
||||
"policies": {
|
||||
"DisableTelemetry": true
|
||||
}
|
||||
});
|
||||
|
||||
is(TelemetryReportingPolicy.canUpload(), false, "Telemetry is disabled");
|
||||
});
|
Загрузка…
Ссылка в новой задаче