mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
Bug 1112480 part 1 - Adjust tests to accommodate changed animation start behavior; r=jwatt
In this patch series we adjust the behavior of animation starting so that the animation does not actually start until the following refresh driver tick. This requires some tweaks to tests to ensure they continue to pass.
This commit is contained in:
parent
de5004bdd2
commit
c6ebd438ae
@ -60,7 +60,10 @@ async_test(function(t) {
|
||||
assert_unreached('ready promise was rejected');
|
||||
});
|
||||
|
||||
}).then(waitForFrame).then(t.step_func(function() {
|
||||
// We need to wait for up to two frames since the animation may not start
|
||||
// until the beginning of the next refresh driver tick and it won't queue
|
||||
// the ready Promise callback until that point.
|
||||
}).then(waitForFrame).then(waitForFrame).then(t.step_func(function() {
|
||||
assert_true(promiseCallbackDone,
|
||||
'ready promise callback was called before the next'
|
||||
+ ' requestAnimationFrame callback');
|
||||
@ -71,7 +74,7 @@ async_test(function(t) {
|
||||
// Test that compositor animations with delays get synced correctly
|
||||
//
|
||||
// NOTE: It is important that we DON'T use
|
||||
// SpecialWindows.DOMWindowUtils.advanceTimeAndRefresh here since that takes
|
||||
// SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh here since that takes
|
||||
// us through a different code path.
|
||||
async_test(function(t) {
|
||||
// This test only applies to compositor animations
|
||||
|
@ -27,10 +27,11 @@
|
||||
*/
|
||||
function test1() {
|
||||
var animdiv = document.createElement("div");
|
||||
// Take control of the refresh driver right from the start
|
||||
advance_clock(0);
|
||||
animdiv.style.animation = "slide-left 100s linear"; // 10px per second
|
||||
gDisplay.appendChild(animdiv);
|
||||
var cs = getComputedStyle(animdiv, "");
|
||||
advance_clock(0);
|
||||
is(cs.marginLeft, "-1000px", "initial value of animation (force flush)");
|
||||
advance_clock(1000);
|
||||
is(cs.marginLeft, "-990px", "value of animation before font load");
|
||||
|
Loading…
x
Reference in New Issue
Block a user