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

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: js-test-pre 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="../js/resources/js-test-pre.js"></script>
5 <script src="resources/onerror-test.js"></script>
6 </head>
7 <body>
8 <p>Test that window.onerror and "error" event listeners from main world are
9 invoked for uncaught exceptions in scripts running in isolate worlds as
10 well as for exceptions in the main world.<a href="https://bugs.webkit.org/sh ow_bug.cgi?id=8519">Bug 8519.</a>
11 </p>
12 <script>
13 window.jsTestIsAsync = true;
14
15 function callback(errorsHandled) {
16 if (errorsHandled === 12 && window.testRunner)
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