Commit 1b7f5418 authored by yurys@chromium.org's avatar yurys@chromium.org

2011-01-21 Yury Semikhatsky <yurys@chromium.org>

        Reviewed by Pavel Feldman.

        Make userscripts/window-onerror-for-isolated-world-*.html give consistent output
        https://bugs.webkit.org/show_bug.cgi?id=52870

        Call setTimeout from "load" event listener to make sure exception in the setTimeout
        callback happens after the one in the listener.

        * platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt:
        * platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt:
        * userscripts/window-onerror-for-isolated-world-1-expected.txt:
        * userscripts/window-onerror-for-isolated-world-1.html:
        * userscripts/window-onerror-for-isolated-world-2-expected.txt:
        * userscripts/window-onerror-for-isolated-world-2.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c73ebd91
2011-01-21 Yury Semikhatsky <yurys@chromium.org>
Reviewed by Pavel Feldman.
Make userscripts/window-onerror-for-isolated-world-*.html give consistent output
https://bugs.webkit.org/show_bug.cgi?id=52870
Call setTimeout from "load" event listener to make sure exception in the setTimeout
callback happens after the one in the listener.
* platform/chromium/userscripts/window-onerror-for-isolated-world-1-expected.txt:
* platform/chromium/userscripts/window-onerror-for-isolated-world-2-expected.txt:
* userscripts/window-onerror-for-isolated-world-1-expected.txt:
* userscripts/window-onerror-for-isolated-world-1.html:
* userscripts/window-onerror-for-isolated-world-2-expected.txt:
* userscripts/window-onerror-for-isolated-world-2.html:
2011-01-20 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dan Bernstein.
......
Test that window.onerror and "error" event listeners from main world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
Main world window.onerror: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
Main world error event listener: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
Main world window.onerror: Uncaught Error: Error in user script inline script. at :12
Main world error event listener: Uncaught Error: Error in user script inline script. at :12
Main world window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
Main world error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
Main world window.onerror: Uncaught Error: Error in user script load handler. at :4
Main world error event listener: Uncaught Error: Error in user script load handler. at :4
Main world window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
Main world error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
Main world window.onerror: Uncaught Error: Error in user script setTimeout callback. at :9
Main world error event listener: Uncaught Error: Error in user script setTimeout callback. at :9
Test that window.onerror and "error" event listeners from main world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
Main world window.onerror: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
Main world error event listener: Uncaught Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
Main world window.onerror: Uncaught Error: Error in user script inline script. at :12
Main world error event listener: Uncaught Error: Error in user script inline script. at :12
Main world window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:50
Main world error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:50
Main world window.onerror: Uncaught Error: Error in user script load handler. at :8
Main world error event listener: Uncaught Error: Error in user script load handler. at :8
Main world window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:48
Main world error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:48
Main world window.onerror: Uncaught Error: Error in user script setTimeout callback. at :6
Main world error event listener: Uncaught Error: Error in user script setTimeout callback. at :6
CONSOLE MESSAGE: line 30: Uncaught Error: Error in main world inline script.
Test that window.onerror and "error" event listeners from isolated world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
user script window.onerror: Uncaught Error: Error in user script inline script. at :33
user script error event listener: Uncaught Error: Error in user script inline script. at :33
user script window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
user script error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
user script window.onerror: Uncaught Error: Error in user script load handler. at :26
user script error event listener: Uncaught Error: Error in user script load handler. at :26
user script window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
user script error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
user script window.onerror: Uncaught Error: Error in user script setTimeout callback. at :30
user script error event listener: Uncaught Error: Error in user script setTimeout callback. at :30
CONSOLE MESSAGE: line 30: Uncaught Error: Error in main world inline script.
Test that window.onerror and "error" event listeners from isolated world are invoked for uncaught exceptions in user scripts running in isolate worlds as well as for exceptions in the main world.Bug 8519.
user script window.onerror: Uncaught Error: Error in user script inline script. at :33
user script error event listener: Uncaught Error: Error in user script inline script. at :33
user script window.onerror: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27
user script error event listener: Uncaught Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27
user script window.onerror: Uncaught Error: Error in user script load handler. at :30
user script error event listener: Uncaught Error: Error in user script load handler. at :30
user script window.onerror: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25
user script error event listener: Uncaught Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25
user script window.onerror: Uncaught Error: Error in user script setTimeout callback. at :28
user script error event listener: Uncaught Error: Error in user script setTimeout callback. at :28
......@@ -4,11 +4,11 @@ Main world window.onerror: Error: Error in main world inline script. at window-o
Main world error event listener: Error: Error in main world inline script. at window-onerror-for-isolated-world-1.html:54
Main world window.onerror: Error: Error in user script inline script. at undefined:11
Main world error event listener: Error: Error in user script inline script. at undefined:11
Main world window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
Main world error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:46
Main world window.onerror: Error: Error in user script load handler. at undefined:3
Main world error event listener: Error: Error in user script load handler. at undefined:3
Main world window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
Main world error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:51
Main world window.onerror: Error: Error in user script setTimeout callback. at undefined:8
Main world error event listener: Error: Error in user script setTimeout callback. at undefined:8
Main world window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:50
Main world error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-1.html:50
Main world window.onerror: Error: Error in user script load handler. at undefined:7
Main world error event listener: Error: Error in user script load handler. at undefined:7
Main world window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:48
Main world error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-1.html:48
Main world window.onerror: Error: Error in user script setTimeout callback. at undefined:5
Main world error event listener: Error: Error in user script setTimeout callback. at undefined:5
......@@ -43,14 +43,14 @@ window.addEventListener("error", function(e)
var exceptions = function(isolatedWorld)
{
window.addEventListener("load", function(e) {
// Do the following call from load listener to make sure error in the setTimeout callback always happens after the error in this listener.
setTimeout(function() {
throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
}, 0);
throw new Error("Error in " + isolatedWorld + " load handler.");
}, false);
setTimeout(function() {
throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
}, 0);
throw new Error("Error in "+ isolatedWorld + " inline script.");
}
......
......@@ -3,11 +3,11 @@ Test that window.onerror and "error" event listeners from isolated world are inv
user script window.onerror: Error: Error in user script inline script. at undefined:31
user script error event listener: Error: Error in user script inline script. at undefined:31
user script window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
user script error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:23
user script window.onerror: Error: Error in user script load handler. at undefined:24
user script error event listener: Error: Error in user script load handler. at undefined:24
user script window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
user script error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:27
user script window.onerror: Error: Error in user script setTimeout callback. at undefined:28
user script error event listener: Error: Error in user script setTimeout callback. at undefined:28
user script window.onerror: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27
user script error event listener: Error: Error in main world load handler. at window-onerror-for-isolated-world-2.html:27
user script window.onerror: Error: Error in user script load handler. at undefined:28
user script error event listener: Error: Error in user script load handler. at undefined:28
user script window.onerror: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25
user script error event listener: Error: Error in main world setTimeout callback. at window-onerror-for-isolated-world-2.html:25
user script window.onerror: Error: Error in user script setTimeout callback. at undefined:26
user script error event listener: Error: Error in user script setTimeout callback. at undefined:26
......@@ -20,12 +20,12 @@ document.getElementById("console").addEventListener("DOMNodeInserted", function(
var throwExceptions = function(isolatedWorld)
{
window.addEventListener("load", function(e) {
// Do the following call from load listener to make sure error in the setTimeout callback always happens after the error in this listener.
setTimeout(function() {
throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
}, 0);
throw new Error("Error in " + isolatedWorld + " load handler.");
}, false);
setTimeout(function() {
throw new Error("Error in " + isolatedWorld + " setTimeout callback.");
}, 0);
throw new Error("Error in "+ isolatedWorld + " inline script.");
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment