aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/iterationStart.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/iterationStart.html')
-rw-r--r--tests/wpt/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/iterationStart.html84
1 files changed, 40 insertions, 44 deletions
diff --git a/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/iterationStart.html b/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/iterationStart.html
index ed2d0e097ac..5521f1e8594 100644
--- a/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/iterationStart.html
+++ b/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/iterationStart.html
@@ -1,8 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
-<title>iterationStart tests</title>
-<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-iterationstart">
-<link rel="author" title="Daisuke Akatsuka" href="mailto:daisuke@mozilla-japan.org">
+<title>AnimationEffectTiming.iterationStart</title>
+<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-iterationstart">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
@@ -11,66 +10,63 @@
<script>
'use strict';
-test(function(t) {
- var anim = createDiv(t).animate(null);
+test(t => {
+ const anim = createDiv(t).animate(null);
assert_equals(anim.effect.timing.iterationStart, 0);
-}, 'Test default value');
+}, 'Has the default value 0');
-test(function(t) {
- var div = createDiv(t);
- var anim = div.animate({ opacity: [ 0, 1 ] },
- { iterationStart: 0.2,
- iterations: 1,
- fill: 'both',
- duration: 100,
- delay: 1 });
+test(t => {
+ const div = createDiv(t);
+ const anim = div.animate({ opacity: [ 0, 1 ] },
+ { iterationStart: 0.2,
+ iterations: 1,
+ fill: 'both',
+ duration: 100,
+ delay: 1 });
anim.effect.timing.iterationStart = 2.5;
assert_times_equal(anim.effect.getComputedTiming().progress, 0.5);
assert_equals(anim.effect.getComputedTiming().currentIteration, 2);
-}, 'Test that changing the iterationStart affects computed timing ' +
- 'when backwards-filling');
+}, 'Changing the value updates computed timing when backwards-filling');
-test(function(t) {
- var div = createDiv(t);
- var anim = div.animate({ opacity: [ 0, 1 ] },
- { iterationStart: 0.2,
- iterations: 1,
- fill: 'both',
- duration: 100,
- delay: 0 });
+test(t => {
+ const div = createDiv(t);
+ const anim = div.animate({ opacity: [ 0, 1 ] },
+ { iterationStart: 0.2,
+ iterations: 1,
+ fill: 'both',
+ duration: 100,
+ delay: 0 });
anim.effect.timing.iterationStart = 2.5;
assert_times_equal(anim.effect.getComputedTiming().progress, 0.5);
assert_equals(anim.effect.getComputedTiming().currentIteration, 2);
-}, 'Test that changing the iterationStart affects computed timing ' +
- 'during the active phase');
+}, 'Changing the value updates computed timing during the active phase');
-test(function(t) {
- var div = createDiv(t);
- var anim = div.animate({ opacity: [ 0, 1 ] },
- { iterationStart: 0.2,
- iterations: 1,
- fill: 'both',
- duration: 100,
- delay: 0 });
+test(t => {
+ const div = createDiv(t);
+ const anim = div.animate({ opacity: [ 0, 1 ] },
+ { iterationStart: 0.2,
+ iterations: 1,
+ fill: 'both',
+ duration: 100,
+ delay: 0 });
anim.finish();
anim.effect.timing.iterationStart = 2.5;
assert_times_equal(anim.effect.getComputedTiming().progress, 0.5);
assert_equals(anim.effect.getComputedTiming().currentIteration, 3);
-}, 'Test that changing the iterationStart affects computed timing ' +
- 'when forwards-filling');
+}, 'Changing the value updates computed timing when forwards-filling');
-test(function(t) {
- var div = createDiv(t);
- var anim = div.animate(null);
+test(t => {
+ const div = createDiv(t);
+ const anim = div.animate(null);
for (let invalid of [-1, NaN, Infinity]) {
- assert_throws({ name: 'TypeError' }, function() {
+ assert_throws({ name: 'TypeError' }, () => {
anim.effect.timing.iterationStart = invalid;
- }, 'setting ' + invalid);
- assert_throws({ name: 'TypeError' }, function() {
+ }, `setting ${invalid}`);
+ assert_throws({ name: 'TypeError' }, () => {
div.animate({}, { iterationStart: invalid });
- }, 'animate() with ' + invalid);
+ }, `animate() with ${invalid}`);
}
-}, 'Using invalid values should throw TypeError');
+}, 'Throws when setting invalid values');
</script>
</body>