content/base/test/test_bug544642.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test for bug 544642</title>
     5   <script type="text/javascript" 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;version=1.8">
    15 SimpleTest.waitForExplicitFinish();
    16 var gen = runTest();
    18 addLoadEvent(function() { gen.next(); });
    20 function runTest() {
    21   var iframe = $('iframe');
    22   iframe.onerror = function() { gen.send("error"); };
    23   iframe.onload = function() { gen.send("load"); };
    25   iframe.src = "data:text/plain,hello";
    26   is((yield), "load", "plaintext data");
    28   iframe.src = "file://foo/bar";
    29   is((yield), "error", "file");
    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");
    36   SimpleTest.finish();
    38   yield undefined;
    39 }
    41 </script>
    42 </pre>
    43 </body>
    44 </html>

mercurial