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

Side by Side Diff: third_party/WebKit/LayoutTests/web-animations-api/animation-state-changes-negative-playback-rate.html

Issue 2145453002: Animations: Fix play state changes test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Test play state changes for animations with a negative playback rate</tit le>
4 <link rel="help" href="http://w3c.github.io/web-animations/#play-state">
5 <script src="../imported/wpt/web-animations/testcommon.js"></script>
2 <script src="../resources/testharness.js"></script> 6 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 7 <script src="../resources/testharnessreport.js"></script>
4 8
5 <script> 9 <script>
6 var duration = 100000; 10 var duration = 100000;
7 11
8 function assert_unresolved(value) { 12 function assert_unresolved(value) {
9 assert_equals(value, null); 13 assert_equals(value, null);
10 } 14 }
11 15
(...skipping 26 matching lines...) Expand all
38 42
39 function finishedAnimation() { 43 function finishedAnimation() {
40 var animation = idleAnimation(); 44 var animation = idleAnimation();
41 animation.play(); 45 animation.play();
42 animation.finish(); 46 animation.finish();
43 return animation; 47 return animation;
44 } 48 }
45 49
46 test(function() { 50 test(function() {
47 var animation = idleAnimation(); 51 var animation = idleAnimation();
48 assert_unresolved(animation.startTime); 52 assert_unresolved(animation.startTime);
alancutter (OOO until 2018) 2016/07/12 04:15:11 All these assertions should have descriptions (I e
49 assert_unresolved(animation.currentTime); 53 assert_unresolved(animation.currentTime);
50 assert_equals(animation.playState, 'idle'); 54 assert_equals(animation.playState, 'idle');
51 }, "idle"); 55 }, "idle");
52 56
53 test(function() { 57 test(function() {
54 var animation = pendingStartTimeAnimation(); 58 var animation = pendingStartTimeAnimation();
55 assert_unresolved(animation.startTime); 59 assert_unresolved(animation.startTime);
56 assert_equals(animation.currentTime, duration); 60 assert_equals(animation.currentTime, duration);
57 assert_equals(animation.playState, 'pending'); 61 assert_equals(animation.playState, 'pending');
58 }, "pending startTime"); 62 }, "pending startTime");
59 63
60 test(function() { 64 test(function() {
61 var animation = runningAnimation(); 65 var animation = runningAnimation();
62 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime)); 66 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime));
63 assert_approx_equals(animation.currentTime, duration / 2, 0.000001); 67 assert_times_equal(animation.currentTime, duration / 2);
64 assert_equals(animation.playState, 'running'); 68 assert_equals(animation.playState, 'running');
65 }, "running"); 69 }, "running");
66 70
67 test(function() { 71 test(function() {
68 var animation = pausedAnimation(); 72 var animation = pausedAnimation();
69 assert_unresolved(animation.startTime); 73 assert_unresolved(animation.startTime);
70 assert_equals(animation.currentTime, duration); 74 assert_equals(animation.currentTime, duration);
71 assert_equals(animation.playState, 'paused'); 75 assert_equals(animation.playState, 'paused');
72 }, "paused"); 76 }, "paused");
73 77
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 animation.play(); 201 animation.play();
198 assert_equals(animation.startTime, startTime); 202 assert_equals(animation.startTime, startTime);
199 assert_equals(animation.currentTime, currentTime); 203 assert_equals(animation.currentTime, currentTime);
200 assert_equals(animation.playState, 'running'); 204 assert_equals(animation.playState, 'running');
201 }, "running -> play()"); 205 }, "running -> play()");
202 206
203 test(function() { 207 test(function() {
204 var animation = runningAnimation(); 208 var animation = runningAnimation();
205 animation.pause(); 209 animation.pause();
206 assert_unresolved(animation.startTime); 210 assert_unresolved(animation.startTime);
207 assert_approx_equals(animation.currentTime, duration / 2, 0.000001); 211 assert_times_equal(animation.currentTime, duration / 2);
208 assert_equals(animation.playState, 'pending'); 212 assert_equals(animation.playState, 'pending');
209 }, "running -> pause()"); 213 }, "running -> pause()");
210 214
211 test(function() { 215 test(function() {
212 var animation = runningAnimation(); 216 var animation = runningAnimation();
213 animation.cancel(); 217 animation.cancel();
214 assert_unresolved(animation.startTime); 218 assert_unresolved(animation.startTime);
215 assert_unresolved(animation.currentTime); 219 assert_unresolved(animation.currentTime);
216 assert_equals(animation.playState, 'idle'); 220 assert_equals(animation.playState, 'idle');
217 }, "running -> cancel()"); 221 }, "running -> cancel()");
218 222
219 test(function() { 223 test(function() {
220 var animation = runningAnimation(); 224 var animation = runningAnimation();
221 animation.finish(); 225 animation.finish();
222 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime)); 226 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime));
223 assert_equals(animation.currentTime, 0); 227 assert_equals(animation.currentTime, 0);
224 assert_equals(animation.playState, 'finished'); 228 assert_equals(animation.playState, 'finished');
225 }, "running -> finish()"); 229 }, "running -> finish()");
226 230
227 test(function() { 231 test(function() {
228 var animation = runningAnimation(); 232 var animation = runningAnimation();
229 animation.reverse(); 233 animation.reverse();
230 assert_unresolved(animation.startTime); 234 assert_unresolved(animation.startTime);
231 assert_approx_equals(animation.currentTime, duration / 2, 0.000001); 235 assert_times_equal(animation.currentTime, duration / 2);
232 assert_equals(animation.playState, 'pending'); 236 assert_equals(animation.playState, 'pending');
233 }, "running -> reverse()"); 237 }, "running -> reverse()");
234 238
235 test(function() { 239 test(function() {
236 var animation = runningAnimation(); 240 var animation = runningAnimation();
237 animation.currentTime = 1000; 241 animation.currentTime = 1000;
238 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime)); 242 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime));
239 assert_equals(animation.currentTime, 1000); 243 assert_equals(animation.currentTime, 1000);
240 assert_equals(animation.playState, 'running'); 244 assert_equals(animation.playState, 'running');
241 }, "running -> set currentTime"); 245 }, "running -> set currentTime");
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 }, "finished -> reverse()"); 349 }, "finished -> reverse()");
346 350
347 test(function() { 351 test(function() {
348 var animation = finishedAnimation(); 352 var animation = finishedAnimation();
349 animation.currentTime = 1000; 353 animation.currentTime = 1000;
350 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime)); 354 assert_equals(animation.startTime, document.timeline.currentTime - (animation. playbackRate * animation.currentTime));
351 assert_equals(animation.currentTime, 1000); 355 assert_equals(animation.currentTime, 1000);
352 assert_equals(animation.playState, 'running'); 356 assert_equals(animation.playState, 'running');
353 }, "finished -> set currentTime"); 357 }, "finished -> set currentTime");
354 </script> 358 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698