Fix resize event is not fired for window in headless mode (#26194)

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Daniel Alley 2024-02-16 05:54:36 -05:00 committed by GitHub
parent aeb2503fdb
commit faaf9e9323
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 60 additions and 4 deletions

View file

@ -14142,6 +14142,13 @@
{}
]
],
"window_resizeTo.html": [
"87d60498e80bcd01b5790feb3f9e104410cb6e1b",
[
null,
{}
]
],
"window_resize_not_triggered_on_load.html": [
"f551f67ee91f25c7e05c868dbbcad5cb11c93645",
[

View file

@ -0,0 +1,16 @@
<!doctype html>
<meta charset="utf-8">
<title>Verify that the resize event is fired when the window is resized (particularly in headless mode)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function (t) {
window.onresize = t.step_func(function () {
assert_equals(window.innerWidth, 200);
assert_equals(window.innerHeight, 200);
t.done();
});
window.resizeTo(200, 200);
}, "onresize");
</script>