Make layout tests not access apache on localhost:80
[WebKit-https.git] / LayoutTests / fast / dom / onerror-img.html
1 <html>
2 <head>
3 <script>
4 function print(message, color) 
5 {
6     var paragraph = document.createElement("div");
7     paragraph.appendChild(document.createTextNode(message));
8     paragraph.style.fontFamily = "monospace";
9     if (color)
10         paragraph.style.color = color;
11     document.getElementById("console").appendChild(paragraph);
12 }
13
14 function test() 
15 {
16     if (window.layoutTestController) {
17        layoutTestController.dumpAsText();
18        layoutTestController.waitUntilDone(); 
19     }
20     var img1 = document.getElementById('img1');
21     img1.onerror = function (error) {
22         print("PASS: caught image load error: " + error, "green");
23         if (window.layoutTestController) {
24             layoutTestController.notifyDone();
25         }
26     };
27     img1.src = "invalidinvalid.jpg";
28 }
29 </script>
30 </head>
31 <body onload="test();">
32 <p>This page tests setting onerror handlers through the DOM. If it passes, you will
33    see "PASS" message below.</p>
34 <hr>
35 <div id='console'></div>
36 <img style="display:none" id="img1">
37 </body>
38 </html>