wpt/css/css-images/gradient/color-stops-parsing.html fails
[WebKit-https.git] / LayoutTests / fast / events / window-onerror-exception-in-attr.html
1 <html>
2 <head>
3 <script src="resources/window-onerror.js">
4 </script>
5 </head>
6 <body>
7 <p>Test that window.onerror is called on window object when there is an exception(excluding syntax errors)
8 in attribute handler. <a href="https://bugs.webkit.org/show_bug.cgi?id=70991">Bug 70991</a>.</p>
9 <div id="console"></div>
10 <button id="btn1" onclick="null.m()">Button 1</button>
11 <script>
12 if (window.testRunner)
13     testRunner.dumpAsText();
14
15 function log(msg) {
16     document.getElementById("console").innerHTML += msg + "<br>";
17 }
18
19 window.onerror = function(msg, url, line, column, error)
20 {
21     url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
22     log("Main frame window.onerror: " + msg + " at " + url + ":" + line + ":" + column + " " + error);
23     return true;
24 }
25
26 document.write('<button id="btn2" onclick="null.m()">Button 2</button>\n');
27
28 var button3 = document.createElement("button");
29 button3.textContent = "Button 3";
30 button3.setAttribute("onclick", "null.m()");
31 document.body.appendChild(button3);
32
33 document.getElementById("btn1").click();
34 document.getElementById("btn2").click();
35 button3.click();
36 </script>
37 </body>
38 </html>