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

Unified Diff: polymer_0.5.0/bower_components/web-animations-js/test/js/timeline.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, 12 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 side-by-side diff with in-line comments
Download patch
Index: polymer_0.5.0/bower_components/web-animations-js/test/js/timeline.js
diff --git a/polymer_0.5.0/bower_components/web-animations-js/test/js/timeline.js b/polymer_0.5.0/bower_components/web-animations-js/test/js/timeline.js
new file mode 100644
index 0000000000000000000000000000000000000000..3ddf9bc201e7e781ad929f42819af6dc4a4bfe4b
--- /dev/null
+++ b/polymer_0.5.0/bower_components/web-animations-js/test/js/timeline.js
@@ -0,0 +1,36 @@
+suite('timeline-tests', function() {
+ setup(function() {
+ document.timeline._players = [];
+ webAnimationsMinifill.timeline._players = [];
+ });
+
+ test('no current players', function() {
+ assert.equal(document.timeline.getAnimationPlayers().length, 0);
+ });
+
+ test('getAnimationPlayers', function() {
+ tick(90);
+ assert.equal(document.timeline.getAnimationPlayers().length, 0);
+ var player = document.body.animate([], {duration: 500, iterations: 1});
+ tick(300);
+ assert.equal(document.timeline.getAnimationPlayers().length, 1);
+
+ var player2 = document.body.animate([], {duration: 1000});
+ assert.equal(document.timeline.getAnimationPlayers().length, 2);
+ tick(800);
+ assert.equal(player.finished, true);
+ assert.equal(document.timeline.getAnimationPlayers().length, 1);
+ tick(2000);
+ assert.equal(document.timeline.getAnimationPlayers().length, 0);
+ });
+
+ test('getAnimationPlayers checks cancelled animation', function() {
+ tick(90);
+ assert.equal(document.timeline.getAnimationPlayers().length, 0);
+ var player = document.body.animate([], {duration: 500, iterations: 1});
+ tick(300);
+ assert.equal(document.timeline.getAnimationPlayers().length, 1);
+ player.cancel();
+ assert.equal(document.timeline.getAnimationPlayers().length, 0);
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698