Bug 1145439 (Part 2) - Make test_scroll_event_ordering.html wait for rAF to unthrottle. r=roc
--- 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>