mirror of
https://github.com/servo/servo.git
synced 2025-09-16 18:08:23 +01:00
Add test for resizeTo(-1, -1)
(#39211)
This test crashes in Servo, and passes on Gecko, Blink and Webkit. The crash should be addressed by #39204. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
fcf4beeac0
commit
d469e5e564
3 changed files with 43 additions and 0 deletions
7
tests/wpt/meta/MANIFEST.json
vendored
7
tests/wpt/meta/MANIFEST.json
vendored
|
@ -630851,6 +630851,13 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"resizeTo-negative.html": [
|
||||
"d41d7bea8f980cb90565413cbb37122e1ea738c2",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"screen-detached-frame.html": [
|
||||
"1d566d10f13e1055df6e6ef68017dbdd224ef422",
|
||||
[
|
||||
|
|
2
tests/wpt/meta/css/cssom-view/resizeTo-negative.html.ini
vendored
Normal file
2
tests/wpt/meta/css/cssom-view/resizeTo-negative.html.ini
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
[resizeTo-negative.html]
|
||||
expected: CRASH
|
34
tests/wpt/tests/css/cssom-view/resizeTo-negative.html
vendored
Normal file
34
tests/wpt/tests/css/cssom-view/resizeTo-negative.html
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-window-resizeto">
|
||||
<link rel="help" href="https://github.com/servo/servo/pull/39204">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/rendering-utils.js"></script>
|
||||
<script>
|
||||
"use strict";
|
||||
promise_test(async t => {
|
||||
const w = window.open("/css/reference/blank.html", "", "width=600,height=450");
|
||||
assert_not_equals(w, null, "Popup isn't null");
|
||||
t.add_cleanup(() => w.close());
|
||||
|
||||
// Try as early as possible, when probably we only have about:blank.
|
||||
w.resizeTo(-1, -1);
|
||||
|
||||
// Try again after load, some browser might ignore the former one.
|
||||
if (w.location.href === "about:blank" || w.document.readyState !== "complete") {
|
||||
await new Promise(resolve => w.addEventListener("load", resolve, {once: true}));
|
||||
w.resizeTo(-1, -1);
|
||||
}
|
||||
|
||||
// Wait a bit, so that the resize can finish. Note that listening for a "resize"
|
||||
// event would result in a timeout if no resize occurred.
|
||||
await waitForAtLeastOneFrame();
|
||||
await waitForAtLeastOneFrame();
|
||||
|
||||
assert_greater_than(w.outerWidth, 0, "Popup width is positive");
|
||||
assert_greater_than(w.outerHeight, 0, "Popup height is positive");
|
||||
}, "resizeTo(-1, -1) might shrink window size, but it stays positive");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue