tor-browser

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

test_bug1217571.html (1341B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1217571
      5 -->
      6 <head>
      7  <title>Test for Bug 1217571</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1217571">Mozilla Bug 1217571</a>
     13 <p id="display"></p>
     14 <iframe src="bug1217571-iframe.html"></iframe>
     15 <iframe src="bug1217571-iframe.html"></iframe>
     16 <pre id="test">
     17 <script type="application/javascript">
     18 /** Test for Bug 614392*/
     19 
     20 SimpleTest.waitForExplicitFinish();
     21 
     22 window.onload = function() {
     23  // Each iframe loads the same image.  Both images should share the same
     24  // container from the image cache.  Check that this holds true.
     25  var iframes = document.getElementsByTagName("iframe");
     26  var imgs = Array.from(iframes, function (f) {
     27      return SpecialPowers.wrap(f.contentDocument.getElementsByTagName("img")[0]);
     28  });
     29  var containers = imgs.map(function (img) {
     30      return img.getRequest(SpecialPowers.Ci.nsIImageLoadingContent.CURRENT_REQUEST)
     31                .image;
     32  });
     33 
     34  ok(SpecialPowers.compare(containers[0], containers[1]),
     35     "containers for identical images in different iframes should be identical");
     36 
     37  SimpleTest.finish();
     38 }
     39 
     40 </script>
     41 </pre>
     42 </body>
     43 </html>