content/base/test/test_bug544642.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug544642.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Test for bug 544642</title>
     1.8 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.10 +</head>
    1.11 +<body>
    1.12 +<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=544642"
    1.13 +   target="_blank" >Mozilla Bug 544642</a>
    1.14 +<p id="display"></p>
    1.15 +<iframe id=iframe></iframe>
    1.16 +<pre id="test">
    1.17 +<script class="testbody" type="application/javascript;version=1.8">
    1.18 +SimpleTest.waitForExplicitFinish();
    1.19 +var gen = runTest();
    1.20 +
    1.21 +addLoadEvent(function() { gen.next(); });
    1.22 +
    1.23 +function runTest() {
    1.24 +  var iframe = $('iframe');
    1.25 +  iframe.onerror = function() { gen.send("error"); };
    1.26 +  iframe.onload = function() { gen.send("load"); };
    1.27 +
    1.28 +  iframe.src = "data:text/plain,hello";
    1.29 +  is((yield), "load", "plaintext data");
    1.30 +
    1.31 +  iframe.src = "file://foo/bar";
    1.32 +  is((yield), "error", "file");
    1.33 +
    1.34 +  // We should do this test too, however it brings up a modal dialog which
    1.35 +  // we can't dismiss.
    1.36 +  //iframe.src = "http:////";
    1.37 +  //is((yield), "error", "invalid http");
    1.38 +
    1.39 +  SimpleTest.finish();
    1.40 +  
    1.41 +  yield undefined;
    1.42 +}
    1.43 +
    1.44 +</script>
    1.45 +</pre>
    1.46 +</body>
    1.47 +</html>

mercurial