Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/animation/playState.html

Issue 1899623002: Import latest web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle new failures Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Animation.playState</title>
4 <link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-plays tate">
5 <script src="../../../../resources/testharness.js"></script>
6 <script src="../../../../resources/testharnessreport.js"></script>
7 <script src="../testcommon.js"></script>
8 <link rel="stylesheet" href="../../../../resources/testharness.css">
9 <body>
10 <div id="log"></div>
11 <script>
12 'use strict';
13
14 promise_test(function(t) {
15 var div = createDiv(t);
16 var animation = div.animate({}, 100 * MS_PER_SEC);
17
18 assert_equals(animation.playState, 'pending');
19 return animation.ready.then(function() {
20 assert_equals(animation.playState, 'running');
21 });
22 }, 'Animation.playState reports \'pending\'->\'running\' when initially ' +
23 'played');
24
25 promise_test(function(t) {
26 var div = createDiv(t);
27 var animation = div.animate({}, 100 * MS_PER_SEC);
28 animation.pause();
29
30 assert_equals(animation.playState, 'pending');
31 return animation.ready.then(function() {
32 assert_equals(animation.playState, 'paused');
33 });
34 }, 'Animation.playState reports \'pending\'->\'paused\' when pausing');
35
36 test(function(t) {
37 var div = createDiv(t);
38 var animation = div.animate({}, 100 * MS_PER_SEC);
39 animation.cancel();
40 assert_equals(animation.playState, 'idle');
41 }, 'Animation.playState is \'idle\' when canceled.');
42
43 test(function(t) {
44 var div = createDiv(t);
45 var animation = div.animate({}, 100 * MS_PER_SEC);
46 animation.cancel();
47 animation.currentTime = 50 * MS_PER_SEC;
48 assert_equals(animation.playState, 'paused',
49 'After seeking an idle animation, it is effectively paused');
50 }, 'Animation.playState is \'paused\' after cancelling an animation, ' +
51 'seeking it makes it paused');
52
53 </script>
54 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698