Commit 06a6e122 authored by Charlie Hu's avatar Charlie Hu Committed by Commit Bot

Fix test failure expectation on document-policy-oversized-images-resize.html

The test was testing UnsizedMedia feature working properly when images
got resized on screen after they initially got loaded.

Initially the test worked fine, but after certain optimization made by
rendering team, window.onload no longer guarantees that images are
painted on the screen. This CL introduces a timeout to force the script
to execute after initial images are painted on screen first.

Bug: 591099
Change-Id: I1a11e1b5b8c87ba2bd3d5c64c9d5477a73ee0d5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090457
Commit-Queue: Charlie Hu <chenleihu@google.com>
Reviewed-by: default avatarIan Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749252}
parent ff29ad2f
......@@ -922,7 +922,6 @@ crbug.com/591099 [ Fuchsia ] tables/mozilla/core/bloomberg.html [ Failure Timeou
crbug.com/591099 [ Fuchsia ] tables/mozilla_expected_failures/bugs/bug1010.html [ Failure ]
crbug.com/591099 [ Fuchsia ] tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ]
crbug.com/591099 [ Fuchsia ] tables/mozilla_expected_failures/bugs/bug2479-5.html [ Failure ]
crbug.com/591099 [ Win ] http/tests/images/document-policy-oversized-images-resize.html [ Skip ]
crbug.com/591099 [ Mac ] css2.1/t1202-counter-09-b.html [ Failure ]
crbug.com/591099 [ Mac ] css2.1/t1202-counters-09-b.html [ Failure ]
crbug.com/591099 [ Mac ] external/wpt/css/CSS2/text/white-space-bidirectionality-001.xht [ Failure ]
......@@ -959,8 +958,6 @@ crbug.com/591099 [ Mac ] paint/text/text-match-highlights-big-line-height.html [
crbug.com/591099 [ Mac ] fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html [ Failure ]
crbug.com/591099 [ Mac ] paint/invalidation/flexbox/remove-inline-block-descendant-of-flex.html [ Failure ]
crbug.com/591099 [ Mac ] fast/replaced/input-radio-height-inside-auto-container.html [ Failure ]
crbug.com/591099 [ Mac ] http/tests/images/document-policy-oversized-images-resize.html [ Failure ]
crbug.com/974717 [ Linux ] http/tests/images/document-policy-oversized-images-resize.html [ Failure Pass ]
crbug.com/591099 [ Mac10.11 ] virtual/audio-service/media/track/track-cue-rendering-position-auto-rtl.html [ Failure ]
crbug.com/591099 [ Mac10.13 ] fast/dynamic/outerHTML-doc.html [ Failure ]
......
......@@ -10,17 +10,19 @@ header("Document-Policy: oversized-images;scale=2.0");
<script>
window.addEventListener('load', function() {
var images = document.getElementsByTagName('img');
for (var i = 0; i < images.length; i++) {
var image = images[i];
if (image.hasAttribute('width') || image.hasAttribute('height')) {
image.width = "150";
image.height = "150";
} else {
image.style.width = "150px";
image.style.height = "150px";
setTimeout(() => {
var images = document.getElementsByTagName('img');
for (var i = 0; i < images.length; i++) {
var image = images[i];
if (image.hasAttribute('width') || image.hasAttribute('height')) {
image.width = "150";
image.height = "150";
} else {
image.style.width = "150px";
image.style.height = "150px";
}
}
}
}, 5);
});
</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