tor-browser

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

buffer-full-add-entries-during-callback-that-drop.html (1292B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head onload>
      4 <meta charset="utf-8" />
      5 <title>This test validates that synchronously adding entries in onresourcetimingbufferfull callback results in these entries being properly handled.</title>
      6 <link rel="author" title="Google" href="http://www.google.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    await fillUpTheBufferWithSingleResource();
     17    performance.addEventListener('resourcetimingbufferfull', () => {
     18        performance.setResourceTimingBufferSize(2);
     19        // The sync entry is added to the secondary buffer, so will be the last one there and eventually dropped.
     20        load.xhr_sync(scriptResources[2]);
     21    });
     22    // This resource overflows the entry buffer, and goes into the secondary buffer.
     23    load.script(scriptResources[1]);
     24    await bufferFullFirePromise;
     25    checkEntries(2);
     26 }, "Test that entries synchronously added to the buffer during the callback are dropped");
     27 </script>
     28 </body>
     29 </html>