content/base/test/test_bug544642.html

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:65de5ae6afb4
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();
17
18 addLoadEvent(function() { gen.next(); });
19
20 function runTest() {
21 var iframe = $('iframe');
22 iframe.onerror = function() { gen.send("error"); };
23 iframe.onload = function() { gen.send("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 yield undefined;
39 }
40
41 </script>
42 </pre>
43 </body>
44 </html>

mercurial