Bug 1389439 - Part 1: Use computed values as all expected values. r?hiro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 15 Aug 2017 12:38:41 +0900
changeset 646313 8863d773e10c6ca3d6ec99f8d8e6af072471e208
parent 646219 c1948bdd4b7394581414c691dcea8a07316b29c4
child 646314 d024d7bf7f2b22318b374171a8e3edb1f41128b9
push id74065
push userbmo:dakatsuka@mozilla.com
push dateTue, 15 Aug 2017 03:39:13 +0000
reviewershiro
bugs1389439
milestone57.0a1
Bug 1389439 - Part 1: Use computed values as all expected values. r?hiro The serialization of the value in getKeyframes() on both Gecko and Servo is different, especially 'initial', 'inherit' and 'unset' on discrete animation. Gecko returns those value as is, but Servo returns computed value. We are understanding computed value (Servo) is right, so we change expected values for them. Also, we skip them if this test is running on Gecko. MozReview-Commit-ID: 4GFpCpec0eP
dom/animation/test/mozilla/file_underlying-discrete-value.html
--- a/dom/animation/test/mozilla/file_underlying-discrete-value.html
+++ b/dom/animation/test/mozilla/file_underlying-discrete-value.html
@@ -1,15 +1,17 @@
 <!doctype html>
 <meta charset=utf-8>
 <script src="../testcommon.js"></script>
 <body>
 <script>
 "use strict";
 
+const isGecko = !isStyledByServo();
+
 // Tests that we correctly extract the underlying value when the animation
 // type is 'discrete'.
 const discreteTests = [
   {
     stylesheet: {
       "@keyframes keyframes":
       "from { align-content: flex-start; } to { align-content: flex-end; } "
     },
@@ -18,37 +20,41 @@ const discreteTests = [
       { computedOffset: 1, alignContent: "flex-end" }
     ],
     explanation: "Test for fully-specified keyframes"
   },
   {
     stylesheet: {
       "@keyframes keyframes": "from { align-content: flex-start; }"
     },
-    // The value of 100% should be 'stretch',
-    // but we are not supporting underlying value.
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
     expectedKeyframes: [
       { computedOffset: 0, alignContent: "flex-start" },
-      { computedOffset: 1, alignContent: "unset" }
+      { computedOffset: 1, alignContent: "normal" }
     ],
-    explanation: "Test for 0% keyframe only"
+    explanation: "Test for 0% keyframe only",
+    // The value of 100% should be 'normal',
+    // but we are not supporting underlying value for Gecko.
+    // https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
+    // So, we skip this test case.
+    skip: isGecko
   },
   {
     stylesheet: {
       "@keyframes keyframes": "to { align-content: flex-end; }"
     },
-    // The value of 0% should be 'stretch',
-    // but we are not supporting underlying value.
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
     expectedKeyframes: [
-      { computedOffset: 0, alignContent: "unset" },
+      { computedOffset: 0, alignContent: "normal" },
       { computedOffset: 1, alignContent: "flex-end" }
     ],
-    explanation: "Test for 100% keyframe only"
+    explanation: "Test for 100% keyframe only",
+    // The value of 0% should be 'normal',
+    // but we are not supporting underlying value for Gecko.
+    // https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
+    // So, we skip this test case.
+    skip: isGecko
   },
   {
     stylesheet: {
       "@keyframes keyframes": "50% { align-content: center; }",
       "#target": "align-content: space-between;"
     },
     expectedKeyframes: [
       { computedOffset: 0, alignContent: "space-between" },
@@ -73,26 +79,28 @@ const discreteTests = [
     explanation: "Test for no 0%/100% keyframes " +
                  "and specified style on target element using style attribute"
   },
   {
     stylesheet: {
       "@keyframes keyframes": "50% { align-content: center; }",
       "#target": "align-content: inherit;"
     },
-    // The value of 0%/100% should be 'stretch',
-    // but we are not supporting underlying value.
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
     expectedKeyframes: [
-      { computedOffset: 0, alignContent: "inherit" },
+      { computedOffset: 0, alignContent: "normal" },
       { computedOffset: 0.5, alignContent: "center" },
-      { computedOffset: 1, alignContent: "inherit" }
+      { computedOffset: 1, alignContent: "normal" }
     ],
     explanation: "Test for no 0%/100% keyframes " +
-                 "and 'inherit' specified on target element"
+                 "and 'inherit' specified on target element",
+    // The value of 0%/100% should be 'normal',
+    // but we are not supporting underlying value for Gecko.
+    // https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
+    // So, we skip this test case.
+    skip: isGecko
   },
   {
     stylesheet: {
       "@keyframes keyframes": "50% { align-content: center; }",
       ".target": "align-content: space-between;"
     },
     attributes: {
       class: "target"
@@ -155,16 +163,19 @@ const discreteTests = [
     explanation: "Test for no 0%/100% keyframes " +
                  "and specified style on target element " +
                  "using important type selector that overrides other rules"
   },
 ];
 
 discreteTests.forEach(testcase => {
   test(t => {
+    if (testcase.skip) {
+      return;
+    }
     addStyle(t, testcase.stylesheet);
 
     const div = addDiv(t, { "id": "target" });
     if (testcase.attributes) {
       for (let attributeName in testcase.attributes) {
         div.setAttribute(attributeName, testcase.attributes[attributeName]);
       }
     }