blob: ccd31f4ad99e9206d8010b6ea0643a25232369dd [file] [log] [blame]
<html>
<head>
<script src="resources/window-onerror.js">
</script>
</head>
<body>
<p>Test that window.onerror is called on window object for events created using document.createEvent("error"). <a href="https://bugs.webkit.org/show_bug.cgi?id=8519">Bug 8519</a>.</p>
<div id="console"></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function log(msg) {
document.getElementById("console").innerHTML += msg + "<br>";
}
window.onerror = function(msg, url, line, column, error)
{
log("Main frame window.onerror: ");
log("msg: " + msg);
log("url: " + url);
log("line: " + line);
log("column: " + column);
log("error: " + error);
return true;
}
var evt = document.createEvent("Event");
evt.initEvent("error", true, true);
window.dispatchEvent(evt);
log("DONE.");
</script>
</body>
</html>