tor-browser

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

buffer-full-when-populate-entries.html (1223B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4 <meta charset="utf-8" />
      5 <title>This test validates the functionality of onresourcetimingbufferfull in resource timing.</title>
      6 <link rel="author" title="Intel" href="http://www.intel.com/" />
      7 <link rel="help" href="https://www.w3.org/TR/resource-timing-2/#dom-performance-onresourcetimingbufferfull"/>
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="resources/resource-loaders.js"></script>
     11 <script src="resources/buffer-full-utilities.js"></script>
     12 </head>
     13 <body>
     14 <script>
     15 promise_test(async () => {
     16    let bufferFullCount = 0;
     17    performance.addEventListener('resourcetimingbufferfull', e => {
     18        assert_equals(e.bubbles, false, "Event bubbles attribute is false");
     19        bufferFullCount++;
     20    });
     21    await fillUpTheBufferWithTwoResources();
     22    // Overflow the buffer
     23    await load.script(scriptResources[2]);
     24    await waitForNextTask();
     25    checkEntries(2);
     26    assert_equals(bufferFullCount, 1, 'onresourcetimingbufferfull should have been invoked once.');
     27 }, "Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow");
     28 </script>
     29 </body>
     30 </html>