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
--- 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>