diff options
author | Taym Haddadi <haddadi.taym@gmail.com> | 2025-04-27 12:43:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-27 10:43:05 +0000 |
commit | 989739316e5be035366294f9c2eff24f87453def (patch) | |
tree | ea414d977c422c47e2da3caab23b5c4eb6524a04 /tests | |
parent | e22ce3988b5962c254857419afbf36cced9648aa (diff) | |
download | servo-989739316e5be035366294f9c2eff24f87453def.tar.gz servo-989739316e5be035366294f9c2eff24f87453def.zip |
Determine if ResizeTo is allowed (#36704)
Spec says to check If target is not an auxiliary browsing context before
performing ResizeTo.
Fixes: #36701
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wpt/mozilla/meta/MANIFEST.json | 9 | ||||
-rw-r--r-- | tests/wpt/mozilla/tests/mozilla/window_resizeTo.html | 21 | ||||
-rw-r--r-- | tests/wpt/mozilla/tests/mozilla/window_resizeTo_not_permitted-crash.html | 6 |
3 files changed, 27 insertions, 9 deletions
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index e1817a3dacc..d3a939eab57 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -52,6 +52,13 @@ null, {} ] + ], + "window_resizeTo_not_permitted-crash.html": [ + "7b6a67ff81436a91048bdb627f303f7fab2762f7", + [ + null, + {} + ] ] } }, @@ -14330,7 +14337,7 @@ ] ], "window_resizeTo.html": [ - "87d60498e80bcd01b5790feb3f9e104410cb6e1b", + "3f6c5a610d52b64bf4457d478b929e95d79e9ab8", [ null, {} diff --git a/tests/wpt/mozilla/tests/mozilla/window_resizeTo.html b/tests/wpt/mozilla/tests/mozilla/window_resizeTo.html index 87d60498e80..3f6c5a610d5 100644 --- a/tests/wpt/mozilla/tests/mozilla/window_resizeTo.html +++ b/tests/wpt/mozilla/tests/mozilla/window_resizeTo.html @@ -1,16 +1,21 @@ <!doctype html> <meta charset="utf-8"> -<title>Verify that the resize event is fired when the window is resized (particularly in headless mode)</title> +<title>Verify that the resize event is fired when the window is resized (in popup)</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(); - }); + var popup = window.open("about:blank", "_blank", "width=100,height=100"); + assert_not_equals(popup, null, "Popup must be successfully opened"); - window.resizeTo(200, 200); - }, "onresize"); + popup.onload = function () { + popup.onresize = t.step_func(function () { + assert_approx_equals(popup.innerWidth, 200, 10, "Popup width should be ~200"); + assert_approx_equals(popup.innerHeight, 200, 10, "Popup height should be ~200"); + t.done(); + }); + + popup.resizeTo(200, 200); + }; + }, "Popup onresize event fires after resizeTo"); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/window_resizeTo_not_permitted-crash.html b/tests/wpt/mozilla/tests/mozilla/window_resizeTo_not_permitted-crash.html new file mode 100644 index 00000000000..7b6a67ff814 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/window_resizeTo_not_permitted-crash.html @@ -0,0 +1,6 @@ +<!doctype html> +<meta charset="utf-8"> +<title>Test that calling resizeTo() on normal window does not crash</title> +<script> + window.resizeTo(-1, -1); +</script> |