-
Notifications
You must be signed in to change notification settings - Fork 29
added timing constructor test #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
6a55d47
c5821ba
f6e1dd2
60c8702
fe27436
0ac11ea
21c2ea9
c978019
a01ea58
64e0140
68dba03
0eb0ef5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| suite('timing-tests', function() { | ||
| setup(function() { | ||
| document.timeline._players = []; | ||
| }); | ||
|
|
||
| test('changing timing iterations mid-animation', function() { | ||
| var animation = new Animation(document.body, [], { duration: 1000 }); | ||
|
|
||
| // TODO: access internal _timing for now, until .timing is properly generated | ||
| var timing = animation._timing; | ||
|
|
||
| assert.equal(timing.duration, 1000); | ||
| assert.equal(timing.iterations, 1.0); | ||
|
|
||
| var player = document.timeline.play(animation); | ||
| assert(!player.paused); | ||
| assert.equal(player.currentTime, 0); | ||
| tick(300); | ||
| assert.equal(player.startTime, 300); // why does this pass? the anim is running? | ||
| assert.equal(player.currentTime, 300, 'after 300ms tick, currentTime should be 300ms'); // this fails -- what, what? | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The animation was pending until 300, I'd expect that it's currentTime is actually 0 in this case?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After all, it's start time is 300 per line 19.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've fixed this behaviour with feedback on how tick works. The test is still broken though :) |
||
|
|
||
| timing.iterations = 0.5; | ||
| animation.timing.iterations = 0.5; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI these don't work because we don't yet support these maxifill feature (exposed timing, modifiable timing). They're not on the roadmap for the m39 release. |
||
| tick(300); | ||
| assert.equal(player.currentTime, 500); | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timing.jsis a minifill test, but the Animation constructor is only in the maxifill.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed