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:
Brian Birtles 2015-01-09 07:57:58 +09:00
parent 8c62400016
commit d6583c1dfb
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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");