Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /storage-access-api/storage-access-beyond-cookies.thirdPartyBlobStorage.sub.https.window.html - WPT Dashboard Interop Dashboard
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
'use strict';
async_test(t => {
window.addEventListener("message", t.step_func(async e => {
if (e.data.type !== "blobURL") {
return;
}
const blob_url = e.data.message;
// Create an iframe and pass the blob URL to it.
const id = btoa(blob_url);
const iframe = document.createElement("iframe");
document.body.appendChild(iframe);
// Set up a second message listener to receive the result from the iframe.
window.addEventListener("message", t.step_func(e => {
if (e.data.type !== "result") {
return;
}
assert_equals(e.data.message, "Third Party Blob URL tests completed successfully.");
popup.close();
t.done();
}));
}));
// Open a popup to create the blob URL.
const popup = window.open("https://{{hosts[alt][]}}:{{ports[https][0]}}/storage-access-api/resources/iframe-creation.sub.html");
}, "Verify StorageAccessAPIBeyondCookies for third-party context accessing first-party Blob URLs");