summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/web-animations-api/timeline-play-animation.html
blob: 01984194076e097445e4e838231b9f1cb80d14d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>

<body>
    <div id='e'></div>
</body>

<script>
var element = document.getElementById('e');
var style = getComputedStyle(element);
var duration = 1;

var keyframeEffect = new KeyframeEffect(element,
    [{opacity: '1', offset: 0},
    {opacity: '0', offset: 1}],
    duration);

test(function() {
    var player = document.timeline.play(keyframeEffect);
    player.pause();
    player.currentTime = duration / 2;
    assert_equals(style.opacity, '0.5');
}, 'Calling document.timeline.play() should start an animation.');
</script>