1
0
Fork 0
firefox/testing/web-platform/tests/html/webappapis/structured-clone/structured-clone-cross-realm-method.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
732 B
HTML

<!doctype html>
<title>self.structuredClone() uses this's relevant Realm for deserialization</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/structured-data.html#structured-cloning">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
const iframe = document.createElement("iframe");
iframe.onload = () => {
const otherWindow = iframe.contentWindow;
for (const key of ["Object", "Array", "Date", "RegExp"]) {
test(() => {
const cloned = otherWindow.structuredClone.call(window, new otherWindow[key]);
assert_true(cloned instanceof window[key]);
}, `${key} instance`);
}
};
document.body.append(iframe);
</script>