blob: 2a46d790b870dc4dcd980e5e0024492a4821fa87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// 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);
});
}
});
|