3 <p>Test that exceptions in iframe are not reported to the main frame window.onerror handler.
4 window.onerror should print exactly one line.
</p>
5 <div id=
"result"></div>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText();
9 testRunner
.waitUntilDone();
13 document
.getElementById("result").innerHTML
+= msg
+ "<br>";
16 window
.onerror = function(msg
, url
, line
)
18 url
= url
? url
.match( /[^\/]+\/?$/ )[0] : url
;
19 log("Main frame window.onerror: " + msg
+ " at " + url
+ ":" + line
);
23 function receiveMessage(event
) {
24 if (event
.data
=== "IFrameLoaded") {
26 if (window
.testRunner
)
27 testRunner
.notifyDone();
29 log("FAIL " + event
.data
);
32 window
.addEventListener("message", receiveMessage
, false);
34 throw "MainFrameException";
37 <iframe src=
"http://localhost:8000/security/resources/onerror-iframe.html"/>