From 67bc5d736747a248141e5dcb27a8a02a935737ac Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Fri, 13 Mar 2020 19:59:41 +0000 Subject: [PATCH] Bug 1617427 - Add a test for the scenario being fixed. r=botond Differential Revision: https://phabricator.services.mozilla.com/D66428 --HG-- extra : moz-landing-system : lando --- .../apz/test/mochitest/apz_test_utils.js | 24 ++++ .../helper_checkerboard_apzforcedisabled.html | 104 ++++++++++++++++++ gfx/layers/apz/test/mochitest/mochitest.ini | 1 + .../mochitest/test_group_checkerboarding.html | 34 ++++++ 4 files changed, 163 insertions(+) create mode 100644 gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html create mode 100644 gfx/layers/apz/test/mochitest/test_group_checkerboarding.html diff --git a/gfx/layers/apz/test/mochitest/apz_test_utils.js b/gfx/layers/apz/test/mochitest/apz_test_utils.js index 25fc2513d9a0..2b632e1ae2ed 100644 --- a/gfx/layers/apz/test/mochitest/apz_test_utils.js +++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js @@ -198,6 +198,30 @@ function isLayerized(elementId) { return false; } +// Return a rect (or null) that holds the last known content-side displayport +// for a given element. (The element selection works the same way, and with +// the same assumptions as the isLayerized function above). +function getLastContentDisplayportFor(elementId) { + var contentTestData = SpecialPowers.getDOMWindowUtils( + window + ).getContentAPZTestData(); + var nonEmptyBucket = getLastNonemptyBucket(contentTestData.paints); + ok(nonEmptyBucket != null, "expected at least one nonempty paint"); + var seqno = nonEmptyBucket.sequenceNumber; + contentTestData = convertTestData(contentTestData); + var paint = contentTestData.paints[seqno]; + for (var scrollId in paint) { + if ("contentDescription" in paint[scrollId]) { + if (paint[scrollId].contentDescription.includes(elementId)) { + if ("displayport" in paint[scrollId]) { + return parseRect(paint[scrollId].displayport); + } + } + } + } + return null; +} + // Return a promise that is resolved on the next rAF callback function waitForFrame() { return new Promise(resolve => { diff --git a/gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html b/gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html new file mode 100644 index 000000000000..96a895e9a4ff --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html @@ -0,0 +1,104 @@ + + + + + + Checkerboarding while root scrollframe async-scrolls and a + subframe has APZ force disabled + + + + + + + +
+
+
+
+ + diff --git a/gfx/layers/apz/test/mochitest/mochitest.ini b/gfx/layers/apz/test/mochitest/mochitest.ini index 76480c5c5e96..b70d9c73ddf4 100644 --- a/gfx/layers/apz/test/mochitest/mochitest.ini +++ b/gfx/layers/apz/test/mochitest/mochitest.ini @@ -68,3 +68,4 @@ [test_group_zoomToFocusedInput.html] [test_group_scroll_snap.html] skip-if = (os == 'android') # wheel events not supported on mobile +[test_group_checkerboarding.html] diff --git a/gfx/layers/apz/test/mochitest/test_group_checkerboarding.html b/gfx/layers/apz/test/mochitest/test_group_checkerboarding.html new file mode 100644 index 000000000000..30c95da5c0e4 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/test_group_checkerboarding.html @@ -0,0 +1,34 @@ + + + + + + + + + + + +