Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: LayoutTests/fast/events/window-onerror1.html

Issue 19962008: Rewrite the 'window.onerror' tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: *facepalm* Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 testRunner.dumpAsText();
6
7 function print(message, color)
8 {
9 var paragraph = document.createElement("div");
10 paragraph.appendChild(document.createTextNode(message));
11 paragraph.style.fontFamily = "monospace";
12 if (color)
13 paragraph.style.color = color;
14 document.getElementById("console").appendChild(paragraph);
15 }
16
17 function test()
18 {
19 // must be last because the exception ends JavaScript execution
20 window.onerror = function (error, url, line, column) {
21 url = url ? url.match( /[^\/]+\/?$/ )[0] : url;
22 print("PASS: caught global error: " + error + " at " + url + ", line: " + line + ", column: " + column, "green");
23 return true;
24 };
25 hahaha_good_luck_finding_me(); // caught by window.onerror
26 }
27 </script>
28 </head>
29 <body onload="test();">
30 <p>This page tests setting onerror handlers through the DOM. If it passes, you w ill
31 see "PASS" messages below.<a href="https://bugs.webkit.org/show_bug.cgi?id=85 19">Bug 8519</a>.</p>
32 <hr>
33 <div id='console'></div>
34 </body>
35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698