Bug 1026323 - Add a test for a transition with a delay running on the compositor; r=dzbarsky

This patch adds a test for transitions with a delay that run on the compositor.
Currently animations (including transitions) are not sent to the compositor
until they reach the end of their delay phase introducing the possibility that
the behavior might differ for animations with or without delays.

This patch adds a simple test for a transition with a delay. It also fixes an
existing bug in the opacity test. Also, it moves the step where the "transition"
property is removed to the end of the test sequence rather than the end of the
opacity test (which previously happened to occur at the end of the test
sequence).
This commit is contained in:
Brian Birtles 2014-06-23 14:10:19 +09:00
parent fd31104744
commit c455b34df0

View File

@ -1944,8 +1944,12 @@ function runAsyncTests() {
OMTAdiv.style.setProperty("transition-timing-function", "linear", "");
addAsyncTransformTests();
addAsyncOpacityTest();
addAsyncDelayTest();
runAllAsyncAnimTests().then(SimpleTest.finish);
runAllAsyncAnimTests().then(function() {
OMTAdiv.style.removeProperty("transition");
SimpleTest.finish();
});
}
function addAsyncTransformTests() {
@ -1996,10 +2000,29 @@ function addAsyncOpacityTest() {
winUtils.advanceTimeAndRefresh(200000);
omta_is_approx(OMTAdiv, "opacity", 0.00001, 2/3, RunningOn.Compositor,
omta_is_approx(OMTAdiv, "opacity", 2/3, 0.00001, RunningOn.Compositor,
"compositor opacity transition at 2/3rds duration");
});
}
OMTAdiv.style.removeProperty("transition");
function addAsyncDelayTest() {
addAsyncAnimTest(function *() {
OMTAdiv.style.setProperty("transition-property", "none", "");
OMTAdiv.style.setProperty("transition-delay", "100s", "");
OMTAdiv.style.setProperty("transition-duration", "200s", "");
OMTAdiv.style.setProperty("transform", "", "");
OMTACs.getPropertyValue("transform");
OMTAdiv.style.setProperty("transition-property", "transform", "");
OMTAdiv.style.setProperty("transform", "translate(100px)", "");
OMTACs.getPropertyValue("transform");
winUtils.advanceTimeAndRefresh(200000);
yield waitForPaints();
omta_is_approx(OMTAdiv, "transform", { tx: 50 }, 0.0001,
RunningOn.Compositor,
"compositor transform transition with delay at 1/2"
+ " duration");
});
}