Bug 1465628 part 4 - Update test to check more stuff. r?tromey draft
authorXidorn Quan <me@upsuper.org>
Thu, 31 May 2018 15:54:08 +1000
changeset 803958 05ad81a29f7f621e4125d5153d6c8e272b710a6e
parent 803957 31c0364198569aa71d19a00fd55fe69ff4814726
push id112243
push userxquan@mozilla.com
push dateTue, 05 Jun 2018 04:32:37 +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}`);
     }
   }