Bug 1522202 - Switch policy sorting test to case insensitive. r=Felipe
authorMichael Kaply <mozilla@kaply.com>
Wed, 23 Jan 2019 19:34:55 +0000
changeset 515184 3d3983a64082f377b60a0ea61c1aeae1ad21845e
parent 515183 d6c453110b21d17c6ce860c95593e524b36f45fc
child 515185 f714be52592b9901a11d2b97a6cb17e5e2ad142e
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1522202
milestone66.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 1522202 - Switch policy sorting test to case insensitive. r=Felipe Differential Revision: https://phabricator.services.mozilla.com/D17403
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/schemas/policies-schema.json
browser/components/enterprisepolicies/tests/browser/browser_policies_sorted_alphabetically.js
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -259,36 +259,16 @@ var Policies = {
           setAndLockPref("network.cookie.lifetimePolicy", newLifetimePolicy);
         } else {
           setDefaultPref("network.cookie.lifetimePolicy", newLifetimePolicy);
         }
       }
     },
   },
 
-  "DNSOverHTTPS": {
-    onBeforeAddons(manager, param) {
-      if ("Enabled" in param) {
-        let mode = param.Enabled ? 2 : 5;
-        if (param.Locked) {
-          setAndLockPref("network.trr.mode", mode);
-        } else {
-          setDefaultPref("network.trr.mode", mode);
-        }
-      }
-      if (param.ProviderURL) {
-        if (param.Locked) {
-          setAndLockPref("network.trr.uri", param.ProviderURL.href);
-        } else {
-          setDefaultPref("network.trr.uri", param.ProviderURL.href);
-        }
-      }
-    },
-  },
-
   "DisableAppUpdate": {
     onBeforeAddons(manager, param) {
       if (param) {
         manager.disallowFeature("appUpdate");
       }
     },
   },
 
@@ -471,16 +451,36 @@ var Policies = {
         // If this policy was alreay applied and the user chose to re-hide the
         // menu bar, do not show it again.
       runOncePerModification("displayMenuBar", value, () => {
         gXulStore.setValue(BROWSER_DOCUMENT_URL, "toolbar-menubar", "autohide", value);
       });
     },
   },
 
+  "DNSOverHTTPS": {
+    onBeforeAddons(manager, param) {
+      if ("Enabled" in param) {
+        let mode = param.Enabled ? 2 : 5;
+        if (param.Locked) {
+          setAndLockPref("network.trr.mode", mode);
+        } else {
+          setDefaultPref("network.trr.mode", mode);
+        }
+      }
+      if (param.ProviderURL) {
+        if (param.Locked) {
+          setAndLockPref("network.trr.uri", param.ProviderURL.href);
+        } else {
+          setDefaultPref("network.trr.uri", param.ProviderURL.href);
+        }
+      }
+    },
+  },
+
   "DontCheckDefaultBrowser": {
     onBeforeUIStartup(manager, param) {
       setAndLockPref("browser.shell.checkDefaultBrowser", false);
     },
   },
 
   "EnableTrackingProtection": {
     onBeforeUIStartup(manager, param) {
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -140,31 +140,16 @@
         },
 
         "Locked": {
           "type": "boolean"
         }
       }
     },
 
-    "DNSOverHTTPS": {
-      "type": "object",
-      "properties": {
-        "Enabled": {
-          "type": "boolean"
-        },
-        "ProviderURL": {
-          "type": "URLorEmpty"
-        },
-        "Locked": {
-          "type": "boolean"
-        }
-      }
-    },
-
     "DisableAppUpdate": {
       "type": "boolean"
     },
 
     "DisableBuiltinPDFViewer": {
       "type": "boolean"
     },
 
@@ -248,16 +233,31 @@
     "DisplayBookmarksToolbar": {
       "type": "boolean"
     },
 
     "DisplayMenuBar": {
       "type": "boolean"
     },
 
+    "DNSOverHTTPS": {
+      "type": "object",
+      "properties": {
+        "Enabled": {
+          "type": "boolean"
+        },
+        "ProviderURL": {
+          "type": "URLorEmpty"
+        },
+        "Locked": {
+          "type": "boolean"
+        }
+      }
+    },
+
     "DontCheckDefaultBrowser": {
       "type": "boolean"
     },
 
     "EnableTrackingProtection": {
       "type": "object",
       "properties": {
         "Value": {
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_sorted_alphabetically.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_sorted_alphabetically.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 function checkArrayIsSorted(array, msg) {
   let sorted = true;
-  let sortedArray = array.slice().sort();
+  let sortedArray = array.slice().sort(function(a, b) { return a.localeCompare(b); });
 
   for (let i = 0; i < array.length; i++) {
     if (array[i] != sortedArray[i]) {
       sorted = false;
       break;
     }
   }
   ok(sorted, msg);