Bug 1402170 - Move test for accessing keyframe property order to processing-a-keyframes-argument.html; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Fri, 22 Sep 2017 15:00:15 +0900
changeset 673288 f69ff15e861bc2134f0d521c007322c2576648aa
parent 673287 5ca2a85a9774252a15fcfbf8b3c351ab0e613dbd
child 673289 878ddbafe80ee2e94ca48b537c6fa0029c2f919e
push id82519
push userbmo:bbirtles@mozilla.com
push dateMon, 02 Oct 2017 08:06:17 +0000
reviewershiro
bugs1402170
milestone58.0a1
Bug 1402170 - Move test for accessing keyframe property order to processing-a-keyframes-argument.html; r?hiro MozReview-Commit-ID: 3y6SnzAtNZZ
testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/constructor.html
testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html
--- 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>