summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/getAnimations.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/getAnimations.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/getAnimations.html')
-rw-r--r--testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/getAnimations.html91
1 files changed, 91 insertions, 0 deletions
diff --git a/testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/getAnimations.html b/testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/getAnimations.html
new file mode 100644
index 000000000..d96192c9d
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/getAnimations.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Element.getAnimations tests</title>
+<link rel="help" href="http://w3c.github.io/web-animations/#animationeffecttiming">
+<link rel="author" title="Ryo Motozawa" href="mailto:motozawa@mozilla-japan.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../testcommon.js"></script>
+<body>
+<div id="log"></div>
+<script>
+'use strict';
+
+test(function(t) {
+ var div = createDiv(t);
+ var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
+ anim.finish();
+ assert_equals(div.getAnimations().length, 0, 'animation finished');
+ anim.effect.timing.duration += 100000;
+ assert_equals(div.getAnimations()[0], anim, 'set duration 102000');
+ anim.effect.timing.duration = 0;
+ assert_equals(div.getAnimations().length, 0, 'set duration 0');
+ anim.effect.timing.duration = 'auto';
+ assert_equals(div.getAnimations().length, 0, 'set duration \'auto\'');
+}, 'when duration is changed');
+
+test(function(t) {
+ var div = createDiv(t);
+ var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
+
+ anim.effect.timing.endDelay = -3000;
+ assert_equals(div.getAnimations().length, 0,
+ 'set negative endDelay so as endTime is less than currentTime');
+ anim.effect.timing.endDelay = 1000;
+ assert_equals(div.getAnimations()[0], anim,
+ 'set positive endDelay so as endTime is more than currentTime');
+
+ anim.effect.timing.duration = 1000;
+ anim.currentTime = 1500;
+ assert_equals(div.getAnimations().length, 0,
+ 'set currentTime less than endTime');
+ anim.effect.timing.endDelay = -500;
+ anim.currentTime = 400;
+ assert_equals(div.getAnimations()[0], anim,
+ 'set currentTime less than endTime when endDelay is negative value');
+ anim.currentTime = 500;
+ assert_equals(div.getAnimations().length, 0,
+ 'set currentTime same as endTime when endDelay is negative value');
+ anim.currentTime = 1000;
+ assert_equals(div.getAnimations().length, 0,
+ 'set currentTime same as duration when endDelay is negative value');
+}, 'when endDelay is changed');
+
+test(function(t) {
+ var div = createDiv(t);
+ var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
+ anim.finish();
+ assert_equals(div.getAnimations().length, 0, 'animation finished');
+ anim.effect.timing.iterations = 10;
+ assert_equals(div.getAnimations()[0], anim, 'set iterations 10');
+ anim.effect.timing.iterations = 0;
+ assert_equals(div.getAnimations().length, 0, 'set iterations 0');
+ anim.effect.timing.iterations = Infinity;
+ assert_equals(div.getAnimations().length, 1, 'set iterations Infinity');
+}, 'when iterations is changed');
+
+test(function(t) {
+ var div = createDiv(t);
+ var anim = div.animate({ opacity: [ 0, 1 ] },
+ { duration: 1000, delay: 500, endDelay: -500 });
+ assert_equals(div.getAnimations()[0], anim, 'when currentTime 0');
+ anim.currentTime = 500;
+ assert_equals(div.getAnimations()[0], anim, 'set currentTime 500');
+ anim.currentTime = 1000;
+ assert_equals(div.getAnimations().length, 0, 'set currentTime 1000');
+}, 'when currentTime changed in duration:1000, delay: 500, endDelay: -500');
+
+test(function(t) {
+ var div = createDiv(t);
+ var anim = div.animate({ opacity: [ 0, 1 ] },
+ { duration: 1000, delay: -500, endDelay: -500 });
+ assert_equals(div.getAnimations().length, 0, 'when currentTime 0');
+ anim.currentTime = 500;
+ assert_equals(div.getAnimations().length, 0, 'set currentTime 500');
+ anim.currentTime = 1000;
+ assert_equals(div.getAnimations().length, 0, 'set currentTime 1000');
+}, 'when currentTime changed in duration:1000, delay: -500, endDelay: -500');
+
+
+</script>
+</body>