1
0
Fork 0
firefox/testing/web-platform/tests/fetch/api/response/response-blob-realm.any.js
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

24 lines
754 B
JavaScript

// META: global=window
// META: title=realm of Response bytes()
"use strict";
promise_test(async () => {
await new Promise(resolve => {
onload = resolve;
});
let iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.srcdoc = "<!doctype html>";
await new Promise(resolve => {
iframe.onload = resolve;
});
let otherRealm = iframe.contentWindow;
let ab = await window.Response.prototype.bytes.call(new otherRealm.Response(""));
assert_true(ab instanceof otherRealm.Uint8Array, "Uint8Array should be created in receiver's realm");
assert_false(ab instanceof Uint8Array, "Uint8Array should not be created in the bytes() methods's realm");
}, "realm of the Uint8Array from Response bytes()");