3 <script src="resources/window-onerror.js">
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>
12 if (window.layoutTestController)
13 layoutTestController.dumpAsText();
16 document.getElementById("console").innerHTML += msg + "<br>";
19 window.onerror = function(msg, url, line)
21 url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
22 log("Main frame window.onerror: " + msg + " at " + url + ":" + line);
26 document.write('<button id="btn2" onclick="null.m()">Button 2</button>\n');
28 var button3 = document.createElement("button");
29 button3.textContent = "Button 3";
30 button3.setAttribute("onclick", "null.m()");
31 document.body.appendChild(button3);
33 document.getElementById("btn1").click();
34 document.getElementById("btn2").click();