diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 07:06:31 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 07:06:31 +0000 |
commit | 646dce40970192643ce533518888dfaf9c736815 (patch) | |
tree | fb1d8f65794392b456e20f3e576a2eae5d2e4377 | |
parent | 99ac91f2d045b836b2d3ab7927077322e7fa9967 (diff) | |
download | chromium_src-646dce40970192643ce533518888dfaf9c736815.zip chromium_src-646dce40970192643ce533518888dfaf9c736815.tar.gz chromium_src-646dce40970192643ce533518888dfaf9c736815.tar.bz2 |
Revert 12763.
Review URL: http://codereview.chromium.org/56055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12764 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/chrome.sln | 33 | ||||
-rw-r--r-- | chrome/test/worker/test_webworker.cc | 160 | ||||
-rw-r--r-- | chrome/test/worker/test_webworker.h | 67 | ||||
-rw-r--r-- | chrome/test/worker/test_worker.def | 2 | ||||
-rw-r--r-- | chrome/test/worker/test_worker.vcproj | 174 | ||||
-rw-r--r-- | chrome/test/worker/test_worker.vsprops | 12 | ||||
-rw-r--r-- | chrome/test/worker/test_worker_main.cc | 153 | ||||
-rw-r--r-- | webkit/glue/webworkerclient_impl.cc | 10 | ||||
-rw-r--r-- | webkit/glue/webworkerclient_impl.h | 3 | ||||
-rw-r--r-- | webkit/tools/layout_tests/test_expectations.txt | 16 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.gyp | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.vcproj | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_tests.vcproj | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_webkit_init.h | 1 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_webview_delegate.cc | 11 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 1 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webworker_helper.cc | 90 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webworker_helper.h | 53 |
18 files changed, 7 insertions, 797 deletions
diff --git a/chrome/chrome.sln b/chrome/chrome.sln index 4732ec4..e2838a4 100644 --- a/chrome/chrome.sln +++ b/chrome/chrome.sln @@ -189,7 +189,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_shell", "..\webkit\too {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} {2A70CBF0-847E-4E3A-B926-542A656DC7FE} = {2A70CBF0-847E-4E3A-B926-542A656DC7FE} {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} - {3E03D462-780D-4C4D-B22E-5E095E6CF110} = {3E03D462-780D-4C4D-B22E-5E095E6CF110} {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} = {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} {5597AD47-3494-4750-A235-4F9C2F864700} = {5597AD47-3494-4750-A235-4F9C2F864700} {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} @@ -1693,29 +1692,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_support_base", "..\bas Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_worker", "test\worker\test_worker.vcproj", "{3E03D462-780D-4C4D-B22E-5E095E6CF110}" - ProjectSection(ProjectDependencies) = postProject - {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165} - {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} - {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} - {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} - {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} = {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} - {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} - {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} - {625A8F11-2B4E-45B4-BD99-C6D629C606C0} = {625A8F11-2B4E-45B4-BD99-C6D629C606C0} - {7100F41F-868D-4E99-80A2-AF8E6574749D} = {7100F41F-868D-4E99-80A2-AF8E6574749D} - {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} = {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} - {A508ADD3-CECE-4E0F-8448-2F5E454DF551} = {A508ADD3-CECE-4E0F-8448-2F5E454DF551} - {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6} - {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} - {C564F145-9172-42C3-BFCB-6014CA97DBCD} = {C564F145-9172-42C3-BFCB-6014CA97DBCD} - {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} = {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} - {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} = {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} - {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} - {F4F4BCAA-EA59-445C-A119-3E6C29647A51} = {F4F4BCAA-EA59-445C-A119-3E6C29647A51} - {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} = {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Mixed Platforms = Debug|Mixed Platforms @@ -2015,14 +1991,6 @@ Global {3BD81303-4E14-4559-AA69-B30C3BAB08DD}.Release|Mixed Platforms.Build.0 = Release|Win32 {3BD81303-4E14-4559-AA69-B30C3BAB08DD}.Release|Win32.ActiveCfg = Release|Win32 {3BD81303-4E14-4559-AA69-B30C3BAB08DD}.Release|Win32.Build.0 = Release|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Debug|Win32.Build.0 = Debug|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Release|Mixed Platforms.Build.0 = Release|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Release|Win32.ActiveCfg = Release|Win32 - {3E03D462-780D-4C4D-B22E-5E095E6CF110}.Release|Win32.Build.0 = Release|Win32 {3E6B24F6-9FA9-4066-859E-BF747FA3080A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {3E6B24F6-9FA9-4066-859E-BF747FA3080A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3E6B24F6-9FA9-4066-859E-BF747FA3080A}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -3081,7 +3049,6 @@ Global {3A932C39-AFA9-4BDC-B775-F71A426D04BF} = {2325D8C4-8EF5-42AC-8900-492225750DE4} {3AB90E6A-56FF-4C9D-B918-AB76DDBF8BE8} = {2325D8C4-8EF5-42AC-8900-492225750DE4} {3BD81303-4E14-4559-AA69-B30C3BAB08DD} = {EF78C1F9-AA17-4CA5-B6CB-39B37A73A3DA} - {3E03D462-780D-4C4D-B22E-5E095E6CF110} = {1174D37F-6ABB-45DA-81B3-C631281273B7} {3E6B24F6-9FA9-4066-859E-BF747FA3080A} = {2325D8C4-8EF5-42AC-8900-492225750DE4} {4052059A-D72B-4183-B5C2-9D1B099E9E35} = {EB684A4B-98F7-4E68-8EA7-EA74ACF7060B} {414D4D24-5D65-498B-A33F-3A29AD3CDEDC} = {1174D37F-6ABB-45DA-81B3-C631281273B7} diff --git a/chrome/test/worker/test_webworker.cc b/chrome/test/worker/test_webworker.cc deleted file mode 100644 index b8c839a..0000000 --- a/chrome/test/worker/test_webworker.cc +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "config.h" - -#if ENABLE(WORKERS) - -#include "chrome/test/worker/test_webworker.h" - -#include "base/compiler_specific.h" -#include "base/task.h" -#undef LOG -#include "webkit/glue/webworkerclient.h" -#include "webkit/glue/webworker_impl.h" -#include "webkit/tools/test_shell/test_webworker_helper.h" - -TestWebWorker::TestWebWorker(WebWorkerClient* client, - TestWebWorkerHelper* webworker_helper) - : webworkerclient_delegate_(client), - webworker_impl_(NULL), - webworker_helper_(webworker_helper) { - AddRef(); // Adds the reference held for worker object. - AddRef(); // Adds the reference held for worker context object. -} - -TestWebWorker::~TestWebWorker() { - if (webworker_helper_) - webworker_helper_->Unload(); -} - -void TestWebWorker::StartWorkerContext(const GURL& script_url, - const string16& user_agent, - const string16& source_code) { - webworker_impl_ = new WebWorkerImpl(this); - - webworker_impl_->StartWorkerContext(script_url, - user_agent, - source_code); - - for (size_t i = 0; i < queued_messages_.size(); ++i) - webworker_impl_->PostMessageToWorkerContext(queued_messages_[i]); - queued_messages_.clear(); -} - -void TestWebWorker::TerminateWorkerContext() { - if (webworker_impl_) - webworker_impl_->TerminateWorkerContext(); -} - -void TestWebWorker::PostMessageToWorkerContext(const string16& message) { - if (webworker_impl_) - webworker_impl_->PostMessageToWorkerContext(message); - else - queued_messages_.push_back(message); -} - -void TestWebWorker::WorkerObjectDestroyed() { - if (webworker_impl_) - webworker_impl_->WorkerObjectDestroyed(); - - webworkerclient_delegate_ = NULL; - Release(); // Releases the reference held for worker object. -} - -void TestWebWorker::PostMessageToWorkerObject(const string16& message) { - if (webworker_helper_->IsMainThread()) { - if (webworkerclient_delegate_) - webworkerclient_delegate_->PostMessageToWorkerObject(message); - } else { - webworker_helper_->DispatchToMainThread( - InvokeMainThreadMethod, NewRunnableMethod( - this, &TestWebWorker::PostMessageToWorkerObject, message)); - } -} - -void TestWebWorker::PostExceptionToWorkerObject(const string16& error_message, - int line_number, - const string16& source_url) { - if (webworker_helper_->IsMainThread()) { - if (webworkerclient_delegate_) - webworkerclient_delegate_->PostExceptionToWorkerObject(error_message, - line_number, - source_url); - } else { - webworker_helper_->DispatchToMainThread( - InvokeMainThreadMethod, NewRunnableMethod( - this, &TestWebWorker::PostExceptionToWorkerObject, - error_message, line_number, source_url)); - } -} - -void TestWebWorker::PostConsoleMessageToWorkerObject( - int destination, - int source, - int level, - const string16& message, - int line_number, - const string16& source_url) { - if (webworker_helper_->IsMainThread()) { - if (webworkerclient_delegate_) - webworkerclient_delegate_->PostConsoleMessageToWorkerObject(destination, - source, - level, - message, - line_number, - source_url); - } else { - webworker_helper_->DispatchToMainThread( - InvokeMainThreadMethod, NewRunnableMethod( - this, &TestWebWorker::PostConsoleMessageToWorkerObject, - destination, source, level, message, line_number, source_url)); - } -} - -void TestWebWorker::ConfirmMessageFromWorkerObject(bool has_pending_activity) { - if (webworker_helper_->IsMainThread()) { - if (webworkerclient_delegate_) - webworkerclient_delegate_->ConfirmMessageFromWorkerObject( - has_pending_activity); - } else { - webworker_helper_->DispatchToMainThread( - InvokeMainThreadMethod, NewRunnableMethod( - this, &TestWebWorker::ConfirmMessageFromWorkerObject, - has_pending_activity)); - } -} - -void TestWebWorker::ReportPendingActivity(bool has_pending_activity) { - if (webworker_helper_->IsMainThread()) { - if (webworkerclient_delegate_) - webworkerclient_delegate_->ReportPendingActivity(has_pending_activity); - } else { - webworker_helper_->DispatchToMainThread( - InvokeMainThreadMethod, NewRunnableMethod( - this, &TestWebWorker::ReportPendingActivity, - has_pending_activity)); - } -} - -void TestWebWorker::WorkerContextDestroyed() { - if (webworker_helper_->IsMainThread()) { - if (webworkerclient_delegate_) - webworkerclient_delegate_->WorkerContextDestroyed(); - Release(); // Releases the reference held for worker context object. - } else { - webworker_impl_ = NULL; - webworker_helper_->DispatchToMainThread( - InvokeMainThreadMethod, NewRunnableMethod( - this, &TestWebWorker::WorkerContextDestroyed)); - } -} - -void TestWebWorker::InvokeMainThreadMethod(void* param) { - Task* task = static_cast<Task*>(param); - task->Run(); - delete task; -} - -#endif diff --git a/chrome/test/worker/test_webworker.h b/chrome/test/worker/test_webworker.h deleted file mode 100644 index aa192e7..0000000 --- a/chrome/test/worker/test_webworker.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_TEST_WORKER_TEST_WEBWORKER_H_ -#define CHROME_TEST_WORKER_TEST_WEBWORKER_H_ - -#if ENABLE(WORKERS) - -#include <vector> - -#include "base/basictypes.h" -#include "base/ref_counted.h" -#include "webkit/glue/webworker.h" -#include "webkit/glue/webworkerclient.h" - -class GURL; -class TestWebWorkerHelper; - -class TestWebWorker : public WebWorker, - public WebWorkerClient, - public base::RefCounted<TestWebWorker> { - public: - TestWebWorker(WebWorkerClient* client, TestWebWorkerHelper* webworker_helper); - - // WebWorker implementation. - virtual void StartWorkerContext(const GURL& script_url, - const string16& user_agent, - const string16& source_code); - virtual void TerminateWorkerContext(); - virtual void PostMessageToWorkerContext(const string16& message); - virtual void WorkerObjectDestroyed(); - - // WebWorkerClient implementation. - virtual void PostMessageToWorkerObject(const string16& message); - virtual void PostExceptionToWorkerObject( - const string16& error_message, - int line_number, - const string16& source_url); - virtual void PostConsoleMessageToWorkerObject( - int destination, - int source, - int level, - const string16& message, - int line_number, - const string16& source_url); - virtual void ConfirmMessageFromWorkerObject(bool has_pending_activity); - virtual void ReportPendingActivity(bool has_pending_activity); - virtual void WorkerContextDestroyed(); - - private: - friend class base::RefCounted<TestWebWorker>; - virtual ~TestWebWorker(); - - static void InvokeMainThreadMethod(void* param); - - WebWorkerClient* webworkerclient_delegate_; - WebWorker* webworker_impl_; - TestWebWorkerHelper* webworker_helper_; - std::vector<string16> queued_messages_; - - DISALLOW_COPY_AND_ASSIGN(TestWebWorker); -}; - -#endif - -#endif // CHROME_TEST_WORKER_TEST_WEBWORKER_H_ diff --git a/chrome/test/worker/test_worker.def b/chrome/test/worker/test_worker.def deleted file mode 100644 index 7f6db18..0000000 --- a/chrome/test/worker/test_worker.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS - CreateWebWorker @1 diff --git a/chrome/test/worker/test_worker.vcproj b/chrome/test/worker/test_worker.vcproj deleted file mode 100644 index c51bbf6..0000000 --- a/chrome/test/worker/test_worker.vcproj +++ /dev/null @@ -1,174 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="test_worker"
- ProjectGUID="{3E03D462-780D-4C4D-B22E-5E095E6CF110}"
- RootNamespace="test_worker"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\test_worker.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="$(SolutionDir)..\build\release.vsprops;.\test_worker.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="..\..\..\webkit\glue\simple_clipboard_impl.cc"
- >
- </File>
- <File
- RelativePath=".\test_webworker.cc"
- >
- </File>
- <File
- RelativePath=".\test_webworker.h"
- >
- </File>
- <File
- RelativePath=".\test_worker.def"
- >
- </File>
- <File
- RelativePath=".\test_worker_main.cc"
- >
- </File>
- <File
- RelativePath="..\..\worker\worker_webkitclient_impl.cc"
- >
- </File>
- <File
- RelativePath="..\..\worker\worker_webkitclient_impl.h"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/chrome/test/worker/test_worker.vsprops b/chrome/test/worker/test_worker.vsprops deleted file mode 100644 index 6a5cdcc..0000000 --- a/chrome/test/worker/test_worker.vsprops +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
- ProjectType="Visual C++"
- Version="8.00"
- Name="test_worker"
- InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;..\..\..\webkit\build\webkit_common.vsprops"
- >
- <Tool
- Name="VCLinkerTool"
- ModuleDefinitionFile="test_worker.def"
- />
-</VisualStudioPropertySheet>
diff --git a/chrome/test/worker/test_worker_main.cc b/chrome/test/worker/test_worker_main.cc deleted file mode 100644 index e3a7f89..0000000 --- a/chrome/test/worker/test_worker_main.cc +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "config.h" - -#include "base/at_exit.h" -#include "base/gfx/native_widget_types.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/scoped_ptr.h" -#include "chrome/worker/worker_webkitclient_impl.h" -#include "chrome/test/worker/test_webworker.h" -#include "googleurl/src/gurl.h" -#include "third_party/WebKit/WebKit/chromium/public/WebKit.h" -#include "webkit/glue/resource_loader_bridge.h" -#include "webkit/glue/screen_info.h" -#include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webworker.h" -#include "webkit/glue/webworkerclient.h" -#include "webkit/tools/test_shell/test_webworker_helper.h" - -// Create a global AtExitManager so that our code can use code from base that -// uses Singletons, for example. We don't care about static constructors here. -static base::AtExitManager global_at_exit_manager; - -// WebKit client used in DLL. -static scoped_ptr<WorkerWebKitClientImpl> webkit_client; - -// DLL entry points -WebWorker* API_CALL CreateWebWorker(WebWorkerClient* webworker_client, - TestWebWorkerHelper* webworker_helper) { - if (!WebKit::webKitClient()) { - webkit_client.reset(new WorkerWebKitClientImpl()); - WebKit::initialize(webkit_client.get()); - } - -#if ENABLE(WORKERS) - return new TestWebWorker(webworker_client, webworker_helper); -#else - return NULL; -#endif -} - -// WebKit glue functions - -namespace webkit_glue { - -ResourceLoaderBridge* ResourceLoaderBridge::Create( - const std::string& method, - const GURL& url, - const GURL& policy_url, - const GURL& referrer, - const std::string& frame_origin, - const std::string& main_frame_origin, - const std::string& headers, - const std::string& default_mime_type, - int load_flags, - int requestor_pid, - ResourceType::Type request_type, - int routing_id) { - return NULL; -} - -string16 GetLocalizedString(int message_id) { - return L""; -} - -std::string GetDataResource(int resource_id) { - return ""; -} - -void SetMediaPlayerAvailable(bool value) { -} - -bool IsMediaPlayerAvailable() { - return false; -} - -void PrecacheUrl(const char16* url, int url_length) { -} - -void AppendToLog(const char* file, int line, const char* msg) { - logging::LogMessage(file, line).stream() << msg; -} - -bool GetApplicationDirectory(std::wstring *path) { - return PathService::Get(base::DIR_EXE, path); -} - -GURL GetInspectorURL() { - return GURL("test-shell-resource://inspector/inspector.html"); -} - -std::string GetUIResourceProtocol() { - return "test-shell-resource"; -} - -bool GetExeDirectory(std::wstring *path) { - return PathService::Get(base::DIR_EXE, path); -} - -bool SpellCheckWord(const wchar_t* word, int word_len, - int* misspelling_start, int* misspelling_len) { - // Report all words being correctly spelled. - *misspelling_start = 0; - *misspelling_len = 0; - return true; -} - -ScreenInfo GetScreenInfo(gfx::NativeViewId window) { - return GetScreenInfoHelper(gfx::NativeViewFromId(window)); -} - -bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { - return false; -} - -bool IsPluginRunningInRendererProcess() { - return false; -} - -bool GetPluginFinderURL(std::string* plugin_finder_url) { - return false; -} - -bool IsDefaultPluginEnabled() { - return false; -} - -bool FindProxyForUrl(const GURL& url, std::string* proxy_list) { - return false; -} - -std::wstring GetWebKitLocale() { - return L"en-US"; -} - -#if defined(OS_WIN) -HCURSOR LoadCursor(int cursor_id) { - return NULL; -} - -bool EnsureFontLoaded(HFONT font) { - return true; -} - -bool DownloadUrl(const std::string& url, HWND caller_window) { - return false; -} -#endif - -} diff --git a/webkit/glue/webworkerclient_impl.cc b/webkit/glue/webworkerclient_impl.cc index 68cd330..11ccfca 100644 --- a/webkit/glue/webworkerclient_impl.cc +++ b/webkit/glue/webworkerclient_impl.cc @@ -67,17 +67,13 @@ WebWorkerClientImpl::~WebWorkerClientImpl() { } void WebWorkerClientImpl::set_webworker(WebWorker* webworker) { - webworker_ = webworker; + webworker_.reset(webworker); } void WebWorkerClientImpl::startWorkerContext( const WebCore::KURL& scriptURL, const WebCore::String& userAgent, const WebCore::String& sourceCode) { - // Worker.terminate() could be called from JS before the context is started. - if (asked_to_terminate_) - return; - webworker_->StartWorkerContext(webkit_glue::KURLToGURL(scriptURL), webkit_glue::StringToString16(userAgent), webkit_glue::StringToString16(sourceCode)); @@ -93,10 +89,6 @@ void WebWorkerClientImpl::terminateWorkerContext() { void WebWorkerClientImpl::postMessageToWorkerContext( const WebCore::String& message) { - // Worker.terminate() could be called from JS before the context is started. - if (asked_to_terminate_) - return; - ++unconfirmed_message_count_; webworker_->PostMessageToWorkerContext( webkit_glue::StringToString16(message)); diff --git a/webkit/glue/webworkerclient_impl.h b/webkit/glue/webworkerclient_impl.h index 5a8a4cd..4c8277c 100644 --- a/webkit/glue/webworkerclient_impl.h +++ b/webkit/glue/webworkerclient_impl.h @@ -7,6 +7,7 @@ #if ENABLE(WORKERS) +#include "base/scoped_ptr.h" #include "webkit/glue/webworkerclient.h" #include "WorkerContextProxy.h" @@ -60,7 +61,7 @@ class WebWorkerClientImpl : public WebCore::WorkerContextProxy, WTF::RefPtr<WebCore::ScriptExecutionContext> script_execution_context_; WebCore::Worker* worker_; - WebWorker* webworker_; + scoped_ptr<WebWorker> webworker_; bool asked_to_terminate_; uint32 unconfirmed_message_count_; bool worker_context_had_pending_activity_; diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index 3c55e34..c08139d 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -451,18 +451,6 @@ DEFER : LayoutTests/fast/replaced/table-percent-height.html = FAIL DEFER : LayoutTests/fast/events/stopPropagation-submit.html = FAIL // ----------------------------------------------------------------- -// Workers -// ----------------------------------------------------------------- - -DEFER LINUX MAC : LayoutTests/fast/workers = TIMEOUT FAIL -DEFER SKIP : LayoutTests/fast/workers/stress-js-execution.html = TIMEOUT -DEFER SKIP : LayoutTests/fast/workers/worker-timeout.html = TIMEOUT -DEFER SKIP : LayoutTests/http/tests/xmlhttprequest/workers = TIMEOUT - -// General V8 bug. -DEFER SKIP : LayoutTests/fast/workers/worker-replace-self.html = FAIL - -// ----------------------------------------------------------------- // PENDING TESTS (forked to pending/, need to be sent upstream) // ----------------------------------------------------------------- @@ -476,6 +464,10 @@ DEFER : LayoutTests/fast/repaint/bugzilla-6473.html = PASS FAIL // Tests deferred until we provide support for a particular feature. // ----------------------------------------------------------------- +// Worker related tests (ENABLE_WORKERS): +DEFER SKIP : LayoutTests/fast/workers = TIMEOUT FAIL +DEFER SKIP : LayoutTests/http/tests/workers = TIMEOUT FAIL +DEFER SKIP : LayoutTests/http/tests/xmlhttprequest/workers = TIMEOUT DEFER: LayoutTests/fast/events/dispatchEvent-crash.html = FAIL // These tests rely on the keygen tag, which we haven't wired up. diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp index d45f520..5c3094f 100644 --- a/webkit/tools/test_shell/test_shell.gyp +++ b/webkit/tools/test_shell/test_shell.gyp @@ -63,8 +63,6 @@ 'test_webview_delegate.h', 'test_webview_delegate_gtk.cc', 'test_webview_delegate_win.cc', - 'test_webworker_helper.cc', - 'test_webworker_helper.h', 'text_input_controller.cc', 'text_input_controller.h', 'webview_host.h', diff --git a/webkit/tools/test_shell/test_shell.vcproj b/webkit/tools/test_shell/test_shell.vcproj index 7301863..8ced6eb 100644 --- a/webkit/tools/test_shell/test_shell.vcproj +++ b/webkit/tools/test_shell/test_shell.vcproj @@ -314,14 +314,6 @@ > </File> <File - RelativePath=".\test_webworker_helper.cc" - > - </File> - <File - RelativePath=".\test_webworker_helper.h" - > - </File> - <File RelativePath=".\text_input_controller.cc" > </File> diff --git a/webkit/tools/test_shell/test_shell_tests.vcproj b/webkit/tools/test_shell/test_shell_tests.vcproj index 145b4a9..ac9db53 100644 --- a/webkit/tools/test_shell/test_shell_tests.vcproj +++ b/webkit/tools/test_shell/test_shell_tests.vcproj @@ -279,14 +279,6 @@ > </File> <File - RelativePath=".\test_webworker_helper.cc" - > - </File> - <File - RelativePath=".\test_webworker_helper.h" - > - </File> - <File RelativePath=".\text_input_controller.cc" > </File> diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h index b16a9a2..b0ae2d2 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.h +++ b/webkit/tools/test_shell/test_shell_webkit_init.h @@ -31,7 +31,6 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); WebKit::registerExtension(extensions_v8::GearsExtension::Get()); WebKit::registerExtension(extensions_v8::IntervalExtension::Get()); - WebKit::enableWebWorkers(); } ~TestShellWebKitInit() { diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index c8dc039..2a39260 100755 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -8,8 +8,6 @@ #include "webkit/tools/test_shell/test_webview_delegate.h" -#include "config.h" - #include "base/file_util.h" #include "base/gfx/point.h" #include "base/gfx/native_widget_types.h" @@ -31,7 +29,6 @@ #include "webkit/glue/window_open_disposition.h" #include "webkit/tools/test_shell/test_navigation_controller.h" #include "webkit/tools/test_shell/test_shell.h" -#include "webkit/tools/test_shell/test_webworker_helper.h" #if defined(OS_WIN) // TODO(port): make these files work everywhere. @@ -852,11 +849,3 @@ std::wstring TestWebViewDelegate::GetFrameDescription(WebFrame* webframe) { return L"frame (anonymous)"; } } - -WebWorker* TestWebViewDelegate::CreateWebWorker(WebWorkerClient* client) { -#if ENABLE(WORKERS) - return TestWebWorkerHelper::CreateWebWorker(client); -#else - return NULL; -#endif -} diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 1204ded..c24eccc 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -83,7 +83,6 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, const std::string& mime_type, const std::string& clsid, std::string* actual_mime_type); - virtual WebWorker* CreateWebWorker(WebWorkerClient* client); virtual void OpenURL(WebView* webview, const GURL& url, const GURL& referrer, diff --git a/webkit/tools/test_shell/test_webworker_helper.cc b/webkit/tools/test_shell/test_webworker_helper.cc deleted file mode 100644 index c365a2b..0000000 --- a/webkit/tools/test_shell/test_webworker_helper.cc +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "config.h" -#include <wtf/MainThread.h> -#include <wtf/Threading.h> -#undef LOG - -#include "build/build_config.h" - -#include "webkit/tools/test_shell/test_webworker_helper.h" - -#include "base/logging.h" -#include "base/file_util.h" -#include "base/path_service.h" -#include "third_party/WebKit/WebKit/chromium/public/WebKit.h" -#include "webkit/glue/webworkerclient.h" - - -WebWorker* TestWebWorkerHelper::CreateWebWorker(WebWorkerClient* client) { - TestWebWorkerHelper* loader = new TestWebWorkerHelper(); - return loader->CreateWebWorker_(client, loader); -} - -TestWebWorkerHelper::TestWebWorkerHelper() : -#if defined(OS_WIN) - module_(NULL), -#endif - CreateWebWorker_(NULL) { - Load(); -} - -TestWebWorkerHelper::~TestWebWorkerHelper() { -} - -bool TestWebWorkerHelper::IsMainThread() const { - return WTF::isMainThread(); -} - -void TestWebWorkerHelper::DispatchToMainThread(WTF::MainThreadFunction* func, - void* context) { - return WTF::callOnMainThread(func, context); -} - -bool TestWebWorkerHelper::Load() { -#if defined(OS_WIN) - FilePath path; - PathService::Get(base::DIR_EXE, &path); - path = path.AppendASCII("test_worker.dll"); - - module_ = LoadLibrary(path.value().c_str()); - if (module_ == 0) - return false; - - CreateWebWorker_ = reinterpret_cast<CreateWebWorkerFunc> - (GetProcAddress(module_, "CreateWebWorker")); - if (!CreateWebWorker_) { - FreeLibrary(module_); - module_ = 0; - return false; - } - - return true; -#else - NOTIMPLEMENTED(); - return false; -#endif -} - -void TestWebWorkerHelper::Unload() { - // Since this is called from DLL, delay the unloading until it can be - // invoked from EXE. - return WTF::callOnMainThread(UnloadHelper, this); -} - -void TestWebWorkerHelper::UnloadHelper(void* param) { - TestWebWorkerHelper* this_ptr = static_cast<TestWebWorkerHelper*>(param); - -#if defined(OS_WIN) - if (this_ptr->module_) { - FreeLibrary(this_ptr->module_); - this_ptr->module_ = 0; - } -#else - NOTIMPLEMENTED(); -#endif - - delete this_ptr; -} diff --git a/webkit/tools/test_shell/test_webworker_helper.h b/webkit/tools/test_shell/test_webworker_helper.h deleted file mode 100644 index 0e6c2b0..0000000 --- a/webkit/tools/test_shell/test_webworker_helper.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEBWORKER_HELPER_H__ -#define WEBKIT_TOOLS_TEST_SHELL_TEST_WEBWORKER_HELPER_H__ - -#include <vector> -#if defined(OS_WIN) -#include <windows.h> -#endif - -#include "base/basictypes.h" -#include "base/port.h" - -#include <wtf/MainThread.h> - -class TestWebWorkerHelper; -class WebWorker; -class WebWorkerClient; - -// Function to call in test_worker DLL. -typedef WebWorker* (API_CALL *CreateWebWorkerFunc)( - WebWorkerClient* webworker_client, - TestWebWorkerHelper* webworker_helper);; - -class TestWebWorkerHelper { - public: - static WebWorker* CreateWebWorker(WebWorkerClient* client); - - TestWebWorkerHelper(); - ~TestWebWorkerHelper(); - - virtual bool IsMainThread() const; - virtual void DispatchToMainThread(WTF::MainThreadFunction* func, - void* context); - virtual void Unload(); - - private: - bool Load(); - static void UnloadHelper(void* param); - -#if defined(OS_WIN) - // TODO(port): Remove ifdefs when we have portable replacement for HMODULE. - HMODULE module_; -#endif // defined(OS_WIN) - - CreateWebWorkerFunc CreateWebWorker_; - - DISALLOW_COPY_AND_ASSIGN(TestWebWorkerHelper); -}; - -#endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBWORKER_HELPER_H__ |