Bug 1402170 - Move test for accessing keyframe property order to processing-a-keyframes-argument.html; r?hiro
MozReview-Commit-ID: 3y6SnzAtNZZ
--- a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/constructor.html
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/constructor.html
@@ -153,36 +153,16 @@ gPropertyIndexedKeyframesTests.forEach(f
var secondEffect =
new KeyframeEffectReadOnly(target, effect.getKeyframes());
assert_frame_lists_equal(secondEffect.getKeyframes(),
effect.getKeyframes());
}, "a KeyframeEffectReadOnly constructed with " + subtest.desc +
" roundtrips");
});
-test(function(t) {
- var expectedOrder = ["composite", "easing", "offset", "left", "marginLeft"];
- var actualOrder = [];
- var kf1 = {};
- var kf2 = { marginLeft: "10px", left: "20px", offset: 1 };
- [{ p: "marginLeft", v: "10px" },
- { p: "left", v: "20px" },
- { p: "offset", v: "0" },
- { p: "easing", v: "linear" },
- { p: "composite", v: "replace" }].forEach(function(e) {
- Object.defineProperty(kf1, e.p, {
- enumerable: true,
- get: function() { actualOrder.push(e.p); return e.v; }
- });
- });
- new KeyframeEffectReadOnly(target, [kf1, kf2]);
- assert_array_equals(actualOrder, expectedOrder, "property access order");
-}, "the KeyframeEffectReadOnly constructor reads keyframe properties in the " +
- "expected order");
-
gKeyframeSequenceTests.forEach(function(subtest) {
test(function(t) {
var effect = new KeyframeEffectReadOnly(target, subtest.input);
assert_frame_lists_equal(effect.getKeyframes(), subtest.output);
}, "a KeyframeEffectReadOnly can be constructed with " + subtest.desc);
test(function(t) {
var effect = new KeyframeEffectReadOnly(target, subtest.input);
--- a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html
@@ -316,14 +316,28 @@ test(function(t) {
const effect = new KeyframeEffect(null, keyframes);
assert_frame_lists_equal(effect.getKeyframes(), [
{offset: null, computedOffset: 0, easing: 'linear', top: '100px'},
{offset: null, computedOffset: 1, easing: 'linear', top: '200px'},
]);
}, 'Only properties defined directly on property-indexed keyframes are read');
-// FIXME: Test that properties are accessed in ascending order by Unicode
-// codepoint
-// (There is an existing test for this in
-// keyframe-effect/constructor.html that should be moved here.)
+test(function(t) {
+ var expectedOrder = ['composite', 'easing', 'offset', 'left', 'marginLeft'];
+ var actualOrder = [];
+ var kf1 = {};
+ var kf2 = { marginLeft: '10px', left: '20px', offset: 1 };
+ [ { p: 'marginLeft', v: '10px' },
+ { p: 'left', v: '20px' },
+ { p: 'offset', v: '0' },
+ { p: 'easing', v: 'linear' },
+ { p: 'composite', v: 'replace' } ].forEach(function(e) {
+ Object.defineProperty(kf1, e.p, {
+ enumerable: true,
+ get: function() { actualOrder.push(e.p); return e.v; }
+ });
+ });
+ new KeyframeEffect(target, [kf1, kf2]);
+ assert_array_equals(actualOrder, expectedOrder, 'property access order');
+}, 'Properties are read in ascending order by Unicode codepoint');
</script>