tor-browser

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

test_bug544642.html (1080B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test for bug 544642</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      7 </head>
      8 <body>
      9 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=544642"
     10   target="_blank" >Mozilla Bug 544642</a>
     11 <p id="display"></p>
     12 <iframe id=iframe></iframe>
     13 <pre id="test">
     14 <script class="testbody" type="application/javascript">
     15 SimpleTest.waitForExplicitFinish();
     16 var gen = runTest();
     17 
     18 addLoadEvent(function() { gen.next(); });
     19 
     20 function* runTest() {
     21  var iframe = $('iframe');
     22  iframe.onerror = function() { gen.next("error"); };
     23  iframe.onload = function() { gen.next("load"); };
     24 
     25  iframe.src = "data:text/plain,hello";
     26  is((yield), "load", "plaintext data");
     27 
     28  iframe.src = "file://foo/bar";
     29  is((yield), "error", "file");
     30 
     31  // We should do this test too, however it brings up a modal dialog which
     32  // we can't dismiss.
     33  //iframe.src = "http:////";
     34  //is((yield), "error", "invalid http");
     35 
     36  SimpleTest.finish();
     37 }
     38 
     39 </script>
     40 </pre>
     41 </body>
     42 </html>