mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Backed out changeset 04420ed3c036 (bug 1127380) for test failures in test_animation-playbackrate.html
--HG-- extra : rebase_source : 45857c89e13300e619084dfac4dd16d73e9984e9
This commit is contained in:
parent
56e2e8ff44
commit
15f7f98688
@ -1,105 +0,0 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<script src="../testcommon.js"></script>
|
||||
<style>
|
||||
div {
|
||||
/* Make it easier to calculate expected values: */
|
||||
animation-timing-function: linear ! important;
|
||||
}
|
||||
|
||||
@keyframes anim {
|
||||
from { margin-left: 100px; }
|
||||
to { margin-left: 200px; }
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
function assert_playbackrate(animation,
|
||||
previousAnimationCurrentTime,
|
||||
previousTimelineCurrentTime,
|
||||
description) {
|
||||
var accuracy = 0.001; /* accuracy of DOMHighResTimeStamp */
|
||||
|
||||
var animationCurrentTimeDifference =
|
||||
animation.currentTime - previousAnimationCurrentTime;
|
||||
var timelineCurrentTimeDifference =
|
||||
animation.timeline.currentTime - previousTimelineCurrentTime;
|
||||
|
||||
assert_approx_equals(animationCurrentTimeDifference,
|
||||
timelineCurrentTimeDifference * animation.playbackRate,
|
||||
accuracy,
|
||||
description);
|
||||
}
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv(test, {'style': 'animation: anim 10s'});
|
||||
var animation = div.getAnimations()[0];
|
||||
|
||||
animation.ready.then(t.step_func_done(function() {
|
||||
animation.currentTime = 7000; // ms
|
||||
animation.playbackRate = 0.5;
|
||||
|
||||
assert_equals(animation.currentTime, 7000,
|
||||
'Reducing Animation.playbackRate should not change the currentTime ' +
|
||||
'of a playing animation');
|
||||
|
||||
animation.playbackRate = 2;
|
||||
|
||||
assert_equals(animation.currentTime, 7000,
|
||||
'Increasing Animation.playbackRate should not change the currentTime ' +
|
||||
'of a playing animation');
|
||||
}));
|
||||
}, 'Test the initial effect of setting playbackRate on currentTime');
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv(test, {'style': 'animation: anim 10s'});
|
||||
var animation = div.getAnimations()[0];
|
||||
|
||||
animation.playbackRate = 10;
|
||||
|
||||
var previousTimelineCurrentTime;
|
||||
var previousAnimationCurrentTime;
|
||||
|
||||
animation.ready.then(function() {
|
||||
previousAnimationCurrentTime = animation.currentTime;
|
||||
previousTimelineCurrentTime = animation.timeline.currentTime;
|
||||
return waitForFrame();
|
||||
}).then(t.step_func_done(function() {
|
||||
assert_playbackrate(animation,
|
||||
previousAnimationCurrentTime,
|
||||
previousTimelineCurrentTime,
|
||||
'animation.currentTime should be 10 times faster than timeline.');
|
||||
}));
|
||||
}, 'Test the effect of setting playbackRate on currentTime');
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv(test, {'style': 'animation: anim 10s'});
|
||||
var animation = div.getAnimations()[0];
|
||||
|
||||
animation.playbackRate = 10;
|
||||
|
||||
var previousTimelineCurrentTime;
|
||||
var previousAnimationCurrentTime;
|
||||
|
||||
animation.ready.then(function() {
|
||||
previousAnimationCurrentTime = animation.currentTime;
|
||||
previousTimelineCurrentTime = animation.timeline.currentTime;
|
||||
|
||||
animation.playbackRate = 1;
|
||||
|
||||
return waitForFrame();
|
||||
}).then(t.step_func_done(function() {
|
||||
assert_equals(animation.playbackRate, 1,
|
||||
'sanity check: animation.playbackRate is still 1.');
|
||||
assert_playbackrate(animation,
|
||||
previousAnimationCurrentTime,
|
||||
previousTimelineCurrentTime,
|
||||
'animation.currentTime should be the same speed as timeline now.');
|
||||
}));
|
||||
}, 'Test the effect of setting playbackRate while playing animation');
|
||||
|
||||
done();
|
||||
</script>
|
||||
</body>
|
@ -1,15 +0,0 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
setup({explicit_done: true});
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{ "set": [["dom.animations-api.core.enabled", true]]},
|
||||
function() {
|
||||
window.open("file_animation-playbackrate.html");
|
||||
});
|
||||
</script>
|
||||
</html>
|
@ -16,9 +16,6 @@ support-files = css-animations/file_animation-finished.html
|
||||
support-files = css-animations/file_animation-pausing.html
|
||||
[css-animations/test_animation-play.html]
|
||||
support-files = css-animations/file_animation-play.html
|
||||
[css-animations/test_animation-playbackrate.html]
|
||||
skip-if = os == 'android'
|
||||
support-files = css-animations/file_animation-playbackrate.html
|
||||
[css-animations/test_animation-playstate.html]
|
||||
support-files = css-animations/file_animation-playstate.html
|
||||
[css-animations/test_animation-ready.html]
|
||||
|
Loading…
x
Reference in New Issue
Block a user