Bug 1252875 - Flush paints before running the test body in test_scroll_subframe_scrollbar.html. r=kats, a=test-only
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 08 Mar 2016 14:33:52 -0500
changeset 323364 86409dd59088ff71bcf9fd5a4bf0013dbd244220
parent 323363 c6437ac497ee249950762c8c2f40b2393e4a1b2f
child 323365 ff51ee15fa46de9a0ed027244f848c9a132628aa
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, test-only
bugs1252875
milestone47.0a2
Bug 1252875 - Flush paints before running the test body in test_scroll_subframe_scrollbar.html. r=kats, a=test-only r=me because we've fixed this issue in multiple tests in exactly the same way. MozReview-Commit-ID: 5NxTNaq6SYa
gfx/layers/apz/test/mochitest/test_scroll_subframe_scrollbar.html
--- a/gfx/layers/apz/test/mochitest/test_scroll_subframe_scrollbar.html
+++ b/gfx/layers/apz/test/mochitest/test_scroll_subframe_scrollbar.html
@@ -1,15 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test scrolling subframe scrollbars</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
+  <script type="application/javascript" src="apz_test_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 <style>
 p {
   width:200px;
   height:200px;
   border:solid 1px black;
 }
 </style>
@@ -98,22 +99,28 @@ function testScrolling(subframe) {
   var oldScrollTop = subframe.scrollTop;
 
   sendWheelAndPaint(subframe, posX, posY, DefaultEvent, function () {
     ok(subframe.scrollTop > oldScrollTop, "subframe should have scrolled");
     SimpleTest.finish();
   });
 }
 
+function startTest() {
+  waitForAllPaints(function() {
+    flushApzRepaints(test);
+  });
+}
+
 window.onload = function() {
   SpecialPowers.pushPrefEnv({
     'set': [['general.smoothScroll', false],
             ['mousewheel.transaction.timeout', 0],
             ['mousewheel.transaction.ignoremovedelay', 0]]
   }, function () {
-    SimpleTest.waitForFocus(test);
+    SimpleTest.waitForFocus(startTest);
   });
 }
 
 SimpleTest.waitForExplicitFinish();
 </script>
 </body>
 </html>