| Index: third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
|
| diff --git a/third_party/WebKit/LayoutTests/fast/repaint/resources/text-based-repaint.js b/third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
|
| similarity index 60%
|
| copy from third_party/WebKit/LayoutTests/fast/repaint/resources/text-based-repaint.js
|
| copy to third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
|
| index 93ce90de5005a2ddfc7aad27197f6a2ab9cb9cbc..ab910edcf9d541f6eaee72494d9ecbb15701598c 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/repaint/resources/text-based-repaint.js
|
| +++ b/third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
|
| @@ -2,6 +2,7 @@
|
| // time.
|
| window.testIsAsync = false;
|
| window.outputRepaintRects = true;
|
| +window.outputLayerList = false;
|
|
|
| // All repaint tests are asynchronous.
|
| if (window.testRunner)
|
| @@ -9,9 +10,13 @@ if (window.testRunner)
|
|
|
| if (window.internals) {
|
| internals.settings.setUseDefaultImageInterpolationQuality(true);
|
| - internals.runtimeFlags.slimmingPaintUnderInvalidationCheckingEnabled = true;
|
| + internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = true;
|
| }
|
|
|
| +// Add string names of objects that should be invalidated here. If you use this feature,
|
| +// you must also include testharness.js.
|
| +window.expectedObjectInvalidations = [];
|
| +
|
| function runRepaintTest()
|
| {
|
| if (!window.testRunner || !window.internals) {
|
| @@ -46,6 +51,21 @@ function forceStyleRecalc()
|
| document.documentElement.clientTop;
|
| }
|
|
|
| +function checkObjectPaintInvalidations(layersWithInvalidationsText)
|
| +{
|
| + var layersWithInvalidations = JSON.parse(layersWithInvalidationsText);
|
| + var objectNameSet = new Set();
|
| + if (layersWithInvalidations["objectPaintInvalidations"]) {
|
| + layersWithInvalidations["objectPaintInvalidations"].forEach(function(obj) {
|
| + objectNameSet.add(obj["object"]);
|
| + });
|
| + }
|
| +
|
| + window.expectedObjectInvalidations.forEach(function(objectName) {
|
| + assert_true(objectNameSet.has(objectName), "Expected object to be invalidated, but it was not: '" + objectName + "'");
|
| + });
|
| +}
|
| +
|
| function finishRepaintTest()
|
| {
|
| if (!window.testRunner || !window.internals)
|
| @@ -59,7 +79,12 @@ function finishRepaintTest()
|
| if (window.layerTreeAsTextAdditionalFlags)
|
| flags |= window.layerTreeAsTextAdditionalFlags;
|
|
|
| - var repaintRects = window.internals.layerTreeAsText(document, flags);
|
| + if (window.outputLayerList)
|
| + flags |= window.internals.OUTPUT_CHILDREN_AS_LAYER_LIST;
|
| +
|
| + var layersWithInvalidationsText = window.internals.layerTreeAsText(document, flags);
|
| +
|
| + checkObjectPaintInvalidations(layersWithInvalidationsText);
|
|
|
| internals.stopTrackingRepaints(document);
|
|
|
| @@ -68,7 +93,7 @@ function finishRepaintTest()
|
| window.outputRepaintRects = false;
|
|
|
| if (window.outputRepaintRects)
|
| - testRunner.setCustomTextOutput(repaintRects);
|
| + testRunner.setCustomTextOutput(layersWithInvalidationsText);
|
|
|
| if (window.afterTest)
|
| window.afterTest();
|
|
|