Bug 1026323 - Add a test for a transition with a delay running on the compositor; r=dzbarsky
authorBrian Birtles <birtles@gmail.com>
Mon, 23 Jun 2014 14:10:19 +0900
changeset 189967 e4d2010d17727f1588900a3722b1784f23aa43f9
parent 189966 019fef132f2b520ef58726ae2333d97772ce678c
child 189968 eb5b9d25c1e7c2d2e83e679e2b39e863fc3647fa
push id45224
push userbbirtles@mozilla.com
push dateMon, 23 Jun 2014 05:11:03 +0000
treeherdermozilla-inbound@e4d2010d1772 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdzbarsky
bugs1026323
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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).
layout/style/test/test_transitions_per_property.html
--- a/layout/style/test/test_transitions_per_property.html
+++ b/layout/style/test/test_transitions_per_property.html
@@ -1939,18 +1939,22 @@ function runAsyncTests() {
   // the transition.
   // For the transform tests we simply compare the value on the compositor
   // with the computed value, but for the opacity test we check the absolute
   // value as well.
   OMTAdiv.style.setProperty("transition-duration", "300s", "");
   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() {
   transformTests.forEach(function(test) {
     addAsyncAnimTest(function () { return runTransformTest(test); } );
   });
 }
 
@@ -1991,20 +1995,39 @@ function addAsyncOpacityTest() {
     OMTAdiv.style.setProperty("transition-property", "opacity", "");
     OMTAdiv.style.setProperty("opacity", 1, "");
     OMTACs.getPropertyValue("opacity");
 
     yield waitForPaints();
 
     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");
   });
 }
 
 function isTransformInvertible(transformStr) {
   var computedStr = transformStrToComputedStr(transformStr);
   if (!transformStr)
     return false;
   var matrix = convertTo3dMatrix(computedStr);