summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/http/tests/misc/unloadable-script.html
blob: 1d0548d6fe1d49165daf3a3979d9eaff25cd6e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<head>
<script>
function log(message) {
  var p = document.createElement("p");
  p.appendChild(document.createTextNode(message));
  document.getElementById("console").appendChild(p);
}

function handleScriptOnError()
{
    log('onerror called (good!)');
}
</script>
</head>
<body>
    <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=13584">bug 13584</a>:
    &lt;script> code wrongly assumes requests can't fail.</p>
    <p>No crash == SUCCESS.</p>
    
    <div id=console></div>
    
    <script onerror="handleScriptOnError()" id=test_script></script>

    <script>
        if (window.testRunner)
            testRunner.dumpAsText();

        <!-- we are an HTTP test so the security origin will fail the file method -->
        document.getElementById('test_script').src = "file:///foobar";
        
        script = document.createElement("script");
        script.setAttribute("src", "file:///foobar");
        script.setAttribute("onerror", "handleScriptOnError()");
        document.body.appendChild(script);
    </script>
</body>
</html>