[Web Animations] Update WPT tests and move them to imported/w3c/web-platform-tests
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / web-animations / interfaces / Animation / pending.html
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Animation.pending</title>
4 <link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-pending">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <script src="../../testcommon.js"></script>
8 <body>
9 <div id="log"></div>
10 <script>
11 'use strict';
12
13 promise_test(t => {
14   const div = createDiv(t);
15   const animation = div.animate({}, 100 * MS_PER_SEC);
16
17   assert_true(animation.pending);
18   return animation.ready.then(() => {
19     assert_false(animation.pending);
20   });
21 }, 'reports true -> false when initially played');
22
23 promise_test(t => {
24   const div = createDiv(t);
25   const animation = div.animate({}, 100 * MS_PER_SEC);
26   animation.pause();
27
28   assert_true(animation.pending);
29   return animation.ready.then(() => {
30     assert_false(animation.pending);
31   });
32 }, 'reports true -> false when paused');
33
34 </script>
35 </body>