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 ...@@ -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/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/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 # 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/security/contentSecurityPolicy/connect-src-websocket-allowed.html [ Skip ]
crbug.com/339373 http/tests/websocket/FIXME-handshake-fail-by-null-subprotocol-selection-whitelist.html [ Skip ] crbug.com/339373 http/tests/websocket/FIXME-handshake-fail-by-null-subprotocol-selection-whitelist.html [ Skip ]
......
...@@ -11,15 +11,19 @@ ...@@ -11,15 +11,19 @@
</head> </head>
<body style="margin: 0;" onload="runRepaintTest()"> <body style="margin: 0;" onload="runRepaintTest()">
<script src="resources/text-based-repaint.js"></script>
<script> <script>
window.testIsAsync = true;
function repaintTest() function repaintTest()
{ {
document.getElementById("target").innerHTML += var target = document.getElementById("target");
target.innerHTML +=
'<img style="height: 100px;" src="resources/apple.jpg" >'; '<img style="height: 100px;" src="resources/apple.jpg" >';
target.firstChild.addEventListener("load", finishRepaintTest, false);
} }
</script> </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> <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() function runRepaintTest()
{ {
if (window.testRunner && window.internals) { if (!window.testRunner || !window.internals) {
setTimeout(repaintTest, 100);
return;
}
if (window.enablePixelTesting) if (window.enablePixelTesting)
window.testRunner.dumpAsTextWithPixelResults(); testRunner.dumpAsTextWithPixelResults();
else else
window.testRunner.dumpAsText(); testRunner.dumpAsText();
if (window.testIsAsync)
testRunner.waitUntilDone();
if (document.body) if (document.body)
document.body.offsetTop; document.body.offsetTop;
...@@ -15,12 +25,18 @@ function runRepaintTest() ...@@ -15,12 +25,18 @@ function runRepaintTest()
repaintTest(); repaintTest();
// force a style recalc. if (!window.testIsAsync)
finishRepaintTest();
}
function finishRepaintTest()
{
// Force a style recalc.
var dummy = document.body.offsetTop; var dummy = document.body.offsetTop;
var repaintRects = window.internals.repaintRectsAsText(document); var repaintRects = window.internals.repaintRectsAsText(document);
window.internals.stopTrackingRepaints(document); internals.stopTrackingRepaints(document);
var pre = document.createElement('pre'); var pre = document.createElement('pre');
document.body.appendChild(pre); document.body.appendChild(pre);
...@@ -28,7 +44,7 @@ function runRepaintTest() ...@@ -28,7 +44,7 @@ function runRepaintTest()
if (window.afterTest) if (window.afterTest)
window.afterTest(); window.afterTest();
} else {
setTimeout(repaintTest, 100); 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 ...@@ -3,5 +3,7 @@ This is a test for regression against https://bugs.webkit.org/show_bug.cgi?id=40
(repaint rects (repaint rects
(rect 0 36 402 152) (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