Bug 1302128 - Fix a test so that it actually exercises the APZ layerization codepath it intends to exericse. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 12 Sep 2016 11:48:47 -0400
changeset 313510 9679b6eb4beeb595899447cea1c4e513cb91993a
parent 313509 76d5fdf2aa3d24f254e48820938c1727440a1ae9
child 313511 7b1cb8b0be7caa5e785159bb7c3650079d244303
push id30689
push userkwierso@gmail.com
push dateMon, 12 Sep 2016 23:52:16 +0000
treeherdermozilla-central@7b1cb8b0be7c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1302128
milestone51.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 1302128 - Fix a test so that it actually exercises the APZ layerization codepath it intends to exericse. r=botond MozReview-Commit-ID: 81iyzNtVFuv
gfx/layers/apz/test/mochitest/test_bug1277814.html
--- a/gfx/layers/apz/test/mochitest/test_bug1277814.html
+++ b/gfx/layers/apz/test/mochitest/test_bug1277814.html
@@ -12,25 +12,37 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
     function* test(testDriver) {
       // Trigger the buggy scenario
       var subframe = document.getElementById('bug1277814-div');
       subframe.classList.add('a');
 
+      // The transform change is animated, so let's step through 1s of animation
+      var utils = SpecialPowers.getDOMWindowUtils(window);
+      for (var i = 0; i < 60; i++) {
+        utils.advanceTimeAndRefresh(16);
+      }
+      utils.restoreNormalRefresh();
+
+      // Wait for the layer tree with any updated dispatch-to-content region to
+      // get pushed over to the APZ
+      yield waitForAllPaints(function() {
+        flushApzRepaints(testDriver);
+      });
+
       // Trigger layerization of the subframe by scrolling the wheel over it
-      moveMouseAndScrollWheelOver(subframe, 10, 10, testDriver);
+      yield moveMouseAndScrollWheelOver(subframe, 10, 10, testDriver);
 
       // Give APZ the chance to compute a displayport, and content
       // to render based on it.
       yield waitForApzFlushedRepaints(testDriver);
 
       // Examine the content-side APZ test data
-      var utils = SpecialPowers.getDOMWindowUtils(window);
       var contentTestData = utils.getContentAPZTestData();
 
       // Test that the scroll frame for the div 'bug1277814-div' appears in
       // the APZ test data. The bug this test is for causes the displayport
       // calculation for this scroll frame to go wrong, causing it not to
       // become layerized.
       contentTestData = convertTestData(contentTestData);
       var foundIt = false;