Bug 1438752 - Summary: Wait for an APZ flush before scrolling to avoid race condition in test. r=rhunt
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 07 Jun 2018 21:01:45 +0000
changeset 421899 b79113fa763b23bea4a94963d87be0115a68e8c9
parent 421898 cdaaa5caac74b15e5a22339095559f71f537af25
child 421900 8b1213f470f4d1081cf6afa08f49e5b16f609d9e
push id65022
push userkgupta@mozilla.com
push dateThu, 07 Jun 2018 23:29:43 +0000
treeherderautoland@b79113fa763b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt
bugs1438752
milestone62.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 1438752 - Summary: Wait for an APZ flush before scrolling to avoid race condition in test. r=rhunt Differential Revision: https://phabricator.services.mozilla.com/D1585
dom/events/test/test_bug946632.html
--- a/dom/events/test/test_bug946632.html
+++ b/dom/events/test/test_bug946632.html
@@ -3,16 +3,17 @@
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=946632
 -->
 <head>
   <title>Test for bug 946632 - propagate mouse-wheel vertical scroll events to container</title>
   <script type="application/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="/tests/gfx/layers/apz/test/mochitest/apz_test_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <style>
     .scrollable {
       overflow: scroll;
       height: 200px;
       width: 200px;
     }
     input {
@@ -136,17 +137,17 @@ function nextTest()
     SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
     SimpleTest.finish();
     return;
   }
   var test = tests[i];
   ++i;
   reset();
 
-  window.waitForAllPaintsFlushed(function() {
+  waitForApzFlushedRepaints(function() {
     prepare(test.check);
 
     sendWheelAndPaint(input, 8, 6, test.event, function() {
       // Do nothing - we wait for the scroll event.
     });
   });
 }