Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion target-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
'test/js/group-constructors.js',
'test/js/group-player.js',
'test/js/group-player-finish-event.js',
'test/js/timeline.js');
'test/js/timeline.js',
'test/js/timing.js');

// This object specifies the source and test files for different Web Animation build targets.
var targetConfig = {
Expand Down
27 changes: 27 additions & 0 deletions test/js/timing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
suite('timing-tests', function() {
setup(function() {
document.timeline._players = [];
});

test('animation iterations', function() {
var anim = new Animation(document.body, [], {
duration: 2000,
iterations: 2,
iterationStart: 0.5
});
assert.equal(anim.activeDuration, 4000);
});

test('group iterations', function() {
var anim = new Animation(document.body, [], {
duration: 2000
});
var group = new AnimationGroup([anim], {
iterations: 2,
iterationStart: 0.5/*,
duration: 2000*/
// note: fails even with explicit duration here, as opposed to 'auto'
});
assert.equal(group.activeDuration, 4000);
});
});