tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

queuing-strategies-size-function-per-global.window.js (568B)


      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();