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 240210 2dfcc10c727060da6cd8d0c88c45d1b034b94a37
parent 240209 19a79b7400fe0958f62eb6654867f0a4829a7cf1
child 240211 a83c90ceb41f0ac166fd81a819be602c9dbe63a3
push id58776
push usermfowler@mozilla.com
push dateTue, 21 Apr 2015 16:45:34 +0000
treeherdermozilla-inbound@2dfcc10c7270 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1145439
milestone40.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 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>