Bug 1145439 (Part 2) - Make test_scroll_event_ordering.html wait for rAF to unthrottle. r=roc
authorSeth Fowler <mark.seth.fowler@gmail.com>
Tue, 21 Apr 2015 09:44:43 -0700
changeset 259162 2dfcc10c727060da6cd8d0c88c45d1b034b94a37
parent 259161 19a79b7400fe0958f62eb6654867f0a4829a7cf1
child 259163 a83c90ceb41f0ac166fd81a819be602c9dbe63a3
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1145439
milestone40.0a1
Bug 1145439 (Part 2) - Make test_scroll_event_ordering.html wait for rAF to unthrottle. r=roc
layout/base/tests/test_scroll_event_ordering.html
--- a/layout/base/tests/test_scroll_event_ordering.html
+++ b/layout/base/tests/test_scroll_event_ordering.html
@@ -42,15 +42,22 @@ function onScroll() {
 
 function doTest() {
   window.getSelection().collapse(inner.firstChild, 0);
   window.mozRequestAnimationFrame(onFrame);
   d.onscroll = onScroll;
   sendKey("DOWN");
 }
 
-SimpleTest.waitForFocus(function() {
-  SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, doTest);
-});
+function prepareTest() {
+  // Start the test after we've gotten at least one rAF callback, to make sure
+  // that rAF is no longer throttled. (See bug 1145439.)
+  window.mozRequestAnimationFrame(function() {
+    SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, doTest);
+  });
+}
+
+SimpleTest.waitForFocus(prepareTest);
+
 </script>
 </pre>
 </body>
 </html>