Skip to content

Commit

Permalink
Add display-mode media query support for document picture-in-picture
Browse files Browse the repository at this point in the history
Bug:41493667
Change-Id: I16d0b7c62ed09220e4bbacdfa86191331f872d11
  • Loading branch information
beaufortfrancois authored and chromium-wpt-export-bot committed Feb 6, 2024
1 parent cdafbec commit 5fc0b32
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions document-picture-in-picture/display-mode-media-query.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>Test that documentPictureInPicture.requestWindow()
returns a window with display-mode is picture-in-picture</title>
<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>
<body>
<script>
async_test((t) => {
assert_false(window.matchMedia('(display-mode: picture-in-picture)').matches);
test_driver.bless('request PiP window').then(t.step_func(_ => {
documentPictureInPicture.requestWindow().then(t.step_func((pipWindow) => {
const mq = pipWindow.matchMedia('(display-mode: picture-in-picture)');
mq.onchange = t.step_func_done(() => {
assert_true(mq.matches);
});
}));
}));
});
</script>
</body>

0 comments on commit 5fc0b32

Please sign in to comment.