Bug 1402219 - Check the length of returned keyframes of getKeyframes(). r?birtles
Otherwise, if getKeyframes() returns an empty array, we don't check each keyframes
at all.
MozReview-Commit-ID: LSBIgetZq2G
--- a/dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
+++ b/dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
@@ -655,16 +655,18 @@ test(function(t) {
'animations with background-size properties and missing keyframes');
test(function(t) {
var div = addDiv(t);
div.style.animation = 'anim-variables 100s';
var frames = getKeyframes(div);
+ assert_equals(frames.length, 2, "number of frames");
+
var expected = [
{ offset: 0, computedOffset: 0, easing: "ease",
transform: "none" },
{ offset: 1, computedOffset: 1, easing: "ease",
transform: "translate(100px, 0px)" },
];
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
@@ -673,16 +675,18 @@ test(function(t) {
'animations with CSS variables as keyframe values');
test(function(t) {
var div = addDiv(t);
div.style.animation = 'anim-variables-shorthand 100s';
var frames = getKeyframes(div);
+ assert_equals(frames.length, 2, "number of frames");
+
var expected = [
{ offset: 0, computedOffset: 0, easing: "ease",
marginBottom: "0px",
marginLeft: "0px",
marginRight: "0px",
marginTop: "0px" },
{ offset: 1, computedOffset: 1, easing: "ease",
marginBottom: "100px",