Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / window-onerror-exception-in-iframe.html
blob6a9013559218cf0d190212fef493b038cf3cc66a
1 <html>
2 <body>
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>
6 <script>
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
12 function log(msg) {
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);
20 return true;
23 function receiveMessage(event) {
24 if (event.data === "IFrameLoaded") {
25 log("DONE");
26 if (window.testRunner)
27 testRunner.notifyDone();
28 } else
29 log("FAIL " + event.data);
32 window.addEventListener("message", receiveMessage, false);
34 throw "MainFrameException";
36 </script>
37 <iframe src="http://localhost:8000/security/resources/onerror-iframe.html"/>
38 </body>
39 </html>