Files
sousa-gecko/testing/web-platform/tests/window-management/additional-windowing-controls.tentative.https.html
T
pchodur d6218fd331 Bug 2039436 [wpt PR 59860] - [AWC] Add Web Platform Tests for Additional Windowing Controls API, a=testonly
Automatic update from web-platform-tests
[AWC] Add Web Platform Tests for Additional Windowing Controls API

This commit moves the web platform tests for display-state and resizable
properties from Chromium wpt_internal directory and introduces new tests
for Additional Windowing Controls API methods.

Bug: 288265319
Link: https://chromium-review.googlesource.com/id/I85fb832e71120f187cc7320721e3c1be6a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7844557
Reviewed-by: Edman Anjos <edman@chromium.org>
Commit-Queue: Patryk Chodur <pchodur@google.com>
Cr-Commit-Position: refs/heads/main@{#1630187}

--

wpt-commits: 1b61e4ec84fbb7aba7d76cce31ce06715ad21bbb
wpt-pr: 59860
2026-05-19 08:25:05 +00:00

37 lines
1.8 KiB
HTML

<!DOCTYPE html>
<title>Window Management test: Additional Windowing Controls</title>
<link rel="help" href="https://github.com/explainers-by-googlers/additional-windowing-controls/blob/main/README.md">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
assert_true('maximize' in window, "window.maximize should be exposed");
assert_equals(typeof window.maximize, "function", "window.maximize should be a function");
assert_true('minimize' in window, "window.minimize should be exposed");
assert_equals(typeof window.minimize, "function", "window.minimize should be a function");
assert_true('restore' in window, "window.restore should be exposed");
assert_equals(typeof window.restore, "function", "window.restore should be a function");
assert_true('setResizable' in window, "window.setResizable should be exposed");
assert_equals(typeof window.setResizable, "function", "window.setResizable should be a function");
}, "Additional Windowing Controls methods are exposed on the Window interface");
promise_test(async (t) => {
await promise_rejects_dom(t, 'InvalidStateError', window.maximize());
}, "window.maximize() rejects with InvalidStateError when called outside web app scope");
promise_test(async (t) => {
await promise_rejects_dom(t, 'InvalidStateError', window.minimize());
}, "window.minimize() rejects with InvalidStateError when called outside web app scope");
promise_test(async (t) => {
await promise_rejects_dom(t, 'InvalidStateError', window.restore());
}, "window.restore() rejects with InvalidStateError when called outside web app scope");
promise_test(async (t) => {
await promise_rejects_dom(t, 'InvalidStateError', window.setResizable(true));
}, "window.setResizable() rejects with InvalidStateError when called outside web app scope");
</script>