Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js

Issue 2397003002: Mark children of an SVG root as needing paint invalidation checking on resize. (Closed)
Patch Set: none Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js b/third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
index 2d9d6afd9bad4cf41e8dc5849bb7d2173b30e8ff..12a156144579fd3e56759bdfcea5cdcdfe7cec0f 100644
--- a/third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/resources/text-based-repaint.js
@@ -13,6 +13,8 @@ if (window.internals) {
internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = true;
}
+window.expectedObjectInvalidations = [];
fs 2016/10/06 10:51:49 Maybe document that using this part of the framewo
chrishtr 2016/10/06 16:52:04 Done.
+
function runRepaintTest()
{
if (!window.testRunner || !window.internals) {
@@ -47,6 +49,19 @@ function forceStyleRecalc()
document.documentElement.clientTop;
}
+function checkObjectPaintInvalidations(layersWithInvalidationsText)
+{
+ var layersWithInvalidations = JSON.parse(layersWithInvalidationsText);
+ var objectNameSet = new Set();
+ 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 was not: '" + objectName + "'");
fs 2016/10/06 10:51:49 Nit: ...but it was not ?
chrishtr 2016/10/06 16:52:04 Done.
+ });
+}
+
function finishRepaintTest()
{
if (!window.testRunner || !window.internals)
@@ -63,7 +78,9 @@ function finishRepaintTest()
if (window.outputLayerList)
flags |= window.internals.OUTPUT_CHILDREN_AS_LAYER_LIST;
- var repaintRects = window.internals.layerTreeAsText(document, flags);
+ var layersWithInvalidationsText = window.internals.layerTreeAsText(document, flags);
+
+ checkObjectPaintInvalidations(layersWithInvalidationsText);
internals.stopTrackingRepaints(document);
@@ -72,7 +89,7 @@ function finishRepaintTest()
window.outputRepaintRects = false;
if (window.outputRepaintRects)
- testRunner.setCustomTextOutput(repaintRects);
+ testRunner.setCustomTextOutput(layersWithInvalidationsText);
if (window.afterTest)
window.afterTest();

Powered by Google App Engine
This is Rietveld 408576698