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

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

Issue 21071003: Trigger `window.onerror` only for exceptions thrown in the same world. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: feedback Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/window-onerror-isolatedworld-01-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/window-onerror-isolatedworld-01.html
diff --git a/LayoutTests/fast/events/window-onerror-isolatedworld-01.html b/LayoutTests/fast/events/window-onerror-isolatedworld-01.html
index 70952553b8c350a42f0f0d27cc270b4d86686b1f..c5d6ae80ce24ab50f8fd275282e7a474170ebafa 100644
--- a/LayoutTests/fast/events/window-onerror-isolatedworld-01.html
+++ b/LayoutTests/fast/events/window-onerror-isolatedworld-01.html
@@ -10,15 +10,34 @@
</head>
<body>
<script>
- description('Test that window.onerror and "error" event listeners from main world are invoked for uncaught exceptions in scripts running in isolate worlds as well as for exceptions in the main world.');
+ description('Test that window.onerror and "error" event listeners from main world are not invoked for uncaught exceptions in scripts running in isolate worlds, but only for exceptions in the main world.');
- function callback(errorsHandled) {
- if (errorsHandled === 12)
+ var onerrorsHandled = 0;
+ function onErrorCallback(errorsHandled) {
+ onerrorsHandled++;
+ if (onerrorsHandled > 3)
+ testFailed("Only main-world exceptions should be caught by onerror handlers.");
+
+ // FIXME: This should be 6 once we correctly handle 'error' event dispatch for worlds: crbug.com/225513
+ if (errorsHandled === 9)
+ finishJSTest();
+ }
+
+ var errorEventsHandled = 0;
+ function errorEventCallback(errorsHandled) {
+ errorEventsHandled++;
+ if (errorEventsHandled > 3) {
+ // FIXME: This currently fails. We need to correctly handle 'error' event dispatch for worlds: crbug.com/225513
+ testFailed("Only main-world exceptions should be caught by ErrorEvent listeners.");
+ }
+
+ // FIXME: This should be 6 once we correctly handle 'error' event dispatch for worlds: crbug.com/225513
+ if (errorsHandled === 9)
finishJSTest();
}
- dumpOnErrorArgumentValuesAndReturn(true, callback);
- dumpErrorEventAndPreventDefault(callback);
+ dumpOnErrorArgumentValuesAndReturn(true, onErrorCallback);
+ dumpErrorEventAndPreventDefault(errorEventCallback);
var exceptions = function(worldType)
{
« no previous file with comments | « no previous file | LayoutTests/fast/events/window-onerror-isolatedworld-01-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698