Bug 1572925 - Make sure that about:support doesn't list the URL decorations pref as an important locked preference; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 15 Aug 2019 12:51:59 +0000
changeset 488319 d13f6714fc1360ca24b6f5daefa1fbeb314d0cc5
parent 488318 1ce7d9bbe7a1bb01a5f4fb57882b5291b5b7f7c2
child 488320 8c98f638d6cd56e34bd1cdb5f7a70da70b5ea199
push id113906
push userncsoregi@mozilla.com
push dateFri, 16 Aug 2019 04:07:24 +0000
treeherdermozilla-inbound@d887276421d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1572925
milestone70.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 1572925 - Make sure that about:support doesn't list the URL decorations pref as an important locked preference; r=baku Differential Revision: https://phabricator.services.mozilla.com/D42019
toolkit/modules/Troubleshoot.jsm
toolkit/modules/tests/browser/browser_Troubleshoot.js
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -109,16 +109,18 @@ const PREFS_GETTERS = {};
 
 PREFS_GETTERS[Ci.nsIPrefBranch.PREF_STRING] = (prefs, name) =>
   prefs.getStringPref(name);
 PREFS_GETTERS[Ci.nsIPrefBranch.PREF_INT] = (prefs, name) =>
   prefs.getIntPref(name);
 PREFS_GETTERS[Ci.nsIPrefBranch.PREF_BOOL] = (prefs, name) =>
   prefs.getBoolPref(name);
 
+const kURLDecorationPref = "privacy.restrict3rdpartystorage.url_decorations";
+
 // Return the preferences filtered by PREFS_BLACKLIST and PREFS_WHITELIST lists
 // and also by the custom 'filter'-ing function.
 function getPrefList(filter) {
   filter = filter || (name => true);
   function getPref(name) {
     let type = Services.prefs.getPrefType(name);
     if (!(type in PREFS_GETTERS)) {
       throw new Error("Unknown preference type " + type + " for " + name);
@@ -379,17 +381,23 @@ var dataProviders = {
     done(data);
   },
 
   modifiedPreferences: function modifiedPreferences(done) {
     done(getPrefList(name => Services.prefs.prefHasUserValue(name)));
   },
 
   lockedPreferences: function lockedPreferences(done) {
-    done(getPrefList(name => Services.prefs.prefIsLocked(name)));
+    // The URL Decoration pref isn't an important locked pref, so there is no
+    // good reason to report it.
+    done(
+      getPrefList(
+        name => name != kURLDecorationPref && Services.prefs.prefIsLocked(name)
+      )
+    );
   },
 
   graphics: function graphics(done) {
     function statusMsgForFeature(feature) {
       // We return an object because in the try-newer-driver case we need to
       // include the suggested version, which the consumer likely needs to plug
       // into a format string from a localization file. Rather than returning
       // a string in some cases and an object in others, return an object always.
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -280,16 +280,17 @@ const SNAPSHOT_SCHEMA = {
     },
     modifiedPreferences: {
       required: true,
       type: "object",
     },
     lockedPreferences: {
       required: true,
       type: "object",
+      properties: {},
     },
     graphics: {
       required: true,
       type: "object",
       properties: {
         numTotalWindows: {
           required: true,
           type: "number",