Bug 1462980 - Use the more robust waitUntilApzStable instead of ad-hoc afterPaint waiting. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D8748

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2018-10-15 17:44:27 +00:00
Родитель c4847c5f16
Коммит fe4f74eb20
1 изменённых файлов: 3 добавлений и 15 удалений

Просмотреть файл

@ -8,6 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141
<meta name="viewport" content="user-scalable=no">
<title>Test for Bug 982141, helper page</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
<script type="application/javascript">
// -------------------------------------------------------------------
@ -15,21 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141
// -------------------------------------------------------------------
var SimpleTest = window.opener.SimpleTest;
window.onload = function() {
window.addEventListener("MozAfterPaint", afterPaint);
};
var utils = SpecialPowers.getDOMWindowUtils(window);
function afterPaint(e) {
// If there is another paint pending, wait for it.
if (utils.isMozAfterPaintPending) {
return;
}
// Once there are no more paints pending, remove the
// MozAfterPaint listener and run the test logic.
window.removeEventListener("MozAfterPaint", afterPaint);
testBug982141();
}
waitUntilApzStable().then(testBug982141);
// --------------------------------------------------------------------
// The actual logic for testing bug 982141.
@ -41,6 +28,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141
function testBug982141() {
// Get the content- and compositor-side test data from nsIDOMWindowUtils.
var utils = SpecialPowers.getDOMWindowUtils(window);
var contentTestData = utils.getContentAPZTestData();
var compositorTestData = utils.getCompositorAPZTestData();