Fix fast/repaint/block-layout-inline-children-replaced.html

The test was loading an image but didn't wait for the image
to fully load to get all the invalidations generated. The
extra 2 invalidations come from the image (92 x 100)
and its container (402 x 100).

The fix involves allowing our invalidation harness to
run asynchronously. While touching the code, removed
some unneeded window-prefix.

BUG=313447
R=jamesr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@168491 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2a198c0b
......@@ -836,6 +836,8 @@ crbug.com/339394 [ Win Debug ] virtual/threaded/animations/animation-matrix-nega
crbug.com/339592 media/track/opera/interfaces/TextTrackList/onaddtrack.html [ Pass Crash ]
crbug.com/339597 http/tests/navigation/back-to-redirect-with-frame.php [ Pass Timeout ]
crbug.com/313447 [ Mac ] fast/repaint/block-layout-inline-children-replaced.html [ NeedsRebaseline ]
# Disable failing tests for the new WebSocket implementation
crbug.com/339373 http/tests/security/contentSecurityPolicy/connect-src-websocket-allowed.html [ Skip ]
crbug.com/339373 http/tests/websocket/FIXME-handshake-fail-by-null-subprotocol-selection-whitelist.html [ Skip ]
......
......@@ -11,15 +11,19 @@
</head>
<body style="margin: 0;" onload="runRepaintTest()">
<script src="resources/text-based-repaint.js"></script>
<script>
window.testIsAsync = true;
function repaintTest()
{
document.getElementById("target").innerHTML +=
var target = document.getElementById("target");
target.innerHTML +=
'<img style="height: 100px;" src="resources/apple.jpg" >';
target.firstChild.addEventListener("load", finishRepaintTest, false);
}
</script>
<script src="resources/text-based-repaint.js"></script>
<p>This is a test for regression against <a href="https://bugs.webkit.org/show_bug.cgi?id=40142">https://bugs.webkit.org/show_bug.cgi?id=40142</a></p>
......
// Asynchronous tests should manually call finishRepaintTest at the appropriate time.
window.testIsAsync = false;
function runRepaintTest()
{
if (window.testRunner && window.internals) {
if (window.enablePixelTesting)
window.testRunner.dumpAsTextWithPixelResults();
else
window.testRunner.dumpAsText();
if (!window.testRunner || !window.internals) {
setTimeout(repaintTest, 100);
return;
}
if (document.body)
document.body.offsetTop;
else if (document.documentElement)
document.documentElement.offsetTop;
if (window.enablePixelTesting)
testRunner.dumpAsTextWithPixelResults();
else
testRunner.dumpAsText();
window.internals.startTrackingRepaints(document);
if (window.testIsAsync)
testRunner.waitUntilDone();
repaintTest();
if (document.body)
document.body.offsetTop;
else if (document.documentElement)
document.documentElement.offsetTop;
// force a style recalc.
var dummy = document.body.offsetTop;
window.internals.startTrackingRepaints(document);
var repaintRects = window.internals.repaintRectsAsText(document);
repaintTest();
window.internals.stopTrackingRepaints(document);
if (!window.testIsAsync)
finishRepaintTest();
}
var pre = document.createElement('pre');
document.body.appendChild(pre);
pre.textContent += repaintRects;
function finishRepaintTest()
{
// Force a style recalc.
var dummy = document.body.offsetTop;
if (window.afterTest)
window.afterTest();
} else {
setTimeout(repaintTest, 100);
}
var repaintRects = window.internals.repaintRectsAsText(document);
internals.stopTrackingRepaints(document);
var pre = document.createElement('pre');
document.body.appendChild(pre);
pre.textContent += repaintRects;
if (window.afterTest)
window.afterTest();
if (window.testIsAsync)
testRunner.notifyDone();
}
......@@ -3,5 +3,7 @@ This is a test for regression against https://bugs.webkit.org/show_bug.cgi?id=40
(repaint rects
(rect 0 36 402 152)
(rect 201 37 92 100)
(rect 0 37 402 100)
)
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