Skip to content

Commit

Permalink
Upstream mutable-effects.html from Blink (#3332)
Browse files Browse the repository at this point in the history
  • Loading branch information
suzyh authored and birtles committed Mar 3, 2017
1 parent 675bce8 commit 3822eee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions web-animations/interfaces/AnimationEffectTiming/duration.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@
});
}, 'set duration string 100');

promise_test(function(t) {
var anim = createDiv(t).animate(null, 100 * MS_PER_SEC);
return anim.ready.then(function() {
var originalStartTime = anim.startTime;
var originalCurrentTime = anim.currentTime;
assert_equals(anim.effect.getComputedTiming().duration, 100 * MS_PER_SEC,
'Initial duration should be as set on KeyframeEffect');

anim.effect.timing.duration = 200 * MS_PER_SEC;
assert_equals(anim.effect.getComputedTiming().duration, 200 * MS_PER_SEC,
'Effect duration should have been updated');
assert_times_equal(anim.startTime, originalStartTime,
'startTime should be unaffected by changing effect ' +
'duration');
assert_times_equal(anim.currentTime, originalCurrentTime,
'currentTime should be unaffected by changing effect ' +
'duration');
});
}, 'Extending an effect\'s duration does not change the start or current time');

</script>
</body>

0 comments on commit 3822eee

Please sign in to comment.