Commit 196802e6 authored by enne@chromium.org's avatar enne@chromium.org

FCMify two text-based-repaint tests

A previous patch (https://codereview.chromium.org/252353002) tried to
make all text-based-repaint tests use FCM, but caused flakiness reported
in http://crbug.com/367195 and http://crbug.com/367201.

It seems like the issue is that FCM wasn't being enabled soon enough. It
was turned on post-onload, after which some repaints may have been
generated. (This may no longer be true with repaint-after-layout.)

The fix is to enable FCM with the script include, rather than in
runRepaintTest.

Rather than causing churn on the entire tree, land an FCM version of
text-based-repaint.js and use it in two previous flaky tests. This
should indicate whether or not this was actually the problem.

BUG=368518

Review URL: https://codereview.chromium.org/267553002

git-svn-id: svn://svn.chromium.org/blink/trunk@173040 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7c1ebf8d
(repaint rects
(rect -100 -100 18 18)
(rect 0 0 18 18)
(rect 0 0 18 18)
(rect 18 0 19 18)
(rect 18 0 19 18)
(rect 37 0 18 18)
(rect 37 0 18 18)
(rect -9 18 18 19)
(rect -9 18 18 19)
(rect 9 18 18 19)
(rect 9 18 18 19)
(rect 28 18 18 19)
(rect 28 18 18 19)
(rect 46 18 18 19)
(rect 46 18 18 19)
(rect 0 37 18 18)
(rect 0 37 18 18)
(rect 18 37 19 18)
(rect 18 37 19 18)
(rect 37 37 18 18)
(rect 37 37 18 18)
(rect -100 -100 18 18)
(GraphicsLayer
(bounds 800.00 600.00)
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
(drawsContent 1)
(repaint rects
(rect 0.00 0.00 18.00 18.00)
(rect 0.00 0.00 18.00 18.00)
(rect 18.00 0.00 19.00 18.00)
(rect 18.00 0.00 19.00 18.00)
(rect 37.00 0.00 18.00 18.00)
(rect 37.00 0.00 18.00 18.00)
(rect 0.00 18.00 9.00 19.00)
(rect 0.00 18.00 9.00 19.00)
(rect 9.00 18.00 18.00 19.00)
(rect 9.00 18.00 18.00 19.00)
(rect 28.00 18.00 18.00 19.00)
(rect 28.00 18.00 18.00 19.00)
(rect 46.00 18.00 18.00 19.00)
(rect 46.00 18.00 18.00 19.00)
(rect 0.00 37.00 18.00 18.00)
(rect 0.00 37.00 18.00 18.00)
(rect 18.00 37.00 19.00 18.00)
(rect 18.00 37.00 19.00 18.00)
(rect 37.00 37.00 18.00 18.00)
(rect 37.00 37.00 18.00 18.00)
)
)
)
)
<html>
<head>
<script src="../repaint/resources/text-based-repaint.js"></script>
<script src="../repaint/resources/text-based-repaint-fcm.js"></script>
</head>
<body style="background: url(resources/grid-large.png) no-repeat; background-size: 55px 55px;">
<div id="mask" style="position: absolute; top: -100px; left: -100px;
......
// Asynchronous tests should manually call finishRepaintTest at the appropriate time.
window.testIsAsync = false;
window.outputRepaintRects = true;
if (window.internals)
window.internals.settings.setForceCompositingMode(true)
function runRepaintTest()
{
if (!window.testRunner || !window.internals) {
setTimeout(repaintTest, 100);
return;
}
if (window.enablePixelTesting)
testRunner.dumpAsTextWithPixelResults();
else
testRunner.dumpAsText();
if (window.testIsAsync)
testRunner.waitUntilDone();
forceStyleRecalc();
window.internals.startTrackingRepaints(document);
repaintTest();
if (!window.testIsAsync)
finishRepaintTest();
}
function runRepaintAndPixelTest()
{
window.enablePixelTesting = true;
window.outputRepaintRects = false;
runRepaintTest();
}
function forceStyleRecalc()
{
if (document.body)
document.body.offsetTop;
else if (document.documentElement)
document.documentElement.offsetTop;
}
function finishRepaintTest()
{
// Force a style recalc.
forceStyleRecalc();
var repaintRects = window.internals.layerTreeAsText(document, window.internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
internals.stopTrackingRepaints(document);
if (window.outputRepaintRects) {
if (document.body) {
var root = document.body;
} else if (document.documentElement) {
var root = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject');
document.documentElement.appendChild(root);
}
var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');
// Make this element appear in text dumps, but try to avoid affecting
// output pixels (being visible, creating overflow, &c).
pre.style.opacity = 0;
pre.textContent += repaintRects;
root.appendChild(pre);
}
if (window.afterTest)
window.afterTest();
if (window.testIsAsync)
testRunner.notifyDone();
}
......@@ -16,4 +16,14 @@ PASS feAFunc.getAttribute('slope') is "2"
PASS successfullyParsed is true
TEST COMPLETE
(GraphicsLayer
(bounds 800.00 600.00)
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
(drawsContent 1)
)
)
)
......@@ -3,7 +3,7 @@
<head>
<script src="resources/SVGTestCase.js"></script>
<script src="../../resources/js-test.js"></script>
<script src="../../fast/repaint/resources/text-based-repaint.js"></script>
<script src="../../fast/repaint/resources/text-based-repaint-fcm.js"></script>
</head>
<body onload="runRepaintTest()">
<h1>SVG 1.1 dynamic update tests</h1>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment