Bug 1305325 - Part 1: Move test cases in file_partial_keyframes.html into file_disable_animations_api_core.html. r?boris draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Sun, 04 Dec 2016 08:07:39 +0900
changeset 447336 247695dc2ec50f18487ac1198bb4164d8429d515
parent 447335 6bdef7ba8b4108a996b9f61ef9f81c5ea6c93017
child 447337 84fd425b9c4440a5c15dde73c2a83f0fd6889903
push id38039
push userhiikezoe@mozilla-japan.org
push dateSat, 03 Dec 2016 23:26:35 +0000
reviewersboris
bugs1305325
milestone53.0a1
Bug 1305325 - Part 1: Move test cases in file_partial_keyframes.html into file_disable_animations_api_core.html. r?boris Missing keyframe will be handled only if the Web Animatins API is enabled. Test cases in file_partial_keyframes.html will not throw any exceptions once we handle missing keyframe because they are run with the Animations API pref, but still we should run the test cases with disabled the pref. So we are now going to move the test cases into file_disable_animations_api_code.html. We can't use KeyframeEffectReadOnly contructor in a new test file since the constructor is also behind the Web Animations API pref. MozReview-Commit-ID: 9ApVxJebBUj
dom/animation/test/mochitest.ini
dom/animation/test/mozilla/file_disable_animations_api_core.html
dom/animation/test/mozilla/file_partial_keyframes.html
dom/animation/test/mozilla/test_partial_keyframes.html
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -39,17 +39,16 @@ support-files =
   document-timeline/file_document-timeline.html
   mozilla/file_cubic_bezier_limits.html
   mozilla/file_deferred_start.html
   mozilla/file_disabled_properties.html
   mozilla/file_disable_animations_api_core.html
   mozilla/file_discrete-animations.html
   mozilla/file_document-timeline-origin-time-range.html
   mozilla/file_hide_and_show.html
-  mozilla/file_partial_keyframes.html
   mozilla/file_spacing_property_order.html
   mozilla/file_transform_limits.html
   mozilla/file_transition_finish_on_compositor.html
   mozilla/file_underlying-discrete-value.html
   mozilla/file_set-easing.html
   style/file_animation-seeking-with-current-time.html
   style/file_animation-seeking-with-start-time.html
   style/file_animation-setting-effect.html
@@ -93,17 +92,16 @@ support-files =
 [document-timeline/test_request_animation_frame.html]
 [mozilla/test_cubic_bezier_limits.html]
 [mozilla/test_deferred_start.html]
 [mozilla/test_disable_animations_api_core.html]
 [mozilla/test_disabled_properties.html]
 [mozilla/test_discrete-animations.html]
 [mozilla/test_document-timeline-origin-time-range.html]
 [mozilla/test_hide_and_show.html]
-[mozilla/test_partial_keyframes.html]
 [mozilla/test_set-easing.html]
 [mozilla/test_spacing_property_order.html]
 [mozilla/test_transform_limits.html]
 [mozilla/test_transition_finish_on_compositor.html]
 skip-if = toolkit == 'android'
 [mozilla/test_underlying-discrete-value.html]
 [style/test_animation-seeking-with-current-time.html]
 [style/test_animation-seeking-with-start-time.html]
--- a/dom/animation/test/mozilla/file_disable_animations_api_core.html
+++ b/dom/animation/test/mozilla/file_disable_animations_api_core.html
@@ -20,11 +20,43 @@ test(function(t) {
   // check that style value is not affected by iterationComposite.
   anim.currentTime = 200 * MS_PER_SEC;
   assert_equals(getComputedStyle(div).marginLeft, '0px',
     'Animated style should not be accumulated when the Web Animations API is ' +
     'not enabled even if accumulate is specified in the constructor');
 }, 'iterationComposite should not affect at all if the Web Animations API ' +
    'is not enabled');
 
+// Tests for cases we don't handle and should throw an exception for in case
+// the Web Animation API is disabled.
+var gTests = [
+  { desc: "single Keyframe with no offset",
+    keyframes: [{ left: "100px" }] },
+  { desc: "multiple Keyframes with missing 0% Keyframe",
+    keyframes: [{ left: "100px", offset: 0.25 },
+                { left: "200px", offset: 0.50 },
+                { left: "300px", offset: 1.00 }] },
+  { desc: "multiple Keyframes with missing 100% Keyframe",
+    keyframes: [{ left: "100px", offset: 0.00 },
+                { left: "200px", offset: 0.50 },
+                { left: "300px", offset: 0.75 }] },
+  { desc: "multiple Keyframes with missing properties on first Keyframe",
+    keyframes: [{ left: "100px", offset: 0.0 },
+                { left: "200px", top: "200px", offset: 0.5 },
+                { left: "300px", top: "300px", offset: 1.0 }] },
+  { desc: "multiple Keyframes with missing properties on last Keyframe",
+    keyframes: [{ left: "100px", top: "200px", offset: 0.0 },
+                { left: "200px", top: "200px", offset: 0.5 },
+                { left: "300px", offset: 1.0 }] },
+];
+
+gTests.forEach(function(subtest) {
+  test(function(t) {
+    var div = addDiv(t);
+    assert_throws("NotSupportedError", function() {
+      div.animate(subtest.keyframes, 100 * MS_PER_SEC);
+    });
+  }, "Element.animate() throws with " + subtest.desc);
+});
+
 done();
 </script>
 </body>
deleted file mode 100644
--- a/dom/animation/test/mozilla/file_partial_keyframes.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!doctype html>
-<meta charset=utf-8>
-<script src="../testcommon.js"></script>
-<body>
-<script>
-'use strict';
-
-// Tests for cases we currently don't handle and should throw an exception for.
-var gTests = [
-  { desc: "single Keyframe with no offset",
-    keyframes: [{ left: "100px" }] },
-  { desc: "multiple Keyframes with missing 0% Keyframe",
-    keyframes: [{ left: "100px", offset: 0.25 },
-                { left: "200px", offset: 0.50 },
-                { left: "300px", offset: 1.00 }] },
-  { desc: "multiple Keyframes with missing 100% Keyframe",
-    keyframes: [{ left: "100px", offset: 0.00 },
-                { left: "200px", offset: 0.50 },
-                { left: "300px", offset: 0.75 }] },
-  { desc: "multiple Keyframes with missing properties on first Keyframe",
-    keyframes: [{ left: "100px", offset: 0.0 },
-                { left: "200px", top: "200px", offset: 0.5 },
-                { left: "300px", top: "300px", offset: 1.0 }] },
-  { desc: "multiple Keyframes with missing properties on last Keyframe",
-    keyframes: [{ left: "100px", top: "200px", offset: 0.0 },
-                { left: "200px", top: "200px", offset: 0.5 },
-                { left: "300px", offset: 1.0 }] },
-];
-
-gTests.forEach(function(subtest) {
-  test(function(t) {
-    var div = addDiv(t);
-    assert_throws("NotSupportedError", function() {
-      new KeyframeEffectReadOnly(div, subtest.keyframes);
-    });
-  }, "KeyframeEffectReadOnly constructor throws with " + subtest.desc);
-});
-
-done();
-</script>
-</body>
deleted file mode 100644
--- a/dom/animation/test/mozilla/test_partial_keyframes.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html>
-<meta charset=utf-8>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<div id="log"></div>
-<script>
-'use strict';
-setup({explicit_done: true});
-SpecialPowers.pushPrefEnv(
-  { "set": [["dom.animations-api.core.enabled", true]]},
-  function() {
-    window.open("file_partial_keyframes.html");
-  });
-</script>