tor-browser

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

test_animated_gif.html (1392B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>Images outside of display port are not decoded</title>
      6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      7 <script src="imgutils.js"></script>
      8 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
      9 </head>
     10 <body>
     11 <p id="display"></p>
     12 <div id="content" style="display: none"></div>
     13 <div id="scroller" style="height: 300px; overflow: scroll;">
     14  <div style="width: 100%; height: 12000px;"></div>
     15  <iframe id="iframe"></iframe>
     16  <div style="width: 100%; height: 5000px;"></div>
     17 </div>
     18 <pre id="test"></pre>
     19 <script>
     20  add_task(async () => {
     21    window.addEventListener("message", event => {
     22      isnot(event.data, "decodeComplete",
     23            "decodeComplete should never be received");
     24    });
     25 
     26    await new Promise(resolve => {
     27      window.addEventListener("message", event => {
     28        if (event.data == "loadComplete") {
     29          ok(true, "Got loadComplete");
     30          resolve();
     31        }
     32      }, { once: true });
     33 
     34      const iframe = document.getElementById("iframe");
     35      iframe.src = "http://example.org/tests/image/test/mochitest/child.html";
     36    });
     37 
     38    const start = Date.now();
     39 
     40    // Waits a second;
     41    await SimpleTest.promiseWaitForCondition(() => {
     42      return 1000 < (Date.now() - start);
     43    });
     44 
     45    ok(true, "decodeComplete didn't receive within a second");
     46  });
     47 
     48 </script>
     49 </body>
     50 </html>