forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request web-platform-tests#12 from alancutter/localTime
Upstream effect-of-keyframeeffect-on-getComputedTiming.html from Blink
- Loading branch information
Showing
3 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
web-animations/timing-model/animation-effects/local-time.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>AnimationEffect local time tests</title> | ||
<link rel="help" href="http://w3c.github.io/web-animations/#local-time"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../testcommon.js"></script> | ||
<body> | ||
<script> | ||
'use strict'; | ||
|
||
test(function(t) { | ||
var anim = createDiv(t).animate(null, 10 * MS_PER_SEC); | ||
for (var seconds of [-1, 0, 5, 10, 20]) { | ||
anim.currentTime = seconds * MS_PER_SEC; | ||
assert_equals(anim.effect.getComputedTiming().localTime, seconds * MS_PER_SEC); | ||
} | ||
}, 'Local time is current time for animation effects associated with an animation.'); | ||
|
||
test(function(t) { | ||
var effect = new KeyframeEffect(createDiv(t), null, 10 * MS_PER_SEC); | ||
assert_equals(effect.getComputedTiming().localTime, null); | ||
}, 'Local time is unresolved for animation effects not associated with an animation.'); | ||
|
||
</script> | ||
</body> |