1
0
Fork 0
firefox/testing/web-platform/tests/streams/queuing-strategies-size-function-per-global.window.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

14 lines
568 B
JavaScript

const iframe = document.createElement('iframe');
document.body.appendChild(iframe);
for (const type of ['CountQueuingStrategy', 'ByteLengthQueuingStrategy']) {
test(() => {
const myQs = new window[type]({ highWaterMark: 1 });
const yourQs = new iframe.contentWindow[type]({ highWaterMark: 1 });
assert_not_equals(myQs.size, yourQs.size,
'size should not be the same object');
}, `${type} size should be different for objects in different realms`);
}
// Cleanup the document to avoid messing up the result page.
iframe.remove();