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

Side by Side Diff: LayoutTests/fast/events/window-onerror10.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 <body>
3 <p>Test that "error" event listener added with window.addEventListener is invoke d for uncaucht exceptions. <a href="https://bugs.webkit.org/show_bug.cgi?id=8519 ">Bug 8519</a>.</p>
4 <div id="console"></div>
5 <script>
6 if (window.testRunner)
7 testRunner.dumpAsText();
8
9 function log(msg) {
10 document.getElementById("console").innerHTML += msg + "<br>";
11 }
12
13 function lastPathComponent(url) {
14 return url ? url.match( /[^\/]+\/?$/ )[0] : url;
15 }
16
17 window.addEventListener("error", function(e) {
18 log("event passed to the listener is the same as window.event: " + (window.e vent === e));
19 log("Event details:");
20 log("type: " + e.type);
21 log("phase: " + e.eventPhase)
22 log("currentTarget is the global object: " + (e.currentTarget === window));
23 log("message: " + e.message);
24 log("filename: " + lastPathComponent(e.filename));
25 log("lineno: " + e.lineno);
26 e.preventDefault();
27 }, false);
28
29 throw new Error("My fault.");
30
31 </script>
32 </body>
33 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/window-onerror1-expected.txt ('k') | LayoutTests/fast/events/window-onerror10-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698