Skip to content

Commit

Permalink
[document pip] Add manual wpt test for hiding return to opener button
Browse files Browse the repository at this point in the history
This CL adds a manual wpt test to check that the
`disallowReturnToOpener` parameter to the document picture-in-picture
api works as expected.

Bug: 3109717
Change-Id: I19c43442f714b8cfce46e2e4bedbb4a2cf46ae3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5375045
Commit-Queue: Tommy Steimel <[email protected]>
Reviewed-by: Frank Liberato <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1273544}
  • Loading branch information
steimelchrome authored and chromium-wpt-export-bot committed Mar 15, 2024
1 parent 49f8dd4 commit 7b41322
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<title>Test that using documentPictureInPicture's disallowReturnToOpener
parameter hides the return to opener button</title>
<body>
<p>
This tests that a document picture-in-picture window opened with the `disallowReturnToOpener`
parameter set to `true` does not display a button to return to the opener.
<ol>
<li>Click on the "Open document picture-in-picture window" button below.</li>
<li>Check that it does not display that button.</li>
</ol>
</p>
<input type="button" id="btnOpenPip" value="Open document picture-in-picture window" />
<script>
const btnOpenPip = document.getElementById('btnOpenPip');
btnOpenPip.addEventListener('click', async () => {
const pipWindow = await documentPictureInPicture.requestWindow({ disallowReturnToOpener: true });
pipWindow.document.body.innerText = 'This document picture-in-picture window should not display a button to return to the opener';
});
</script>
</body>

0 comments on commit 7b41322

Please sign in to comment.