Bug 879239 - More slack at layout/base/tests/test_bug588174.html. r=bz, a=test-only
authorAvi Halachmi <avihpit@yahoo.com>
Wed, 19 Feb 2014 15:40:23 +0200
changeset 182959 987ec43a7ec55407c0baa6560166a5dbbda1ef03
parent 182958 647c4831e7d16adebbf183016200c4655a1b01b1
child 182960 e8a5cdae1a0e474f2e8d696c868a2d7ca390c19c
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, test-only
bugs879239, 588174
milestone29.0a2
Bug 879239 - More slack at layout/base/tests/test_bug588174.html. r=bz, a=test-only
layout/base/tests/test_bug588174.html
--- a/layout/base/tests/test_bug588174.html
+++ b/layout/base/tests/test_bug588174.html
@@ -17,41 +17,50 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 569520 **/
 SimpleTest.waitForExplicitFinish();
 
 var startNow = Date.now();
 var start = window.mozAnimationStartTime;
-var firstListenerTime;
-var secondListenerTime;
+var firstListenerArg;
+var secondListenerArg;
+var thirdListenerTime;
 
-function secondListener(time) {
-  secondListenerTime = time;
+// callback arg is wallclock from mozRequestAnimationFrame
+function thirdListener(t) {
+  thirdListenerTime = t;
 
   // They really shouldn't be more than 100ms apart, but we can get weird
   // effects on slow machines.  5 minutes is our test timeout, though.
   ok(Math.abs(startNow - start) <= 5 * 60 * 1000, "Bogus animation start time");
-  ok(firstListenerTime >= start, "First listener should fire after start");
-  // FIXME: The timer filtering code makes the refresh driver call back in 0ms
-  // sometimes!
-  ok(secondListenerTime >= firstListenerTime,
+
+  ok(secondListenerArg >= firstListenerArg, // callback args from consecutive unprefixed requestAnimationFrame
      "Second listener should fire after first listener");
+
+  ok(thirdListenerTime >= start, "Third listener should fire after start");
+
   SimpleTest.finish();
 }
-                            
-function firstListener(time) {
-  firstListenerTime = time;
-  mozRequestAnimationFrame(secondListener);
+
+// callback arg is from requestAnimationFrame and comparable to performance.now()
+function secondListener(t) {
+  secondListenerArg = t;
+  mozRequestAnimationFrame(thirdListener);
 }
-                            
+
+function firstListener(t) {
+  firstListenerArg = t;
+  requestAnimationFrame(secondListener);
+}
+
 addLoadEvent(function() {
     setTimeout(function() {
-      mozRequestAnimationFrame(firstListener);
+      requestAnimationFrame(firstListener);
     }, 100);
   });
 
 
 
 
 </script>
 </pre>