Bug 1371115 - Part 14: add tests for moz prefixed properties. r?hiro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 05 Jul 2017 13:54:08 +0900
changeset 604017 91af99918e7fbf055272841b588073ec120cff3d
parent 604016 e0bd4ee1969177f43ecb6f65096cfc204e211b42
child 604018 538ed6d35ea2feef436b004dddef730d7026e05d
child 604034 d4d22daa597eaad83b71287b2727e6255b8b7355
child 604035 f525e67d04d2ce9fb3f2fd6f8c16e366c91f6ec1
push id66924
push userbmo:dakatsuka@mozilla.com
push dateWed, 05 Jul 2017 04:54:52 +0000
reviewershiro
bugs1371115
milestone56.0a1
Bug 1371115 - Part 14: add tests for moz prefixed properties. r?hiro Since we implement following properties animatable, append to test. * -moz-border-bottom-colors * -moz-border-left-colors * -moz-border-right-colors * -moz-border-top-colors MozReview-Commit-ID: E3zWaDcRdtE
dom/animation/test/mozilla/test_moz-prefixed-properties.html
--- a/dom/animation/test/mozilla/test_moz-prefixed-properties.html
+++ b/dom/animation/test/mozilla/test_moz-prefixed-properties.html
@@ -9,30 +9,38 @@
 </head>
 <body>
 <div id="log"></div>
 <script>
 "use strict";
 
 const testcases = [
   {
+    property: "-moz-border-bottom-colors",
+  },
+  {
+    property: "-moz-border-left-colors",
+  },
+  {
+    property: "-moz-border-right-colors",
+  },
+  {
+    property: "-moz-border-top-colors",
+  },
+  {
     property: "-moz-box-align"
   },
   {
     property: "-moz-box-direction"
   },
   {
     property: "-moz-box-ordinal-group"
   },
   {
     property: "-moz-box-orient",
-    expectedValueMap: {
-      "block-axis": "vertical",
-      "inline-axis": "horizontal",
-    }
   },
   {
     property: "-moz-box-pack"
   },
   {
     property: "-moz-float-edge"
   },
   {
@@ -79,19 +87,17 @@ testcases.forEach(testcase => {
       container.appendChild(target);
 
       container.style[property.domProp] = value;
 
       const animation =
         target.animate({ [property.domProp]: [value, "inherit"] },
                        { duration: 1000, delay: -500 } );
 
-      const expectedValue =
-        testcase.expectedValueMap && testcase.expectedValueMap[value]
-        ? testcase.expectedValueMap[value] : value;
+      const expectedValue = getComputedStyle(container)[property.domProp];
       assert_equals(getComputedStyle(target)[property.domProp], expectedValue,
                     `Computed style shoud be "${ expectedValue }"`);
     }, `Test inherit value for "${ testcase.property }" `
        + `(Parent element style is "${ value }")`);
   });
 });
 </script>
 </pre>