Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /document-picture-in-picture/base-uri.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Test that a document picture-in-picture window has the base URI of the initiator</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>
promise_test(async (t) => {
await test_driver.bless('request PiP window from top window');
const pipWindow = await documentPictureInPicture.requestWindow();
if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// The initial placeholder is in many ways not initialized, e.g. doesn't have the right base
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}
assert_equals(pipWindow.document.baseURI, document.baseURI, "Base URIs match");
});
</script>
</body>