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

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: *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 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 window.jsTestIsAsync = true;
6 window.isOnErrorTest = true;
7 </script>
8 <script src="../js/resources/js-test-pre.js"></script>
9 <script src="resources/onerror-test.js"></script>
10 </head>
11 <body>
12 <script>
13 description('Test that window.onerror and "error" event listeners from m ain world are invoked for uncaught exceptions in scripts running in isolate worl ds as well as for exceptions in the main world.');
14
15 function callback(errorsHandled) {
16 if (errorsHandled === 12)
17 finishJSTest();
18 }
19
20 dumpOnErrorArgumentValuesAndReturn(true, callback);
21 dumpErrorEventAndPreventDefault(callback);
22
23 var exceptions = function(worldType)
24 {
25 window.addEventListener("load", function(e) {
26 // Do the following call from load listener to make sure error i n the setTimeout callback always happens after the error in this listener.
27 setTimeout(function() {
28 throw new Error("Error in " + worldType + " world setTimeout callback.");
29 }, 0);
30 throw new Error("Error in " + worldType + " world load handler." );
31 }, false);
32
33 throw new Error("Error in " + worldType + " world inline script.");
34 }
35
36 if (window.testRunner)
37 testRunner.evaluateScriptInIsolatedWorld(1, "(" + exceptions + ")('i solated')");
38
39 exceptions("main");
40
41 </script>
42 <script src="../js/resources/js-test-post.js"></script>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698