diff --git a/target-config.js b/target-config.js index 72ea2a0..d1a5800 100644 --- a/target-config.js +++ b/target-config.js @@ -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 = { diff --git a/test/js/timing.js b/test/js/timing.js new file mode 100644 index 0000000..561187b --- /dev/null +++ b/test/js/timing.js @@ -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); + }); +});