| <html> |
| <head> |
| <script> |
| function print(message, color) |
| { |
| var paragraph = document.createElement("div"); |
| paragraph.appendChild(document.createTextNode(message)); |
| paragraph.style.fontFamily = "monospace"; |
| if (color) |
| paragraph.style.color = color; |
| document.getElementById("console").appendChild(paragraph); |
| } |
| |
| function test() |
| { |
| if (window.layoutTestController) { |
| layoutTestController.dumpAsText(); |
| layoutTestController.waitUntilDone(); |
| } |
| var img1 = document.getElementById('img1'); |
| img1.onerror = function (error) { |
| print("PASS: caught image load error: " + error, "green"); |
| if (window.layoutTestController) { |
| layoutTestController.notifyDone(); |
| } |
| }; |
| img1.src = "http://127.0.0.1/hahaha_good_luck_finding_me.jpg"; |
| } |
| </script> |
| </head> |
| <body onload="test();"> |
| <p>This page tests setting onerror handlers through the DOM. If it passes, you will |
| see "PASS" message below.</p> |
| <hr> |
| <div id='console'></div> |
| <img style="display:none" id="img1"> |
| </body> |
| </html> |