Bug 1376513 - Fix expected value for serizalization value for text-shadow of mochitest and skip this test case on gecko. r?hiro draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 27 Jun 2017 12:24:42 -0700
changeset 600713 10a79006b7249c237ac4ab5c975fb3b30fc7c6a1
parent 600616 f4e52135d9bdc6ce98bb37b450021445aed894ce
child 635078 522759c3080dac8469984793ebc778c6b7c567dc
push id65854
push userbmo:mantaroh@gmail.com
push dateTue, 27 Jun 2017 19:26:09 +0000
reviewershiro
bugs1376513
milestone56.0a1
Bug 1376513 - Fix expected value for serizalization value for text-shadow of mochitest and skip this test case on gecko. r?hiro MozReview-Commit-ID: CTOGgCiYTeD
dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
dom/animation/test/testcommon.js
--- a/dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
+++ b/dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
@@ -563,31 +563,35 @@ test(function(t) {
 }, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
    'animations with filter properties and missing keyframes');
 
 // Gecko-specific test case: We are specifically concerned here that the
 // computed value for text-shadow and a "none" specified on a keyframe
 // are correctly represented.
 
 test(function(t) {
+  if (isServoEnabled()) {
+    // FIXME : Bug 1374564 : the serialization of text-shadow is wrong on gecko
+    return;
+  }
   var div = addDiv(t);
 
   div.style.textShadow = '1px 1px 2px rgb(0, 0, 0), ' +
                          '0 0 16px rgb(0, 0, 255), ' +
                          '0 0 3.2px rgb(0, 0, 255)';
   div.style.animation = 'anim-text-shadow 100s';
   var frames = getKeyframes(div);
 
   assert_equals(frames.length, 2, "number of frames");
 
   var expected = [
     { offset: 0, computedOffset: 0, easing: "ease",
-      textShadow: "1px 1px 2px 0px rgb(0, 0, 0),"
-                  + " 0px 0px 16px 0px rgb(0, 0, 255),"
-                  + " 0px 0px 3.2px 0px rgb(0, 0, 255)" },
+      textShadow: "1px 1px 2px rgb(0, 0, 0),"
+                  + " 0px 0px 16px rgb(0, 0, 255),"
+                  + " 0px 0px 3.2px rgb(0, 0, 255)" },
     { offset: 1, computedOffset: 1, easing: "ease", textShadow: "none" },
   ];
 
   for (var i = 0; i < frames.length; i++) {
     assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
   }
 }, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
    'animations with text-shadow properties and missing keyframes');
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -335,8 +335,19 @@ function addSVGElement(target, tag, attr
   if (attrs) {
     for (var attrName in attrs) {
       element.setAttributeNS(null, attrName, attrs[attrName]);
     }
   }
   target.appendChild(element);
   return element;
 }
+
+/*
+ * Return true if servo is enabled.
+ */
+function isServoEnabled() {
+  try {
+    return SpecialPowers.getBoolPref('layout.css.servo.enabled');
+  } catch(e) {
+    return false;
+  }
+}