Bug 1465628 part 4 - Update test to check more stuff. r=tromey
authorXidorn Quan <me@upsuper.org>
Thu, 31 May 2018 15:54:08 +1000
changeset 804137 425391ffe743954234da00734d1f86e784c730e5
parent 804136 2ce03f7e1d5b01788d612f8b7a5b625f93fbe167
child 804138 607a37a3553f05f0d0ebfd194caa238e6b0640f2
push id112312
push userbmo:standard8@mozilla.com
push dateTue, 05 Jun 2018 16:07:56 +0000
reviewerstromey
bugs1465628
milestone62.0a1
Bug 1465628 part 4 - Update test to check more stuff. r=tromey This change adds a preferences check based on the change before. It also removes the skipping of "all" because we generate subproperties of "all" shorthand in a platform-neutral way. That list shouldn't be affected by any preference. MozReview-Commit-ID: LJyxGXJxvfW
devtools/shared/css/generated/properties-db.js
devtools/shared/tests/unit/test_css-properties-db.js
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -2963,16 +2963,24 @@ exports.CSS_PROPERTIES = {
       "-webkit-text-fill-color",
       "-webkit-text-stroke-color",
       "-webkit-text-stroke-width",
       "ruby-align",
       "ruby-position",
       "text-combine-upright",
       "text-rendering",
       "-moz-control-character-visibility",
+      "cursor",
+      "pointer-events",
+      "-moz-user-input",
+      "-moz-user-modify",
+      "-moz-user-focus",
+      "caret-color",
+      "scrollbar-face-color",
+      "scrollbar-track-color",
       "list-style-position",
       "list-style-type",
       "list-style-image",
       "quotes",
       "-moz-image-region",
       "margin-top",
       "margin-right",
       "margin-bottom",
@@ -2984,22 +2992,16 @@ exports.CSS_PROPERTIES = {
       "-moz-outline-radius-topright",
       "-moz-outline-radius-bottomright",
       "-moz-outline-radius-bottomleft",
       "outline-offset",
       "padding-top",
       "padding-right",
       "padding-bottom",
       "padding-left",
-      "cursor",
-      "pointer-events",
-      "-moz-user-input",
-      "-moz-user-modify",
-      "-moz-user-focus",
-      "caret-color",
       "top",
       "right",
       "bottom",
       "left",
       "z-index",
       "flex-direction",
       "flex-wrap",
       "justify-content",
@@ -9253,16 +9255,24 @@ exports.PREFERENCES = [
     "scroll-snap-type-x",
     "layout.css.scroll-snap.enabled"
   ],
   [
     "scroll-snap-type-y",
     "layout.css.scroll-snap.enabled"
   ],
   [
+    "scrollbar-face-color",
+    "layout.css.scrollbar-colors.enabled"
+  ],
+  [
+    "scrollbar-track-color",
+    "layout.css.scrollbar-colors.enabled"
+  ],
+  [
     "shape-image-threshold",
     "layout.css.shape-outside.enabled"
   ],
   [
     "shape-margin",
     "layout.css.shape-outside.enabled"
   ],
   [
--- a/devtools/shared/tests/unit/test_css-properties-db.js
+++ b/devtools/shared/tests/unit/test_css-properties-db.js
@@ -31,36 +31,34 @@ function run_test() {
                                  "assertion run `mach devtools-css-db` to re-generate " +
                                  "the client side properties.";
 
   // Check that the platform and client match for pseudo elements.
   deepEqual(PSEUDO_ELEMENTS, InspectorUtils.getCSSPseudoElementNames(),
             "The pseudo elements match on the client and platform. " +
             propertiesErrorMessage);
 
+  const prefs = InspectorUtils.getCSSPropertyPrefs();
+  deepEqual(PREFERENCES, prefs.map(({name, pref}) => [name, pref]),
+            "The preferences match on the client and platform. " +
+            propertiesErrorMessage);
+
   /**
    * Check that the platform and client match for the details on their CSS properties.
    * Enumerate each property to aid in debugging. Sometimes these properties don't
    * completely agree due to differences in preferences. Check the currently set
    * preference for that property to see if it's enabled.
    */
   const platformProperties = generateCssProperties();
 
   for (const propertyName in CSS_PROPERTIES) {
     const platformProperty = platformProperties[propertyName];
     const clientProperty = CSS_PROPERTIES[propertyName];
     const deepEqual = isJsonDeepEqual(platformProperty, clientProperty);
 
-    // The "all" property can contain information that can be turned on and off by
-    // preferences. These values can be different between OSes, so ignore the equality
-    // check for this property, since this is likely to fail.
-    if (propertyName === "all") {
-      continue;
-    }
-
     if (deepEqual) {
       ok(true, `The static database and platform match for "${propertyName}".`);
     } else {
       ok(false, `The static database and platform do not match for ` + `
         "${propertyName}". ${propertiesErrorMessage}`);
     }
   }