forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add web platform test for fullscreen popups
Bug: 1142516 Change-Id: I20357e87ed799555e0ed4211fc180317e57116c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4862737 Commit-Queue: Brad Triebwasser <[email protected]> Reviewed-by: Mike Wasserman <[email protected]> Cr-Commit-Position: refs/heads/main@{#1196659}
- Loading branch information
1 parent
efb9ef8
commit 05aa5ff
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
window-management/multi-screen-window-open-fullscreen.tentative.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<meta name="timeout" content="long"> | ||
<!-- user agents are not required to support open features other than `noopener` | ||
and on some platforms position and size features don't make sense --> | ||
<meta name="flags" content="may"> | ||
<title>Window Management test: Fullscreen popups with window.open()</title> | ||
<link rel="help" href="https://w3c.github.io/window-management/"> | ||
Tests the ability to open a fullscreen popup window on each screen.<br> | ||
The host device must have 2+ screens to test cross-screen fullscreen popups. | ||
<br><br> | ||
<button id="closeButton" onclick="closePopups">Close popups</button><br> | ||
<input id="autoClose" type="checkbox" checked=true>Auto-close popups</input> | ||
<ul id="list"></ul> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="resources/helpers.js"></script> | ||
<script> | ||
'use strict'; | ||
|
||
let popups = []; | ||
function closePopups() { | ||
popups.forEach(p => p.close()); | ||
popups = []; | ||
} | ||
|
||
promise_test(async setUpTest => { | ||
await setUpWindowManagement(setUpTest); | ||
for (const [i, s] of window.screenDetails.screens.entries()) { | ||
const name = `Open a fullscreen popup on '${s.label || i}'`; | ||
await promise_test(async test => { | ||
await buttonClick(test, name); | ||
const popup = await openPopupOnScreen(s, /*assertPlacement=*/false, | ||
/*fullscreen=*/true); | ||
popups.push(popup); | ||
await poll(() => { | ||
return popup.document.fullscreenElement == | ||
popup.document.documentElement | ||
}); | ||
const context = `popup: ${windowLog(popup)}, ${screenLog(screen)}`; | ||
assert_equals(popup.screenLeft, s.availLeft, context) | ||
assert_equals(popup.screenRight, s.availRight, context); | ||
assert_equals(popup.screen.availHeight, s.availHeight, context); | ||
assert_equals(popup.screen.availWidth, s.availWidth, context); | ||
if (autoClose.checked) | ||
closePopups(); | ||
}, name); | ||
} | ||
}, 'Use multi-screen details to open a fullscreen popup window on each screen'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters