Debian Codegraph @

testing/web-platform/tests/streams/queuing-strategies-size-function-per-global.window.js

raw
1 const iframe = document.createElement('iframe');
2 document.body.appendChild(iframe);
3
4 for (const type of ['CountQueuingStrategy', 'ByteLengthQueuingStrategy']) {
5 test(() => {
6 const myQs = new window[type]({ highWaterMark: 1 });
7 const yourQs = new iframe.contentWindow[type]({ highWaterMark: 1 });
8 assert_not_equals(myQs.size, yourQs.size,
9 'size should not be the same object');
10 }, `${type} size should be different for objects in different realms`);
11 }
12
13 // Cleanup the document to avoid messing up the result page.
14 iframe.remove();