Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 11 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/infrastructure/safe-passing-of-structured-data/window-postmessage.window.html - WPT Dashboard Interop Dashboard
// META: script=/common/sab.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js
runStructuredCloneBatteryOfTests({
structuredClone(data, transfer) {
return new Promise(resolve => {
window.addEventListener('message', function f(ev) {
window.removeEventListener('message', f);
resolve(ev.data.data);
});
window.postMessage({data, transfer}, "/", transfer);
});
}
});