Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / window-onerror-sandbox-01.html
blob960c74bd92064a43f1833649c749806dd4ed6275
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 window.jsTestIsAsync = true;
9 description("This test should trigger 'window.onerror' inside the sandboxed iframe, and successfully handle the error.");
10 var message = '';
11 window.onmessage = function (e) {
12 message = e.data;
13 shouldBeEqualToString("message", "Uncaught ReferenceError: hahaha_good_luck_finding_me is not defined");
14 finishJSTest();
16 </script>
17 <iframe sandbox="allow-scripts" srcdoc="
18 <script>
19 window.onerror = function (message) {
20 window.top.postMessage(message, '*');
22 hahaha_good_luck_finding_me(); // caught by window.onerror
23 </script>"></iframe>
24 </body>
25 </html>