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

Side by Side Diff: polymer_0.5.0/bower_components/web-animations-js/test/js/timing.js

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 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 suite('timing', function() {
2 setup(function() {
3 webAnimationsMinifill.timeline._players = [];
4 });
5
6 test('pause and scrub', function() {
7 var player = document.body.animate([], { duration: 1000 });
8 player.pause();
9
10 player.currentTime = 500;
11 assert.equal(player.currentTime, 500);
12 });
13
14 test('pause, scrub and play', function() {
15 var target = document.createElement('div');
16 document.body.appendChild(target);
17
18 var player = target.animate([
19 { background: 'blue' },
20 { background: 'red' }
21 ], { duration: 1000 });
22 tick(100);
23 player.pause();
24
25 player.currentTime = 200;
26 // http://www.w3.org/TR/web-animations/#the-current-time-of-a-player
27 // currentTime should now mean 'hold time' - this allows scrubbing.
28 assert.equal(player.currentTime, 200);
29 player.play();
30
31 tick(200);
32 tick(300);
33 assert.equal(player.currentTime, 300);
34 assert.equal(player.startTime, 0);
35 });
36
37 test('sanity-check NaN timing', function() {
38 // This has no actual tests, but will infinite loop without fix.
39
40 var player = document.body.animate([], {
41 duration: 2000,
42 easing: 'ease-in' // fails only with cubic easing, not linear
43 });
44 tick(100);
45 player.currentTime = NaN;
46 tick(200);
47
48 player = document.body.animate([], { duration: NaN, easing: 'ease-out' });
49 tick(300);
50 });
51 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698