Update expected result for fast/repaint/placeholder-after-caps-lock-hidden.html
[WebKit-https.git] / LayoutTests / fast / events / onerror-bubbling.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.testRunner) {
17         testRunner.dumpAsText();
18         testRunner.waitUntilDone();
19         window.setTimeout("testRunner.notifyDone()", 5000); // prevent hang on failure
20     }
21         
22     var div = document.createElement("div");
23     div.setAttribute("onerror", "print('FAILED: dynamic script load error bubbled'); \
24                                  if (window.testRunner) \
25                                     testRunner.notifyDone();");
26     
27     var script = document.createElement("script");
28     script.src="file:///GregTheBunny.js";
29     div.appendChild(script);
30     
31     // force the script to load
32     document.body.appendChild(div);
33 }
34
35 function scriptOnerror()
36 {
37     print('PASS: script error handler invoked');
38
39     // Allow event bubbling phase to complete.
40     setTimeout(function() {
41         if (window.testRunner)
42             testRunner.notifyDone();
43     }, 0);
44 }
45
46 window.onerror = function() {
47     print('FAILED: window.onerror handler invoked');
48 }
49 </script>
50 </head>
51 <body onload="test();">
52 <hr>
53 <div id='console'></div>
54 <div onerror="print('FAILED: inline script load error bubbled')">
55     <script src="file:///GregTheBunny.js" onerror="scriptOnerror()"></script>
56 </div>
57
58 </body>
59 </html>