Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / web-animations-api / w3c / get-css-players.html
blob9340fc5c3cae44d169c3f7301a0f9abddb6f27d2
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script><style>
4 @keyframes test {
5 from { opacity: 0; }
6 to { opacity: 1; }
8 .cssAnimation {
9 animation: test 2s;
11 </style>
12 <div id='container'>
13 <div id='element'></div>
14 </div>
16 <script>
17 async_test(function(t) {
18 assert_equals(document.timeline.getAnimations().length, 0);
19 assert_equals(container.getAnimations().length, 0);
20 assert_equals(element.getAnimations().length, 0);
22 element.className = 'cssAnimation';
23 onload = function () {
24 t.step(function() {
25 var animations = document.timeline.getAnimations();
26 assert_equals(animations.length, 1);
27 assert_equals(container.getAnimations().length, 0);
28 assert_equals(element.getAnimations().length, 1);
30 animations[0].finish();
31 assert_equals(document.timeline.getAnimations().length, 0);
32 assert_equals(container.getAnimations().length, 0);
33 assert_equals(element.getAnimations().length, 0);
34 t.done();
35 });
37 }, 'getAnimations() with cssanimations');
39 </script>