Commit c0b2fc35 authored by Nicolás Peña Moreno's avatar Nicolás Peña Moreno Committed by Commit Bot

Fix flaky test first-image-child.html

This CL fixes flaky timeout of external/wpt/first-image-child.html by:
* Adding a meta tag to let it take long.
* Adding HTML tags for iframe and img instead of adding the resources on
JS, to make it faster.
* Wrapping the core of the test under window load to ensure that the
resources are loaded by the time the entries are checked. It's possible
that before this CL the iframe was sometimes not ready to receive the
message from the parent, causing the test to timeout.

Bug: 1041709
Change-Id: I135c11f5f3a8a3f8e3f65012843a61bab7c50aa7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2025909
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarAnnie Sullivan <sullivan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736139}
parent b77a5688
......@@ -372,6 +372,3 @@ crbug.com/856601 [ Linux ] external/wpt/permissions/idlharness.any.html [ Pass T
# Sheriff 2020-01-10
crbug.com/1041052 [ Linux ] external/wpt/offscreen-canvas/filter/offscreencanvas.filter.w.html [ Timeout ]
crbug.com/1041052 [ Linux ] external/wpt/2dcontext/fill-and-stroke-styles/canvas_colorsandstyles_createlineargradient_001.htm [ Timeout ]
# Sheriff 2020-01-13
crbug.com/1041709 [ Linux ] external/wpt/paint-timing/first-image-child.html [ Pass Timeout ]
......@@ -819,7 +819,6 @@ crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touc
crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
crbug.com/591099 external/wpt/paint-timing/sibling-painting-first-image.html [ Failure ]
crbug.com/591099 virtual/paint-timing/external/wpt/paint-timing/sibling-painting-first-image.html [ Failure ]
crbug.com/1041709 [ Linux Debug ] external/wpt/paint-timing/first-image-child.html [ Pass Timeout ]
crbug.com/591099 virtual/scalefactor200/css3/filters/composited-layer-child-bounds-after-composited-to-sw-shadow-change.html [ Failure ]
# LayoutNG ref-tests that need to be updated (cannot be rebaselined).
......
<!DOCTYPE html>
<head>
<title>Performance Paint Timing Test: child ignores parent FCP</title>
<meta name="timeout" content="long">
</head>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="image"></div>
<iframe src='resources/subframe-sending-paint.html' id='child-iframe'></iframe>
<img src='resources/circles.png'/>
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const iframe = document.createElement('iframe');
iframe.id = 'child-iframe';
iframe.src = 'resources/subframe-sending-paint.html';
document.body.appendChild(iframe);
window.addEventListener('message', t.step_func(e => {
// Child iframe should not have any paint-timing entries.
assert_equals(e.data, '0');
t.done();
}));
const img = document.createElement('IMG');
img.src = 'resources/circles.png';
img.onload = function() {
// Wait for onload to ensure img and iframe have loaded.
window.addEventListener('load', function() {
function testPaintEntries() {
const bufferedEntries = performance.getEntriesByType('paint');
if (bufferedEntries.length < 2) {
......@@ -40,8 +37,7 @@ async_test(function (t) {
})
}
testPaintEntries();
};
document.getElementById('image').appendChild(img);
});
}, 'Child iframe ignores paint-timing events fired from parent image rendering.');
</script>
</body>
......
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