From 8b30662b7ca998a481c9dae66d8b6b05db47b38a Mon Sep 17 00:00:00 2001 From: "atwilson@chromium.org" Date: Fri, 18 Sep 2009 16:25:35 +0000 Subject: Fixed Chrome implementation of worker error reporting to report errors via event listeners, not just via onerror. Rebaselined worker-script-error test to reflect new test case. Re-enabled WorkerFastLayoutTests. BUG=20822 TEST=none (enabling existing tests) Review URL: http://codereview.chromium.org/207002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26574 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/worker/worker_uitest.cc | 2 +- .../LayoutTests/fast/workers/worker-script-error-expected.txt | 1 + webkit/glue/webworkerclient_impl.cc | 11 +++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index 5db5dd9..965036d 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -35,7 +35,7 @@ TEST_F(WorkerTest, MultipleWorkers) { RunTest(L"multi_worker.html"); } -TEST_F(WorkerTest, DISABLED_WorkerFastLayoutTests) { +TEST_F(WorkerTest, WorkerFastLayoutTests) { static const char* kLayoutTestFiles[] = { "stress-js-execution.html", "use-machine-stack.html", diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-script-error-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-script-error-expected.txt index 0f39673..3f15859 100644 --- a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-script-error-expected.txt +++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/fast/workers/worker-script-error-expected.txt @@ -2,6 +2,7 @@ Test Worker script error handling functionality. Should print a series of PASS m PASS: onerror invoked for a script that has invalid syntax. PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 1. +PASS: event listener invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 1. PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7. PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7. PASS: onerror invoked for a script that has script error 'Uncaught ReferenceError: foo is not defined' at line 7. diff --git a/webkit/glue/webworkerclient_impl.cc b/webkit/glue/webworkerclient_impl.cc index 69a291c..c273dbb 100644 --- a/webkit/glue/webworkerclient_impl.cc +++ b/webkit/glue/webworkerclient_impl.cc @@ -237,11 +237,10 @@ void WebWorkerClientImpl::postExceptionToWorkerObject( } bool handled = false; - if (worker_->onerror()) - handled = worker_->dispatchScriptErrorEvent( - webkit_glue::WebStringToString(error_message), - webkit_glue::WebStringToString(source_url), - line_number); + handled = worker_->dispatchScriptErrorEvent( + webkit_glue::WebStringToString(error_message), + webkit_glue::WebStringToString(source_url), + line_number); if (!handled) script_execution_context_->reportException( webkit_glue::WebStringToString(error_message), @@ -359,7 +358,7 @@ void WebWorkerClientImpl::PostExceptionToWorkerObjectTask( int line_number, const WebCore::String& source_url) { bool handled = false; - if (this_ptr->worker_ && this_ptr->worker_->onerror()) + if (this_ptr->worker_) handled = this_ptr->worker_->dispatchScriptErrorEvent( error_message, source_url, line_number); if (!handled) -- cgit v1.1