Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / onerror-img.html
blob7f4e11f16027306207eeece739ce12f07098093f
1 <html>
2 <head>
3 <script>
4 function print(message, color)
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);
14 function test()
16 if (window.testRunner) {
17 testRunner.dumpAsText();
18 testRunner.waitUntilDone();
20 var img1 = document.getElementById('img1');
21 img1.onerror = function (error) {
22 print("PASS: caught image load error: " + error, "green");
23 if (window.testRunner) {
24 testRunner.notifyDone();
27 img1.src = "invalidinvalid.jpg";
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>