Bug 1302128 - Fix a test so that it actually exercises the APZ layerization codepath it intends to exericse. r?botond
MozReview-Commit-ID: 81iyzNtVFuv
--- 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;