Bug 1470504 - Skip empty paints when looking for the most recent paints in the APZ test data. r=kats

Retained displaylists can produce empty paints, which wasn't the case before.

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

--HG--
extra : rebase_source : a7cce68d6cde3f11aa838609586fd939d428650b
extra : histedit_source : d4e490a445daf01db5ba87185cd0461095f003d7
This commit is contained in:
Botond Ballo 2018-09-18 15:55:47 -04:00
Родитель 7e073d817f
Коммит 4f64e06640
2 изменённых файлов: 10 добавлений и 1 удалений

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

@ -54,6 +54,15 @@ function convertTestData(testData) {
return result;
}
function getLastNonemptyBucket(buckets) {
for (var i = buckets.length - 1; i >= 0; --i) {
if (buckets[i].scrollFrames.length > 0) {
return buckets[i];
}
}
return null;
}
// Given APZ test data for a single paint on the compositor side,
// reconstruct the APZC tree structure from the 'parentScrollId'
// entries that were logged. More specifically, the subset of the

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

@ -47,7 +47,7 @@ function* test(testDriver) {
// get the displayport for the subframe
var utils = SpecialPowers.getDOMWindowUtils(window);
var contentPaints = utils.getContentAPZTestData().paints;
var lastPaint = convertScrollFrameData(contentPaints[contentPaints.length - 1].scrollFrames);
var lastPaint = convertScrollFrameData(getLastNonemptyBucket(contentPaints).scrollFrames);
var foundIt = 0;
for (var scrollId in lastPaint) {
if (('contentDescription' in lastPaint[scrollId]) &&