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

Side by Side Diff: third_party/WebKit/LayoutTests/web-animations-api/player-ready-promise.html

Issue 2143533002: Rename player => animation in ready promise test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Diff should show changes Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/LayoutTests/web-animations-api/animation-ready-promise.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4
5 <script>
6 test(function() {
7 var player = document.documentElement.animate([], 100000);
8 assert_true(player.ready instanceof Promise);
9 }, 'The ready attribute should be a Promise');
10
11 async_test(function(t) {
12 var player = document.documentElement.animate([], 100000);
13 player.cancel();
14 player.ready.then(function(p) {
15 t.step(function() {
16 assert_equals(p, player);
17 });
18 t.done();
19 });
20 }, 'The ready promise should be resolved when a player is in the idle play state ');
21
22 test(function() {
23 var player = document.documentElement.animate([], 100000);
24 var promise = player.ready;
25 player.cancel();
26 assert_not_equals(player.ready, promise);
27 }, 'The ready promise should be replaced when the player is cancelled');
28
29 test(function() {
30 var player = document.documentElement.animate([], 100000);
31 player.cancel();
32 var promise = player.ready;
33 player.play();
34 assert_not_equals(player.ready, promise);
35 }, 'The ready promise should be replaced when the player enters the pending stat e');
36
37 async_test(function(t) {
38 var player = document.documentElement.animate([], 100000);
39 player.ready.then(function() {
40 t.step(function() {
41 assert_unreached();
42 });
43 }, function(e) {
44 t.step(function() {
45 assert_equals(e.code, DOMException.ABORT_ERR);
46 });
47 t.done();
48 });
49 player.cancel();
50 }, 'A pending ready promise should be rejected when the player is cancelled');
51
52 async_test(function(t) {
53 var player = document.documentElement.animate([], 100000);
54 var promise = player.ready;
55 promise.then(function(p) {
56 t.step(function() {
57 assert_equals(p, player);
58 assert_equals(player.ready, promise);
59 });
60 t.done();
61 });
62 }, 'A pending ready promise should be resolved and not replaced when the player enters the running state');
63
64 async_test(function(t) {
65 var player = document.documentElement.animate([], 100000);
66 var promise = player.ready;
67 player.finish();
68 promise.then(function(p) {
69 t.step(function() {
70 assert_equals(p, player);
71 assert_equals(player.ready, promise);
72 });
73 t.done();
74 });
75 }, 'A pending ready promise should be resolved and not replaced when the player enters the finished state');
76
77 async_test(function(t) {
78 var player = document.documentElement.animate([], 100000);
79 var promise = player.ready;
80 player.pause();
81 promise.then(function(p) {
82 t.step(function() {
83 assert_equals(p, player);
84 assert_equals(player.ready, promise);
85 });
86 t.done();
87 });
88 }, 'A pending ready promise should be resolved and not replaced when the player enters the paused state');
89 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/web-animations-api/animation-ready-promise.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698