Bug 1470504 - Skip empty paints when looking for the most recent paints in the APZ test data. r=kats
authorBotond Ballo <botond@mozilla.com>
Tue, 18 Sep 2018 15:55:47 -0400
changeset 495310 e5e0f01059c8022ce16d81a49923544f182bb242
parent 495309 8a29d2de3f5b464fddb91ace8da288b05195196c
child 495311 cac83917e2691bf7dfdcc5b97cb21b9b2d5e5c89
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1470504
milestone64.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 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
gfx/layers/apz/test/mochitest/apz_test_utils.js
gfx/layers/apz/test/mochitest/helper_bug1280013.html
--- a/gfx/layers/apz/test/mochitest/apz_test_utils.js
+++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js
@@ -49,16 +49,25 @@ function convertBuckets(buckets) {
 
 function convertTestData(testData) {
   var result = {};
   result.paints = convertBuckets(testData.paints);
   result.repaintRequests = convertBuckets(testData.repaintRequests);
   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
 // APZC tree structure corresponding to the layer subtree for the
 // content process that triggered the paint, is reconstructed (as
 // the APZ test data only contains information abot this subtree).
 function buildApzcTree(paint) {
   // The APZC tree can potentially have multiple root nodes,
--- a/gfx/layers/apz/test/mochitest/helper_bug1280013.html
+++ b/gfx/layers/apz/test/mochitest/helper_bug1280013.html
@@ -42,17 +42,17 @@ function* test(testDriver) {
   SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd", false);
 
   // Flush any pending paints
   yield flushApzRepaints(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]) &&
         (lastPaint[scrollId]['contentDescription'].includes('tall_html'))) {
       var dp = getPropertyAsRect(lastPaint, scrollId, 'displayport');
       ok(dp.y <= 0, 'The displayport top should be less than or equal to zero to cover the visible part of the subframe; it is ' + dp.y);
       ok(dp.y + dp.h >= subframe.clientHeight, 'The displayport bottom should be greater than the clientHeight; it is ' + (dp.y + dp.h));
       foundIt++;