Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / web-animations-api / timeline-set-current-time-playback-rate.html
blob871ba036e00218359117216c09de38068e9b7750
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
5 <!-- This tests that animation timeline current time and playback rate works correctly. -->
7 <script>
8 test(function() {
9 document.timeline.currentTime = 1000;
10 assert_approx_equals(document.timeline.currentTime, 1000, 0.1);
11 assert_equals(document.timeline.playbackRate, 1);
13 document.timeline.playbackRate = 1;
14 document.timeline.currentTime = 2000;
15 assert_approx_equals(document.timeline.currentTime, 2000, 0.1);
16 assert_equals(document.timeline.playbackRate, 1);
18 document.timeline.playbackRate = 0.5;
19 assert_approx_equals(document.timeline.currentTime, 2000, 0.1);
20 document.timeline.currentTime = 3000;
21 assert_approx_equals(document.timeline.currentTime, 3000, 0.1);
22 assert_equals(document.timeline.playbackRate, 0.5);
23 }, 'Current time is set correctly on the animation timeline.');
25 </script>