<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script src="resources/text-based-repaint.js"></script>
<script>
// Disable implicit root scroller since the iframe full screen and would
// otherwise be promoted to rootScroller which changes painting and
// invalidation.
if (window.internals)
internals.runtimeFlags.implicitRootScrollerEnabled = false;
window.testIsAsync = true;
onload = function() {
runAfterLayoutAndPaint(async function() {
// Use smaller size because window.resizeTo/By() will fail if the size is
// bigger than the screen size.
var resizePromise = new Promise(resolve => window.onresize = resolve);
window.resizeTo(500, 200);
await resizePromise;
runRepaintAndPixelTest();
});
};
async function repaintTest() {
var resizePromise = new Promise(resolve => window.onresize = resolve);
window.resizeBy(0, 200);
await resizePromise;
finishRepaintTest();
}
</script>
Test passes if you see "Success" after window resizes.
<iframe style="position: absolute; left: 0; top: 0; border: none; height: 100%; width: 100%;"
srcdoc="<!DOCTYPE html><div style='margin-top: 300px; max-width: 400px'><h3>Success</h3></div>"></iframe>