tor-browser

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

buffer-full-eventually.html (964B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4 <meta charset="utf-8" />
      5 <link rel="help"
      6      href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/>
      7 <title>This test validates that resource timing implementations have a finite
      8       number of entries in their buffer.</title>
      9 <meta name="timeout" content="long">
     10 <script src="/resources/testharness.js"></script>
     11 <script src="/resources/testharnessreport.js"></script>
     12 </head>
     13 <body>
     14 <script>
     15 promise_test(t => {
     16  return new Promise(resolve => {
     17    let counter = 0;
     18    performance.onresourcetimingbufferfull = resolve;
     19    const loadImagesRecursively = () => {
     20      // Load an image.
     21      (new Image()).src = "resources/blue.png?" + counter;
     22      ++counter;
     23      // Yield to enable queueing an entry, then recursively load another image.
     24      t.step_timeout(loadImagesRecursively, 0);
     25    };
     26    loadImagesRecursively();
     27  });
     28 }, "Finite resource timing entries buffer size");
     29 </script>
     30 </body>
     31 </html>