Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / web-animations-api / timeline-play-animation.html
blob01984194076e097445e4e838231b9f1cb80d14d9
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
5 <body>
6 <div id='e'></div>
7 </body>
9 <script>
10 var element = document.getElementById('e');
11 var style = getComputedStyle(element);
12 var duration = 1;
14 var keyframeEffect = new KeyframeEffect(element,
15 [{opacity: '1', offset: 0},
16 {opacity: '0', offset: 1}],
17 duration);
19 test(function() {
20 var player = document.timeline.play(keyframeEffect);
21 player.pause();
22 player.currentTime = duration / 2;
23 assert_equals(style.opacity, '0.5');
24 }, 'Calling document.timeline.play() should start an animation.');
25 </script>