Bug 1302128 - Fix a test so that it actually exercises the APZ layerization codepath it intends to exericse. r?botond draft
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 12 Sep 2016 11:48:47 -0400
changeset 412667 daa7329e74e00bef67e518c3e5a2b01006710933
parent 412625 1851b78b5a9673ee422f189b92e5f1e86b82a01c
child 531041 ce00150d8c11ddc26467f8d4314aef00e9d0d439
push id29229
push userkgupta@mozilla.com
push dateMon, 12 Sep 2016 15:49:32 +0000
reviewersbotond
bugs1302128
milestone51.0a1
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;