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

Side by Side Diff: LayoutTests/fast/events/window-onerror-isolatedworld-01.html

Issue 19962008: Rewrite the 'window.onerror' tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests. 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 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="resources/onerror-test.js"></script>
5 </head>
6 <body>
7 <p>Test that window.onerror and "error" event listeners from main world are
8 invoked for uncaught exceptions in scripts running in isolate worlds as
9 well as for exceptions in the main world.<a href="https://bugs.webkit.org/sh ow_bug.cgi?id=8519">Bug 8519.</a>
10 </p>
11 <script>
12 var handledErrors = 0;
13 function callback() {
14 handledErrors++;
15 if (handledErrors === 12 && window.testRunner)
16 testRunner.notifyDone();
17 }
18
19 DumpOnErrorArgumentValuesAndReturn(true, callback);
20 DumpErrorEventAndPreventDefault(callback);
21
22 var exceptions = function(worldType)
23 {
24 window.addEventListener("load", function(e) {
25 // Do the following call from load listener to make sure error i n the setTimeout callback always happens after the error in this listener.
26 setTimeout(function() {
27 throw new Error("Error in " + worldType + " world setTimeout callback.");
28 }, 0);
29 throw new Error("Error in " + worldType + " world load handler." );
30 }, false);
31
32 throw new Error("Error in " + worldType + " world inline script.");
33 }
34
35 if (window.testRunner) {
36 testRunner.dumpAsText();
37 testRunner.waitUntilDone();
38 testRunner.evaluateScriptInIsolatedWorld(1, "(" + exceptions + ")('i solated')");
39 }
40
41 exceptions("main");
42
43 </script>
44 </body>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698