summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/prefs/testing_pref_store.cc26
-rw-r--r--chrome/browser/prefs/testing_pref_store.h14
-rw-r--r--chrome/browser/sync/js_test_util.cc16
-rw-r--r--chrome/browser/sync/js_test_util.h12
-rw-r--r--chrome/browser/tab_contents/test_tab_contents.h7
-rw-r--r--chrome/chrome_tests.gypi12
-rw-r--r--chrome/test/in_process_browser_test.cc4
-rw-r--r--chrome/test/in_process_browser_test.h4
-rw-r--r--chrome/test/testing_profile.cc242
-rw-r--r--chrome/test/testing_profile.h167
-rw-r--r--chrome/test/ui/ui_test.cc4
-rw-r--r--chrome/test/ui/ui_test.h4
-rw-r--r--chrome/test/ui_test_utils.cc20
-rw-r--r--chrome/test/ui_test_utils.h22
-rw-r--r--media/audio/test_audio_input_controller_factory.h4
-rw-r--r--webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc1
-rw-r--r--webkit/plugins/npapi/test/plugin_geturl_test.cc5
-rw-r--r--webkit/plugins/npapi/test/plugin_geturl_test.h3
-rw-r--r--webkit/plugins/npapi/test/plugin_javascript_open_popup.cc6
-rw-r--r--webkit/plugins/npapi/test/plugin_schedule_timer_test.cc2
-rw-r--r--webkit/plugins/npapi/test/plugin_test.cc42
-rw-r--r--webkit/plugins/npapi/test/plugin_test.h48
-rw-r--r--webkit/plugins/npapi/test/plugin_thread_async_call_test.cc3
-rw-r--r--webkit/plugins/npapi/test/plugin_windowed_test.cc2
-rw-r--r--webkit/plugins/npapi/test/plugin_windowless_test.cc6
-rw-r--r--webkit/plugins/npapi/test/plugin_windowless_test.h4
-rw-r--r--webkit/tools/test_shell/accessibility_ui_element.cc21
-rw-r--r--webkit/tools/test_shell/accessibility_ui_element.h10
-rw-r--r--webkit/tools/test_shell/notification_presenter.cc12
-rw-r--r--webkit/tools/test_shell/notification_presenter.h13
-rw-r--r--webkit/tools/test_shell/test_shell.gypi1
-rw-r--r--webkit/tools/test_shell/test_shell_devtools_agent.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_devtools_agent.h5
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.cc115
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h127
-rw-r--r--webkit/tools/test_shell/test_web_worker.cc41
-rw-r--r--webkit/tools/test_shell/test_web_worker.h33
37 files changed, 725 insertions, 339 deletions
diff --git a/chrome/browser/prefs/testing_pref_store.cc b/chrome/browser/prefs/testing_pref_store.cc
index 39c20f2..89394bd 100644
--- a/chrome/browser/prefs/testing_pref_store.cc
+++ b/chrome/browser/prefs/testing_pref_store.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -9,7 +9,9 @@
TestingPrefStore::TestingPrefStore()
: read_only_(true),
prefs_written_(false),
- init_complete_(false) { }
+ init_complete_(false) {}
+
+TestingPrefStore::~TestingPrefStore() {}
PrefStore::ReadResult TestingPrefStore::GetValue(const std::string& key,
Value** value) const {
@@ -24,6 +26,10 @@ void TestingPrefStore::RemoveObserver(PrefStore::Observer* observer) {
observers_.RemoveObserver(observer);
}
+bool TestingPrefStore::IsInitializationComplete() const {
+ return init_complete_;
+}
+
void TestingPrefStore::SetValue(const std::string& key, Value* value) {
if (prefs_.SetValue(key, value))
NotifyPrefValueChanged(key);
@@ -38,6 +44,10 @@ void TestingPrefStore::RemoveValue(const std::string& key) {
NotifyPrefValueChanged(key);
}
+bool TestingPrefStore::ReadOnly() const {
+ return read_only_;
+}
+
PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() {
prefs_.Clear();
return PersistentPrefStore::PREF_READ_ERROR_NONE;
@@ -98,3 +108,15 @@ bool TestingPrefStore::GetBoolean(const std::string& key, bool* value) const {
return stored_value->GetAsBoolean(value);
}
+
+void TestingPrefStore::set_read_only(bool read_only) {
+ read_only_ = read_only;
+}
+
+void TestingPrefStore::set_prefs_written(bool status) {
+ prefs_written_ = status;
+}
+
+bool TestingPrefStore::get_prefs_written() {
+ return prefs_written_;
+}
diff --git a/chrome/browser/prefs/testing_pref_store.h b/chrome/browser/prefs/testing_pref_store.h
index 555ee69..5502ad2 100644
--- a/chrome/browser/prefs/testing_pref_store.h
+++ b/chrome/browser/prefs/testing_pref_store.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -20,19 +20,19 @@ class DictionaryValue;
class TestingPrefStore : public PersistentPrefStore {
public:
TestingPrefStore();
- virtual ~TestingPrefStore() {}
+ virtual ~TestingPrefStore();
// Overriden from PrefStore.
virtual ReadResult GetValue(const std::string& key, Value** result) const;
virtual void AddObserver(PrefStore::Observer* observer);
virtual void RemoveObserver(PrefStore::Observer* observer);
- virtual bool IsInitializationComplete() const { return init_complete_; }
+ virtual bool IsInitializationComplete() const;
// PersistentPrefStore overrides:
virtual void SetValue(const std::string& key, Value* value);
virtual void SetValueSilently(const std::string& key, Value* value);
virtual void RemoveValue(const std::string& key);
- virtual bool ReadOnly() const { return read_only_; }
+ virtual bool ReadOnly() const;
virtual PersistentPrefStore::PrefReadError ReadPrefs();
virtual bool WritePrefs();
virtual void ScheduleWritePrefs() {}
@@ -55,9 +55,9 @@ class TestingPrefStore : public PersistentPrefStore {
// Getter and Setter methods for setting and getting the state of the
// |TestingPrefStore|.
- virtual void set_read_only(bool read_only) { read_only_ = read_only; }
- virtual void set_prefs_written(bool status) { prefs_written_ = status; }
- virtual bool get_prefs_written() { return prefs_written_; }
+ virtual void set_read_only(bool read_only);
+ virtual void set_prefs_written(bool status);
+ virtual bool get_prefs_written();
private:
// Stores the preference values.
diff --git a/chrome/browser/sync/js_test_util.cc b/chrome/browser/sync/js_test_util.cc
index 3c736c7..bd4f9c0 100644
--- a/chrome/browser/sync/js_test_util.cc
+++ b/chrome/browser/sync/js_test_util.cc
@@ -56,5 +56,21 @@ class HasArgsMatcher
return HasArgs(JsArgList(expected_args));
}
+MockJsBackend::MockJsBackend() {}
+
+MockJsBackend::~MockJsBackend() {}
+
+MockJsFrontend::MockJsFrontend() {}
+
+MockJsFrontend::~MockJsFrontend() {}
+
+MockJsEventHandler::MockJsEventHandler() {}
+
+MockJsEventHandler::~MockJsEventHandler() {}
+
+MockJsEventRouter::MockJsEventRouter() {}
+
+MockJsEventRouter::~MockJsEventRouter() {}
+
} // namespace browser_sync
diff --git a/chrome/browser/sync/js_test_util.h b/chrome/browser/sync/js_test_util.h
index 71badb3..23a8dad 100644
--- a/chrome/browser/sync/js_test_util.h
+++ b/chrome/browser/sync/js_test_util.h
@@ -37,6 +37,9 @@ void PrintTo(const JsArgList& args, ::std::ostream* os);
class MockJsBackend : public JsBackend {
public:
+ MockJsBackend();
+ ~MockJsBackend();
+
MOCK_METHOD1(SetParentJsEventRouter, void(JsEventRouter*));
MOCK_METHOD0(RemoveParentJsEventRouter, void());
MOCK_CONST_METHOD0(GetParentJsEventRouter, const JsEventRouter*());
@@ -46,6 +49,9 @@ class MockJsBackend : public JsBackend {
class MockJsFrontend : public JsFrontend {
public:
+ MockJsFrontend();
+ ~MockJsFrontend();
+
MOCK_METHOD1(AddHandler, void(JsEventHandler*));
MOCK_METHOD1(RemoveHandler, void(JsEventHandler*));
MOCK_METHOD3(ProcessMessage,
@@ -55,11 +61,17 @@ class MockJsFrontend : public JsFrontend {
class MockJsEventHandler : public JsEventHandler {
public:
+ MockJsEventHandler();
+ ~MockJsEventHandler();
+
MOCK_METHOD2(HandleJsEvent, void(const ::std::string&, const JsArgList&));
};
class MockJsEventRouter : public JsEventRouter {
public:
+ MockJsEventRouter();
+ ~MockJsEventRouter();
+
MOCK_METHOD3(RouteJsEvent,
void(const ::std::string&, const JsArgList&,
const JsEventHandler*));
diff --git a/chrome/browser/tab_contents/test_tab_contents.h b/chrome/browser/tab_contents/test_tab_contents.h
index 21bc096..729730b 100644
--- a/chrome/browser/tab_contents/test_tab_contents.h
+++ b/chrome/browser/tab_contents/test_tab_contents.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -50,8 +50,9 @@ class TestTabContents : public TabContents {
}
// Prevent interaction with views.
- bool CreateRenderViewForRenderManager(RenderViewHost* render_view_host);
- void UpdateRenderViewSizeForRenderManager() {}
+ virtual bool CreateRenderViewForRenderManager(
+ RenderViewHost* render_view_host);
+ virtual void UpdateRenderViewSizeForRenderManager() {}
// Returns a clone of this TestTabContents. The returned object is also a
// TestTabContents. The caller owns the returned object.
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index fb8b576..c2eea8b 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -127,6 +127,8 @@
'test/chrome_process_util.cc',
'test/chrome_process_util.h',
'test/chrome_process_util_mac.cc',
+ 'test/in_process_browser_test.cc',
+ 'test/in_process_browser_test.h',
'test/model_test_utils.cc',
'test/model_test_utils.h',
'test/profile_mock.cc',
@@ -364,8 +366,6 @@
'browser/ui/views/bookmark_bar_view_test.cc',
'browser/ui/views/find_bar_host_interactive_uitest.cc',
'browser/ui/views/tabs/tab_dragging_test.cc',
- 'test/in_process_browser_test.cc',
- 'test/in_process_browser_test.h',
'test/interactive_ui/fast_shutdown_interactive_uitest.cc',
'test/interactive_ui/infobars_uitest.cc',
'test/interactive_ui/keyboard_access_uitest.cc',
@@ -2218,8 +2218,6 @@
'renderer/translate_helper_browsertest.cc',
'test/automation/dom_automation_browsertest.cc',
'test/gpu/gpu_browsertest.cc',
- 'test/in_process_browser_test.cc',
- 'test/in_process_browser_test.h',
'test/out_of_proc_test_runner.cc',
'test/render_view_test.cc',
'test/render_view_test.h',
@@ -2398,8 +2396,6 @@
'sources': [
'app/chrome_dll.rc',
'browser/safe_browsing/safe_browsing_test.cc',
- 'test/in_process_browser_test.cc',
- 'test/in_process_browser_test.h',
'test/out_of_proc_test_runner.cc',
],
'conditions': [
@@ -2918,8 +2914,6 @@
'browser/sessions/session_service_test_helper.cc',
'browser/sync/glue/session_model_associator.cc',
'test/bookmark_load_observer.h',
- 'test/in_process_browser_test.cc',
- 'test/in_process_browser_test.h',
'test/out_of_proc_test_runner.cc',
'test/live_sync/bookmark_model_verifier.cc',
'test/live_sync/bookmark_model_verifier.h',
@@ -3067,8 +3061,6 @@
'defines': [ 'ALLOW_IN_PROC_BROWSER_TEST' ],
'sources': [
'test/gpu/gpu_pixel_browsertest.cc',
- 'test/in_process_browser_test.cc',
- 'test/in_process_browser_test.h',
'test/out_of_proc_test_runner.cc',
],
'conditions': [
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc
index 3b8c6df..06bfe14 100644
--- a/chrome/test/in_process_browser_test.cc
+++ b/chrome/test/in_process_browser_test.cc
@@ -265,6 +265,10 @@ void InProcessBrowserTest::AddTabAtIndex(
AddTabAtIndexToBrowser(browser(), index, url, transition);
}
+bool InProcessBrowserTest::SetUpUserDataDirectory() {
+ return true;
+}
+
// Creates a browser with a single tab (about:blank), waits for the tab to
// finish loading and shows the browser.
Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) {
diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h
index 169ad47..ad82890 100644
--- a/chrome/test/in_process_browser_test.h
+++ b/chrome/test/in_process_browser_test.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -114,7 +114,7 @@ class InProcessBrowserTest : public testing::Test {
// If a test wishes to set up some initial non-empty state in the user data
// directory before the browser starts up, it can do so here. Returns true if
// successful.
- virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT { return true; }
+ virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT;
// We need these special methods because InProcessBrowserTest::SetUp is the
// bottom of the stack that winds up calling your test method, so it is not
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index 00af1d1..e7102df 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -360,22 +360,110 @@ TestingPrefService* TestingProfile::GetTestingPrefService() {
return testing_prefs_;
}
+ProfileId TestingProfile::GetRuntimeId() {
+ return reinterpret_cast<ProfileId>(this);
+ }
+
+bool TestingProfile::IsOffTheRecord() {
+ return off_the_record_;
+}
+
+Profile* TestingProfile::GetOffTheRecordProfile() {
+ return NULL;
+}
+
+bool TestingProfile::HasOffTheRecordProfile() {
+ return false;
+}
+
+Profile* TestingProfile::GetOriginalProfile() {
+ return this;
+}
+
+ChromeAppCacheService* TestingProfile::GetAppCacheService() {
+ return NULL;
+}
+
webkit_database::DatabaseTracker* TestingProfile::GetDatabaseTracker() {
if (!db_tracker_)
db_tracker_ = new webkit_database::DatabaseTracker(GetPath(), false);
return db_tracker_;
}
+VisitedLinkMaster* TestingProfile::GetVisitedLinkMaster() {
+ return NULL;
+}
+
ExtensionService* TestingProfile::GetExtensionService() {
return extensions_service_.get();
}
+UserScriptMaster* TestingProfile::GetUserScriptMaster() {
+ return NULL;
+}
+
+ExtensionDevToolsManager* TestingProfile::GetExtensionDevToolsManager() {
+ return NULL;
+}
+
+ExtensionProcessManager* TestingProfile::GetExtensionProcessManager() {
+ return NULL;
+}
+
+ExtensionMessageService* TestingProfile::GetExtensionMessageService() {
+ return NULL;
+}
+
+ExtensionEventRouter* TestingProfile::GetExtensionEventRouter() {
+ return NULL;
+}
+
+ExtensionIOEventRouter* TestingProfile::GetExtensionIOEventRouter() {
+ return NULL;
+}
+
+SSLHostState* TestingProfile::GetSSLHostState() {
+ return NULL;
+}
+
+net::TransportSecurityState* TestingProfile::GetTransportSecurityState() {
+ return NULL;
+}
+
+FaviconService* TestingProfile::GetFaviconService(ServiceAccessType access) {
+ return favicon_service_.get();
+}
+
+HistoryService* TestingProfile::GetHistoryService(ServiceAccessType access) {
+ return history_service_.get();
+}
+
+HistoryService* TestingProfile::GetHistoryServiceWithoutCreating() {
+ return history_service_.get();
+}
+
net::CookieMonster* TestingProfile::GetCookieMonster() {
if (!GetRequestContext())
return NULL;
return GetRequestContext()->GetCookieStore()->GetCookieMonster();
}
+AutocompleteClassifier* TestingProfile::GetAutocompleteClassifier() {
+ return autocomplete_classifier_.get();
+}
+
+WebDataService* TestingProfile::GetWebDataService(ServiceAccessType access) {
+ return web_data_service_.get();
+}
+
+WebDataService* TestingProfile::GetWebDataServiceWithoutCreating() {
+ return web_data_service_.get();
+}
+
+PasswordStore* TestingProfile::GetPasswordStore(ServiceAccessType access) {
+ return NULL;
+}
+
void TestingProfile::InitThemes() {
if (!created_theme_provider_) {
#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
@@ -388,6 +476,15 @@ void TestingProfile::InitThemes() {
}
}
+const Extension* TestingProfile::GetTheme() {
+ return NULL;
+}
+
+BrowserThemeProvider* TestingProfile::GetThemeProvider() {
+ InitThemes();
+ return theme_provider_.get();
+}
+
void TestingProfile::SetPrefService(PrefService* prefs) {
DCHECK(!prefs_.get());
prefs_.reset(prefs);
@@ -408,10 +505,42 @@ PrefService* TestingProfile::GetPrefs() {
return prefs_.get();
}
+TemplateURLModel* TestingProfile::GetTemplateURLModel() {
+ return template_url_model_.get();
+}
+
+TemplateURLFetcher* TestingProfile::GetTemplateURLFetcher() {
+ return template_url_fetcher_.get();
+}
+
history::TopSites* TestingProfile::GetTopSites() {
return top_sites_.get();
}
+history::TopSites* TestingProfile::GetTopSitesWithoutCreating() {
+ return top_sites_.get();
+}
+
+DownloadManager* TestingProfile::GetDownloadManager() {
+ return NULL;
+}
+
+PersonalDataManager* TestingProfile::GetPersonalDataManager() {
+ return NULL;
+}
+
+fileapi::SandboxedFileSystemContext* TestingProfile::GetFileSystemContext() {
+ return NULL;
+}
+
+BrowserSignin* TestingProfile::GetBrowserSignin() {
+ return NULL;
+}
+
+bool TestingProfile::HasCreatedDownloadManager() const {
+ return false;
+}
+
URLRequestContextGetter* TestingProfile::GetRequestContext() {
return request_context_.get();
}
@@ -425,12 +554,24 @@ void TestingProfile::ResetRequestContext() {
request_context_ = NULL;
}
+URLRequestContextGetter* TestingProfile::GetRequestContextForMedia() {
+ return NULL;
+}
+
URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() {
if (!extensions_request_context_)
extensions_request_context_ = new TestExtensionURLRequestContextGetter();
return extensions_request_context_.get();
}
+net::SSLConfigService* TestingProfile::GetSSLConfigService() {
+ return NULL;
+}
+
+UserStyleSheetWatcher* TestingProfile::GetUserStyleSheetWatcher() {
+ return NULL;
+}
+
FindBarState* TestingProfile::GetFindBarState() {
if (!find_bar_state_.get())
find_bar_state_.reset(new FindBarState());
@@ -461,6 +602,58 @@ TestingProfile::GetGeolocationPermissionContext() {
return geolocation_permission_context_.get();
}
+HostZoomMap* TestingProfile::GetHostZoomMap() {
+ return NULL;
+}
+
+SessionService* TestingProfile::GetSessionService() {
+ return session_service_.get();
+}
+
+bool TestingProfile::HasSessionService() const {
+ return (session_service_.get() != NULL);
+}
+
+bool TestingProfile::HasProfileSyncService() const {
+ return (profile_sync_service_.get() != NULL);
+}
+
+std::wstring TestingProfile::GetName() {
+ return std::wstring();
+}
+
+std::wstring TestingProfile::GetID() {
+ return id_;
+}
+
+void TestingProfile::SetID(const std::wstring& id) {
+ id_ = id;
+}
+
+bool TestingProfile::DidLastSessionExitCleanly() {
+ return last_session_exited_cleanly_;
+}
+
+BookmarkModel* TestingProfile::GetBookmarkModel() {
+ return bookmark_bar_model_.get();
+}
+
+bool TestingProfile::IsSameProfile(Profile *p) {
+ return this == p;
+}
+
+base::Time TestingProfile::GetStartTime() const {
+ return start_time_;
+}
+
+TabRestoreService* TestingProfile::GetTabRestoreService() {
+ return NULL;
+}
+
+SpellCheckHost* TestingProfile::GetSpellCheckHost() {
+ return NULL;
+}
+
void TestingProfile::set_session_service(SessionService* session_service) {
session_service_ = session_service;
}
@@ -471,6 +664,10 @@ WebKitContext* TestingProfile::GetWebKitContext() {
return webkit_context_;
}
+WebKitContext* TestingProfile::GetOffTheRecordWebKitContext() {
+ return NULL;
+}
+
NTPResourceCache* TestingProfile::GetNTPResourceCache() {
if (!ntp_resource_cache_.get())
ntp_resource_cache_.reset(new NTPResourceCache(this));
@@ -486,6 +683,23 @@ DesktopNotificationService* TestingProfile::GetDesktopNotificationService() {
return desktop_notification_service_.get();
}
+BackgroundContentsService*
+TestingProfile::GetBackgroundContentsService() const {
+ return NULL;
+}
+
+StatusTray* TestingProfile::GetStatusTray() {
+ return NULL;
+}
+
+FilePath TestingProfile::last_selected_directory() {
+ return last_selected_directory_;
+}
+
+void TestingProfile::set_last_selected_directory(const FilePath& path) {
+ last_selected_directory_ = path;
+}
+
PrefProxyConfigTracker* TestingProfile::GetProxyConfigTracker() {
if (!pref_proxy_config_tracker_)
pref_proxy_config_tracker_ = new PrefProxyConfigTracker(GetPrefs());
@@ -525,6 +739,34 @@ ProfileSyncService* TestingProfile::GetProfileSyncService(
return profile_sync_service_.get();
}
+CloudPrintProxyService* TestingProfile::GetCloudPrintProxyService() {
+ return NULL;
+}
+
+ChromeBlobStorageContext* TestingProfile::GetBlobStorageContext() {
+ return NULL;
+}
+
+ExtensionInfoMap* TestingProfile::GetExtensionInfoMap() {
+ return NULL;
+}
+
+PromoCounter* TestingProfile::GetInstantPromoCounter() {
+ return NULL;
+}
+
+policy::ProfilePolicyContext* TestingProfile::GetPolicyContext() {
+ return NULL;
+}
+
+PrerenderManager* TestingProfile::GetPrerenderManager() {
+ return NULL;
+}
+
+PrefService* TestingProfile::GetOffTheRecordPrefs() {
+ return NULL;
+}
+
void TestingProfile::DestroyWebDataService() {
if (!web_data_service_.get())
return;
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index fc561d4..ee16eb6 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -121,9 +121,7 @@ class TestingProfile : public Profile {
TestingPrefService* GetTestingPrefService();
- virtual ProfileId GetRuntimeId() {
- return reinterpret_cast<ProfileId>(this);
- }
+ virtual ProfileId GetRuntimeId();
virtual FilePath GetPath();
@@ -131,39 +129,29 @@ class TestingProfile : public Profile {
void set_off_the_record(bool off_the_record) {
off_the_record_ = off_the_record;
}
- virtual bool IsOffTheRecord() { return off_the_record_; }
- virtual Profile* GetOffTheRecordProfile() { return NULL; }
+ virtual bool IsOffTheRecord();
+ virtual Profile* GetOffTheRecordProfile();
virtual void DestroyOffTheRecordProfile() {}
- virtual bool HasOffTheRecordProfile() { return false; }
+ virtual bool HasOffTheRecordProfile();
- virtual Profile* GetOriginalProfile() { return this; }
- virtual ChromeAppCacheService* GetAppCacheService() { return NULL; }
+ virtual Profile* GetOriginalProfile();
+ virtual ChromeAppCacheService* GetAppCacheService();
virtual webkit_database::DatabaseTracker* GetDatabaseTracker();
- virtual VisitedLinkMaster* GetVisitedLinkMaster() { return NULL; }
+ virtual VisitedLinkMaster* GetVisitedLinkMaster();
virtual ExtensionService* GetExtensionService();
- virtual UserScriptMaster* GetUserScriptMaster() { return NULL; }
- virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() {
- return NULL;
- }
- virtual ExtensionProcessManager* GetExtensionProcessManager() { return NULL; }
- virtual ExtensionMessageService* GetExtensionMessageService() { return NULL; }
- virtual ExtensionEventRouter* GetExtensionEventRouter() { return NULL; }
- virtual ExtensionIOEventRouter* GetExtensionIOEventRouter() { return NULL; }
- virtual SSLHostState* GetSSLHostState() { return NULL; }
- virtual net::TransportSecurityState* GetTransportSecurityState() {
- return NULL;
- }
- virtual FaviconService* GetFaviconService(ServiceAccessType access) {
- return favicon_service_.get();
- }
- virtual HistoryService* GetHistoryService(ServiceAccessType access) {
- return history_service_.get();
- }
- virtual HistoryService* GetHistoryServiceWithoutCreating() {
- return history_service_.get();
- }
+ virtual UserScriptMaster* GetUserScriptMaster();
+ virtual ExtensionDevToolsManager* GetExtensionDevToolsManager();
+ virtual ExtensionProcessManager* GetExtensionProcessManager();
+ virtual ExtensionMessageService* GetExtensionMessageService();
+ virtual ExtensionEventRouter* GetExtensionEventRouter();
+ virtual ExtensionIOEventRouter* GetExtensionIOEventRouter();
+ virtual SSLHostState* GetSSLHostState();
+ virtual net::TransportSecurityState* GetTransportSecurityState();
+ virtual FaviconService* GetFaviconService(ServiceAccessType access);
+ virtual HistoryService* GetHistoryService(ServiceAccessType access);
+ virtual HistoryService* GetHistoryServiceWithoutCreating();
void set_has_history_service(bool has_history_service) {
has_history_service_ = has_history_service;
}
@@ -171,50 +159,31 @@ class TestingProfile : public Profile {
// this by calling CreateRequestContext(). See the note at GetRequestContext
// for more information.
net::CookieMonster* GetCookieMonster();
- virtual AutocompleteClassifier* GetAutocompleteClassifier() {
- return autocomplete_classifier_.get();
- }
- virtual WebDataService* GetWebDataService(ServiceAccessType access) {
- return web_data_service_.get();
- }
- virtual WebDataService* GetWebDataServiceWithoutCreating() {
- return web_data_service_.get();
- }
- virtual PasswordStore* GetPasswordStore(ServiceAccessType access) {
- return NULL;
- }
+ virtual AutocompleteClassifier* GetAutocompleteClassifier();
+ virtual WebDataService* GetWebDataService(ServiceAccessType access);
+ virtual WebDataService* GetWebDataServiceWithoutCreating();
+ virtual PasswordStore* GetPasswordStore(ServiceAccessType access);
// Sets the profile's PrefService. If a pref service hasn't been explicitly
// set GetPrefs creates one, so normally you need not invoke this. If you need
// to set a pref service you must invoke this before GetPrefs.
// TestingPrefService takes ownership of |prefs|.
void SetPrefService(PrefService* prefs);
virtual PrefService* GetPrefs();
- virtual TemplateURLModel* GetTemplateURLModel() {
- return template_url_model_.get();
- }
- virtual TemplateURLFetcher* GetTemplateURLFetcher() {
- return template_url_fetcher_.get();
- }
+ virtual TemplateURLModel* GetTemplateURLModel();
+ virtual TemplateURLFetcher* GetTemplateURLFetcher();
virtual history::TopSites* GetTopSites();
- virtual history::TopSites* GetTopSitesWithoutCreating() {
- return top_sites_.get();
- }
- virtual DownloadManager* GetDownloadManager() { return NULL; }
- virtual PersonalDataManager* GetPersonalDataManager() { return NULL; }
- virtual fileapi::SandboxedFileSystemContext* GetFileSystemContext() {
- return NULL;
- }
- virtual BrowserSignin* GetBrowserSignin() { return NULL; }
- virtual bool HasCreatedDownloadManager() const { return false; }
+ virtual history::TopSites* GetTopSitesWithoutCreating();
+ virtual DownloadManager* GetDownloadManager();
+ virtual PersonalDataManager* GetPersonalDataManager();
+ virtual fileapi::SandboxedFileSystemContext* GetFileSystemContext();
+ virtual BrowserSignin* GetBrowserSignin();
+ virtual bool HasCreatedDownloadManager() const;
virtual void InitThemes();
virtual void SetTheme(const Extension* extension) {}
virtual void SetNativeTheme() {}
virtual void ClearTheme() {}
- virtual const Extension* GetTheme() { return NULL; }
- virtual BrowserThemeProvider* GetThemeProvider() {
- InitThemes();
- return theme_provider_.get();
- }
+ virtual const Extension* GetTheme();
+ virtual BrowserThemeProvider* GetThemeProvider();
// Returns a testing ContextGetter (if one has been created via
// CreateRequestContext) or NULL. This is not done on-demand for two reasons:
@@ -230,68 +199,52 @@ class TestingProfile : public Profile {
// down the IO thread to avoid leaks).
void ResetRequestContext();
- virtual URLRequestContextGetter* GetRequestContextForMedia() { return NULL; }
+ virtual URLRequestContextGetter* GetRequestContextForMedia();
virtual URLRequestContextGetter* GetRequestContextForExtensions();
- virtual net::SSLConfigService* GetSSLConfigService() { return NULL; }
- virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { return NULL; }
+ virtual net::SSLConfigService* GetSSLConfigService();
+ virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher();
virtual FindBarState* GetFindBarState();
virtual HostContentSettingsMap* GetHostContentSettingsMap();
virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap();
virtual GeolocationPermissionContext* GetGeolocationPermissionContext();
- virtual HostZoomMap* GetHostZoomMap() { return NULL; }
+ virtual HostZoomMap* GetHostZoomMap();
void set_session_service(SessionService* session_service);
- virtual SessionService* GetSessionService() { return session_service_.get(); }
+ virtual SessionService* GetSessionService();
virtual void ShutdownSessionService() {}
- virtual bool HasSessionService() const {
- return (session_service_.get() != NULL);
- }
- virtual bool HasProfileSyncService() const {
- return (profile_sync_service_.get() != NULL);
- }
- virtual std::wstring GetName() { return std::wstring(); }
+ virtual bool HasSessionService() const;
+ virtual bool HasProfileSyncService() const;
+ virtual std::wstring GetName();
virtual void SetName(const std::wstring& name) {}
- virtual std::wstring GetID() { return id_; }
- virtual void SetID(const std::wstring& id) { id_ = id; }
+ virtual std::wstring GetID();
+ virtual void SetID(const std::wstring& id);
void set_last_session_exited_cleanly(bool value) {
last_session_exited_cleanly_ = value;
}
- virtual bool DidLastSessionExitCleanly() {
- return last_session_exited_cleanly_;
- }
+ virtual bool DidLastSessionExitCleanly();
virtual void MergeResourceString(int message_id,
std::wstring* output_string) {}
virtual void MergeResourceInteger(int message_id, int* output_value) {}
virtual void MergeResourceBoolean(int message_id, bool* output_value) {}
- virtual BookmarkModel* GetBookmarkModel() {
- return bookmark_bar_model_.get();
- }
- virtual bool IsSameProfile(Profile *p) { return this == p; }
- virtual base::Time GetStartTime() const { return start_time_; }
- virtual TabRestoreService* GetTabRestoreService() { return NULL; }
+ virtual BookmarkModel* GetBookmarkModel();
+ virtual bool IsSameProfile(Profile *p);
+ virtual base::Time GetStartTime() const;
+ virtual TabRestoreService* GetTabRestoreService();
virtual void ResetTabRestoreService() {}
- virtual SpellCheckHost* GetSpellCheckHost() { return NULL; }
+ virtual SpellCheckHost* GetSpellCheckHost();
virtual void ReinitializeSpellCheckHost(bool force) { }
virtual WebKitContext* GetWebKitContext();
- virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; }
+ virtual WebKitContext* GetOffTheRecordWebKitContext();
virtual void MarkAsCleanShutdown() {}
virtual void InitExtensions() {}
virtual void InitWebResources() {}
virtual NTPResourceCache* GetNTPResourceCache();
virtual DesktopNotificationService* GetDesktopNotificationService();
- virtual BackgroundContentsService* GetBackgroundContentsService() const {
- return NULL;
- }
- virtual StatusTray* GetStatusTray() {
- return NULL;
- }
- virtual FilePath last_selected_directory() {
- return last_selected_directory_;
- }
- virtual void set_last_selected_directory(const FilePath& path) {
- last_selected_directory_ = path;
- }
+ virtual BackgroundContentsService* GetBackgroundContentsService() const;
+ virtual StatusTray* GetStatusTray();
+ virtual FilePath last_selected_directory();
+ virtual void set_last_selected_directory(const FilePath& path);
#if defined(OS_CHROMEOS)
virtual chromeos::ProxyConfigServiceImpl*
GetChromeOSProxyConfigServiceImpl() {
@@ -315,13 +268,13 @@ class TestingProfile : public Profile {
virtual ProfileSyncService* GetProfileSyncService();
virtual ProfileSyncService* GetProfileSyncService(
const std::string& cros_notes);
- virtual CloudPrintProxyService* GetCloudPrintProxyService() { return NULL; }
- virtual ChromeBlobStorageContext* GetBlobStorageContext() { return NULL; }
- virtual ExtensionInfoMap* GetExtensionInfoMap() { return NULL; }
- virtual PromoCounter* GetInstantPromoCounter() { return NULL; }
- virtual policy::ProfilePolicyContext* GetPolicyContext() { return NULL; }
- virtual PrerenderManager* GetPrerenderManager() { return NULL; }
- virtual PrefService* GetOffTheRecordPrefs() { return NULL; }
+ virtual CloudPrintProxyService* GetCloudPrintProxyService();
+ virtual ChromeBlobStorageContext* GetBlobStorageContext();
+ virtual ExtensionInfoMap* GetExtensionInfoMap();
+ virtual PromoCounter* GetInstantPromoCounter();
+ virtual policy::ProfilePolicyContext* GetPolicyContext();
+ virtual PrerenderManager* GetPrerenderManager();
+ virtual PrefService* GetOffTheRecordPrefs();
protected:
base::Time start_time_;
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 7161942..2424006 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -169,6 +169,10 @@ ProxyLauncher* UITestBase::CreateProxyLauncher() {
return new AnonymousProxyLauncher(false);
}
+bool UITestBase::ShouldFilterInet() {
+ return true;
+}
+
void UITestBase::SetLaunchSwitches() {
// We need cookies on file:// for things like the page cycler.
if (enable_file_cookies_)
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 989f760..5901a87 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -284,9 +284,7 @@ class UITestBase {
return state;
}
- virtual bool ShouldFilterInet() {
- return true;
- }
+ virtual bool ShouldFilterInet();
// Extra command-line switches that need to be passed to the browser are
// added in this function. Add new command-line switches here.
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc
index 873bfe1..436273b 100644
--- a/chrome/test/ui_test_utils.cc
+++ b/chrome/test/ui_test_utils.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -873,6 +873,20 @@ TestWebSocketServer::~TestWebSocketServer() {
base::LaunchApp(*cmd_line.get(), true, false, NULL);
}
+TestNotificationObserver::TestNotificationObserver()
+ : source_(NotificationService::AllSources()) {
+}
+
+TestNotificationObserver::~TestNotificationObserver() {}
+
+void TestNotificationObserver::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ source_ = source;
+ details_ = details;
+ MessageLoopForUI::current()->Quit();
+}
+
WindowedNotificationObserver::WindowedNotificationObserver(
NotificationType notification_type,
const NotificationSource& source)
@@ -882,6 +896,8 @@ WindowedNotificationObserver::WindowedNotificationObserver(
registrar_.Add(this, notification_type, waiting_for_);
}
+WindowedNotificationObserver::~WindowedNotificationObserver() {}
+
void WindowedNotificationObserver::Wait() {
if (waiting_for_ == NotificationService::AllSources()) {
LOG(FATAL) << "Wait called when monitoring all sources. You must use "
@@ -926,6 +942,8 @@ DOMMessageQueue::DOMMessageQueue() {
NotificationService::AllSources());
}
+DOMMessageQueue::~DOMMessageQueue() {}
+
void DOMMessageQueue::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h
index 97fe557..dc00afa 100644
--- a/chrome/test/ui_test_utils.h
+++ b/chrome/test/ui_test_utils.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -358,16 +358,8 @@ class TestWebSocketServer {
// is received. It also records the source and details of the notification.
class TestNotificationObserver : public NotificationObserver {
public:
- TestNotificationObserver() : source_(NotificationService::AllSources()) {
- }
-
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- source_ = source;
- details_ = details;
- MessageLoopForUI::current()->Quit();
- }
+ TestNotificationObserver();
+ virtual ~TestNotificationObserver();
const NotificationSource& source() const {
return source_;
@@ -377,6 +369,11 @@ class TestNotificationObserver : public NotificationObserver {
return details_;
}
+ // NotificationObserver:
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
private:
NotificationSource source_;
NotificationDetails details_;
@@ -401,6 +398,7 @@ class WindowedNotificationObserver : public NotificationObserver {
* NotificationService::AllSources(). */
WindowedNotificationObserver(NotificationType notification_type,
const NotificationSource& source);
+ virtual ~WindowedNotificationObserver();
/* Wait until the specified notification occurs. You must have specified a
* source in the arguments to the constructor in order to use this function.
@@ -425,6 +423,7 @@ class WindowedNotificationObserver : public NotificationObserver {
*/
void WaitFor(const NotificationSource& source);
+ // NotificationObserver:
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
@@ -529,6 +528,7 @@ class DOMMessageQueue : public NotificationObserver {
// DOMAutomationController. Do not construct this until the browser has
// started.
DOMMessageQueue();
+ virtual ~DOMMessageQueue();
// Wait for the next message to arrive. |message| will be set to the next
// message, if not null. Returns true on success.
diff --git a/media/audio/test_audio_input_controller_factory.h b/media/audio/test_audio_input_controller_factory.h
index 382626d..3339a23 100644
--- a/media/audio/test_audio_input_controller_factory.h
+++ b/media/audio/test_audio_input_controller_factory.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -72,7 +72,7 @@ class TestAudioInputControllerFactory : public AudioInputController::Factory {
TestAudioInputControllerFactory();
// AudioInputController::Factory methods.
- AudioInputController* Create(
+ virtual AudioInputController* Create(
AudioInputController::EventHandler* event_handler,
AudioParameters params);
diff --git a/webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc
index 09d6bdc..e045ba0 100644
--- a/webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc
+++ b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc
@@ -4,6 +4,7 @@
#include "webkit/plugins/npapi/test/plugin_create_instance_in_paint.h"
+#include "base/logging.h"
#include "webkit/plugins/npapi/test/plugin_client.h"
namespace NPAPIClient {
diff --git a/webkit/plugins/npapi/test/plugin_geturl_test.cc b/webkit/plugins/npapi/test/plugin_geturl_test.cc
index 850a0b5..16506bb 100644
--- a/webkit/plugins/npapi/test/plugin_geturl_test.cc
+++ b/webkit/plugins/npapi/test/plugin_geturl_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/file_util.h"
#include "base/string_number_conversions.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
// url for "self". The %22%22 is to make a statement for javascript to
@@ -50,6 +51,8 @@ PluginGetURLTest::PluginGetURLTest(NPP id, NPNetscapeFuncs *host_functions)
received_url_redirect_notification_(false) {
}
+PluginGetURLTest::~PluginGetURLTest() {}
+
NPError PluginGetURLTest::New(uint16 mode, int16 argc, const char* argn[],
const char* argv[], NPSavedData* saved) {
const char* page_not_found_url = GetArgValue("page_not_found_url", argc,
diff --git a/webkit/plugins/npapi/test/plugin_geturl_test.h b/webkit/plugins/npapi/test/plugin_geturl_test.h
index 79c623b..1e7cc9b 100644
--- a/webkit/plugins/npapi/test/plugin_geturl_test.h
+++ b/webkit/plugins/npapi/test/plugin_geturl_test.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -21,6 +21,7 @@ class PluginGetURLTest : public PluginTest {
public:
// Constructor.
PluginGetURLTest(NPP id, NPNetscapeFuncs *host_functions);
+ virtual ~PluginGetURLTest();
//
// NPAPI functions
diff --git a/webkit/plugins/npapi/test/plugin_javascript_open_popup.cc b/webkit/plugins/npapi/test/plugin_javascript_open_popup.cc
index 468b8d5..2a23ea5 100644
--- a/webkit/plugins/npapi/test/plugin_javascript_open_popup.cc
+++ b/webkit/plugins/npapi/test/plugin_javascript_open_popup.cc
@@ -1,10 +1,12 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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 "build/build_config.h"
#include "webkit/plugins/npapi/test/plugin_javascript_open_popup.h"
+#include "build/build_config.h"
+#include "base/logging.h"
+
#if defined(USE_X11)
#include "third_party/npapi/bindings/npapi_x11.h"
#endif
diff --git a/webkit/plugins/npapi/test/plugin_schedule_timer_test.cc b/webkit/plugins/npapi/test/plugin_schedule_timer_test.cc
index 831ab29..82725ee 100644
--- a/webkit/plugins/npapi/test/plugin_schedule_timer_test.cc
+++ b/webkit/plugins/npapi/test/plugin_schedule_timer_test.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "webkit/plugins/npapi/test/plugin_schedule_timer_test.h"
+
+#include "base/logging.h"
#include "webkit/plugins/npapi/test/plugin_client.h"
using base::Time;
diff --git a/webkit/plugins/npapi/test/plugin_test.cc b/webkit/plugins/npapi/test/plugin_test.cc
index c948010..ae7908b 100644
--- a/webkit/plugins/npapi/test/plugin_test.cc
+++ b/webkit/plugins/npapi/test/plugin_test.cc
@@ -4,6 +4,7 @@
#include "webkit/plugins/npapi/test/plugin_test.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "webkit/plugins/npapi/test/npapi_constants.h"
@@ -16,6 +17,10 @@ PluginTest::PluginTest(NPP id, NPNetscapeFuncs *host_functions) {
test_completed_ = false;
}
+PluginTest::~PluginTest() {}
+
+bool PluginTest::IsWindowless() const { return false; }
+
NPError PluginTest::New(uint16 mode, int16 argc, const char* argn[],
const char* argv[], NPSavedData* saved) {
test_name_ = this->GetArgValue("name", argc, argn, argv);
@@ -112,6 +117,43 @@ void PluginTest::SetError(const std::string &msg) {
test_status_.append(msg);
}
+void PluginTest::ExpectStringLowerCaseEqual(const std::string &val1,
+ const std::string &val2) {
+ if (!LowerCaseEqualsASCII(val1, val2.c_str())) {
+ std::string err;
+ err = "Expected Equal for '";
+ err.append(val1);
+ err.append("' and '");
+ err.append(val2);
+ err.append("'");
+ SetError(err);
+ }
+}
+
+void PluginTest::ExpectAsciiStringNotEqual(const char *val1, const char *val2) {
+ if (val1 == val2) {
+ std::string err;
+ err = "Expected Not Equal for '";
+ err.append(val1);
+ err.append("' and '");
+ err.append(val2);
+ err.append("'");
+ SetError(err);
+ }
+}
+
+void PluginTest::ExpectIntegerEqual(int val1, int val2) {
+ if (val1 != val2) {
+ std::string err;
+ err = "Expected Equal for '";
+ err.append(base::IntToString(val1));
+ err.append("' and '");
+ err.append(base::IntToString(val2));
+ err.append("'");
+ SetError(err);
+ }
+}
+
NPError PluginTest::NewStream(NPMIMEType type, NPStream* stream,
NPBool seekable, uint16* stype) {
// There is no default action here.
diff --git a/webkit/plugins/npapi/test/plugin_test.h b/webkit/plugins/npapi/test/plugin_test.h
index fee09d3..f600946 100644
--- a/webkit/plugins/npapi/test/plugin_test.h
+++ b/webkit/plugins/npapi/test/plugin_test.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -7,8 +7,6 @@
#include <string>
-#include "base/string_number_conversions.h"
-#include "base/string_util.h"
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/nphostapi.h"
@@ -22,10 +20,10 @@ class PluginTest {
PluginTest(NPP id, NPNetscapeFuncs *host_functions);
// Destructor
- virtual ~PluginTest() {}
+ virtual ~PluginTest();
// Returns true if the test runs in windowless plugin mode.
- virtual bool IsWindowless() const { return false; }
+ virtual bool IsWindowless() const;
//
// NPAPI Functions
@@ -45,6 +43,7 @@ class PluginTest {
virtual int16 HandleEvent(void* event);
virtual void URLRedirectNotify(const char* url, int32_t status,
void* notify_data);
+
// Returns true if the test has not had any errors.
bool Succeeded() { return test_status_.length() == 0; }
@@ -54,45 +53,16 @@ class PluginTest {
// Expect two string values are equal, and if not, logs an
// appropriate error about it.
- void ExpectStringLowerCaseEqual(const std::string &val1, const std::string &val2) {
- if (!LowerCaseEqualsASCII(val1, val2.c_str())) {
- std::string err;
- err = "Expected Equal for '";
- err.append(val1);
- err.append("' and '");
- err.append(val2);
- err.append("'");
- SetError(err);
- }
- };
+ void ExpectStringLowerCaseEqual(const std::string &val1,
+ const std::string &val2);
// Expect two values to not be equal, and if they are
// logs an appropriate error about it.
- void ExpectAsciiStringNotEqual(const char *val1, const char *val2) {
- if (val1 == val2) {
- std::string err;
- err = "Expected Not Equal for '";
- err.append(val1);
- err.append("' and '");
- err.append(val2);
- err.append("'");
- SetError(err);
- }
- }
+ void ExpectAsciiStringNotEqual(const char *val1, const char *val2);
+
// Expect two integer values are equal, and if not, logs an
// appropriate error about it.
- void ExpectIntegerEqual(int val1, int val2) {
- if (val1 != val2) {
- std::string err;
- err = "Expected Equal for '";
- err.append(base::IntToString(val1));
- err.append("' and '");
- err.append(base::IntToString(val2));
- err.append("'");
- SetError(err);
- }
- }
-
+ void ExpectIntegerEqual(int val1, int val2);
protected:
// Signals to the Test that invoked us that the test is
diff --git a/webkit/plugins/npapi/test/plugin_thread_async_call_test.cc b/webkit/plugins/npapi/test/plugin_thread_async_call_test.cc
index 724badc..ecf8759 100644
--- a/webkit/plugins/npapi/test/plugin_thread_async_call_test.cc
+++ b/webkit/plugins/npapi/test/plugin_thread_async_call_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -8,6 +8,7 @@
#include "webkit/plugins/npapi/test/plugin_thread_async_call_test.h"
#include "base/message_loop.h"
+#include "base/string_util.h"
#include "base/threading/thread.h"
#include "webkit/plugins/npapi/test/plugin_client.h"
diff --git a/webkit/plugins/npapi/test/plugin_windowed_test.cc b/webkit/plugins/npapi/test/plugin_windowed_test.cc
index 5635ec5..76890d1e 100644
--- a/webkit/plugins/npapi/test/plugin_windowed_test.cc
+++ b/webkit/plugins/npapi/test/plugin_windowed_test.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "webkit/plugins/npapi/test/plugin_windowed_test.h"
+
+#include "base/logging.h"
#include "webkit/plugins/npapi/test/plugin_client.h"
namespace NPAPIClient {
diff --git a/webkit/plugins/npapi/test/plugin_windowless_test.cc b/webkit/plugins/npapi/test/plugin_windowless_test.cc
index 17b9ca7..411f026 100644
--- a/webkit/plugins/npapi/test/plugin_windowless_test.cc
+++ b/webkit/plugins/npapi/test/plugin_windowless_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -58,6 +58,10 @@ static bool IsWindowActivationEvent(NPEvent* np_event) {
#endif
}
+bool WindowlessPluginTest::IsWindowless() const {
+ return true;
+}
+
int16 WindowlessPluginTest::HandleEvent(void* event) {
NPNetscapeFuncs* browser = NPAPIClient::PluginClient::HostFunctions();
diff --git a/webkit/plugins/npapi/test/plugin_windowless_test.h b/webkit/plugins/npapi/test/plugin_windowless_test.h
index 6f5ce15..f5f6c7b 100644
--- a/webkit/plugins/npapi/test/plugin_windowless_test.h
+++ b/webkit/plugins/npapi/test/plugin_windowless_test.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -17,7 +17,7 @@ class WindowlessPluginTest : public PluginTest {
WindowlessPluginTest(NPP id, NPNetscapeFuncs *host_functions);
// These tests run in windowless plugin mode.
- virtual bool IsWindowless() const { return true; }
+ virtual bool IsWindowless() const;
// NPAPI HandleEvent handler
virtual int16 HandleEvent(void* event);
diff --git a/webkit/tools/test_shell/accessibility_ui_element.cc b/webkit/tools/test_shell/accessibility_ui_element.cc
index 6c34081..e1a9d1c 100644
--- a/webkit/tools/test_shell/accessibility_ui_element.cc
+++ b/webkit/tools/test_shell/accessibility_ui_element.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -304,11 +304,17 @@ AccessibilityUIElement::AccessibilityUIElement(
BindFallbackMethod(&AccessibilityUIElement::FallbackCallback);
}
+AccessibilityUIElement::~AccessibilityUIElement() {}
+
AccessibilityUIElement* AccessibilityUIElement::GetChildAtIndex(
unsigned index) {
return factory_->Create(accessibility_object().childAt(index));
}
+bool AccessibilityUIElement::IsRoot() const {
+ return false;
+}
+
void AccessibilityUIElement::AllAttributesCallback(
const CppArgumentList& args, CppVariant* result) {
result->Set(GetAttributes(accessibility_object()));
@@ -510,10 +516,12 @@ void AccessibilityUIElement::TitleGetterCallback(CppVariant* result) {
result->Set(GetTitle(accessibility_object()));
}
-
RootAccessibilityUIElement::RootAccessibilityUIElement(
const WebKit::WebAccessibilityObject &object,
- Factory *factory) : AccessibilityUIElement(object, factory) { }
+ Factory *factory)
+ : AccessibilityUIElement(object, factory) {}
+
+RootAccessibilityUIElement::~RootAccessibilityUIElement() {}
AccessibilityUIElement* RootAccessibilityUIElement::GetChildAtIndex(
unsigned index) {
@@ -523,8 +531,13 @@ AccessibilityUIElement* RootAccessibilityUIElement::GetChildAtIndex(
return factory()->Create(accessibility_object());
}
+bool RootAccessibilityUIElement::IsRoot() const {
+ return true;
+}
+
+AccessibilityUIElementList::AccessibilityUIElementList() {}
-AccessibilityUIElementList ::~AccessibilityUIElementList() {
+AccessibilityUIElementList::~AccessibilityUIElementList() {
Clear();
}
diff --git a/webkit/tools/test_shell/accessibility_ui_element.h b/webkit/tools/test_shell/accessibility_ui_element.h
index 8e3d877..7786424 100644
--- a/webkit/tools/test_shell/accessibility_ui_element.h
+++ b/webkit/tools/test_shell/accessibility_ui_element.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -20,9 +20,10 @@ class AccessibilityUIElement : public CppBoundClass {
AccessibilityUIElement(
const WebKit::WebAccessibilityObject& accessibility_object,
Factory* factory);
+ virtual ~AccessibilityUIElement();
virtual AccessibilityUIElement* GetChildAtIndex(unsigned index);
- virtual bool IsRoot() const { return false; }
+ virtual bool IsRoot() const;
protected:
const WebKit::WebAccessibilityObject& accessibility_object() const {
@@ -111,9 +112,10 @@ class RootAccessibilityUIElement : public AccessibilityUIElement {
RootAccessibilityUIElement(
const WebKit::WebAccessibilityObject& accessibility_object,
Factory* factory);
+ virtual ~RootAccessibilityUIElement();
virtual AccessibilityUIElement* GetChildAtIndex(unsigned index);
- virtual bool IsRoot() const { return true; }
+ virtual bool IsRoot() const;
};
@@ -122,7 +124,7 @@ class RootAccessibilityUIElement : public AccessibilityUIElement {
// a list and cleared explicitly.
class AccessibilityUIElementList : public AccessibilityUIElement::Factory {
public:
- AccessibilityUIElementList() { }
+ AccessibilityUIElementList();
virtual ~AccessibilityUIElementList();
void Clear();
diff --git a/webkit/tools/test_shell/notification_presenter.cc b/webkit/tools/test_shell/notification_presenter.cc
index 1c9be39..1628f47 100644
--- a/webkit/tools/test_shell/notification_presenter.cc
+++ b/webkit/tools/test_shell/notification_presenter.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -28,6 +28,16 @@ void DeferredDisplayDispatch(WebNotification notification) {
}
}
+TestNotificationPresenter::TestNotificationPresenter(TestShell* shell)
+ : shell_(shell) {
+}
+
+TestNotificationPresenter::~TestNotificationPresenter() {}
+
+void TestNotificationPresenter::Reset() {
+ allowed_origins_.clear();
+}
+
void TestNotificationPresenter::grantPermission(const std::string& origin) {
// Make sure it's in the form of an origin.
GURL url(origin);
diff --git a/webkit/tools/test_shell/notification_presenter.h b/webkit/tools/test_shell/notification_presenter.h
index 7c0ff69..7a69a1b 100644
--- a/webkit/tools/test_shell/notification_presenter.h
+++ b/webkit/tools/test_shell/notification_presenter.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -15,9 +15,10 @@
// A class that implements NotificationPresenter for the test shell.
class TestNotificationPresenter : public WebKit::WebNotificationPresenter {
public:
- explicit TestNotificationPresenter(TestShell* shell)
- : shell_(shell) {
- }
+ explicit TestNotificationPresenter(TestShell* shell);
+ virtual ~TestNotificationPresenter();
+
+ void Reset();
// Called by the LayoutTestController to simulate a user granting
// permission.
@@ -31,10 +32,6 @@ class TestNotificationPresenter : public WebKit::WebNotificationPresenter {
virtual void requestPermission(const WebKit::WebSecurityOrigin& origin,
WebKit::WebNotificationPermissionCallback* callback);
- void Reset() {
- allowed_origins_.clear();
- }
-
private:
// Non-owned pointer. The NotificationPresenter is owned by the test shell.
TestShell* shell_;
diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi
index 935d339..36b3b24 100644
--- a/webkit/tools/test_shell/test_shell.gypi
+++ b/webkit/tools/test_shell/test_shell.gypi
@@ -95,6 +95,7 @@
'test_shell_webthemecontrol.cc',
'test_shell_webthemeengine.h',
'test_shell_webthemeengine.cc',
+ 'test_web_worker.cc',
'test_web_worker.h',
'test_webview_delegate.cc',
'test_webview_delegate.h',
diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.cc b/webkit/tools/test_shell/test_shell_devtools_agent.cc
index 19673d8..7dcb9dc 100644
--- a/webkit/tools/test_shell/test_shell_devtools_agent.cc
+++ b/webkit/tools/test_shell/test_shell_devtools_agent.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -74,6 +74,10 @@ void TestShellDevToolsAgent::sendMessageToInspectorFrontend(
dev_tools_client_->AsyncCall(TestShellDevToolsCallArgs(data));
}
+int TestShellDevToolsAgent::hostIdentifier() {
+ return routing_id_;
+}
+
void TestShellDevToolsAgent::runtimePropertyChanged(
const WebKit::WebString& name,
const WebKit::WebString& value) {
diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.h b/webkit/tools/test_shell/test_shell_devtools_agent.h
index b69b3378..274f950 100644
--- a/webkit/tools/test_shell/test_shell_devtools_agent.h
+++ b/webkit/tools/test_shell/test_shell_devtools_agent.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -21,7 +21,6 @@ class TestShellDevToolsCallArgs;
class TestShellDevToolsClient;
class TestShellDevToolsAgent : public WebKit::WebDevToolsAgentClient {
-
public:
TestShellDevToolsAgent();
virtual ~TestShellDevToolsAgent();
@@ -31,7 +30,7 @@ class TestShellDevToolsAgent : public WebKit::WebDevToolsAgentClient {
// WebDevToolsAgentClient implementation.
virtual void sendMessageToInspectorFrontend(
const WebKit::WebString& data);
- virtual int hostIdentifier() { return routing_id_; }
+ virtual int hostIdentifier();
virtual void runtimePropertyChanged(const WebKit::WebString& name,
const WebKit::WebString& value);
virtual WebKit::WebCString debuggerScriptSource();
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.cc b/webkit/tools/test_shell/test_shell_webkit_init.cc
index 0a91513..9e05ca5 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.cc
+++ b/webkit/tools/test_shell/test_shell_webkit_init.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -90,6 +90,10 @@ TestShellWebKitInit::~TestShellWebKitInit() {
WebKit::shutdown();
}
+WebKit::WebMimeRegistry* TestShellWebKitInit::mimeRegistry() {
+ return mime_registry_.get();
+}
+
WebKit::WebClipboard* TestShellWebKitInit::clipboard() {
// Mock out clipboard calls in layout test mode so that tests don't mess
// with each other's copies/pastes when running in parallel.
@@ -100,6 +104,71 @@ WebKit::WebClipboard* TestShellWebKitInit::clipboard() {
}
}
+WebKit::WebFileUtilities* TestShellWebKitInit::fileUtilities() {
+ return &file_utilities_;
+}
+
+WebKit::WebSandboxSupport* TestShellWebKitInit::sandboxSupport() {
+ return NULL;
+}
+
+WebKit::WebCookieJar* TestShellWebKitInit::cookieJar() {
+ return &cookie_jar_;
+}
+
+WebKit::WebBlobRegistry* TestShellWebKitInit::blobRegistry() {
+ return blob_registry_.get();
+}
+
+WebKit::WebFileSystem* TestShellWebKitInit::fileSystem() {
+ return &file_system_;
+}
+
+bool TestShellWebKitInit::sandboxEnabled() {
+ return true;
+}
+
+WebKit::WebKitClient::FileHandle TestShellWebKitInit::databaseOpenFile(
+ const WebKit::WebString& vfs_file_name, int desired_flags) {
+ return SimpleDatabaseSystem::GetInstance()->OpenFile(
+ vfs_file_name, desired_flags);
+}
+
+int TestShellWebKitInit::databaseDeleteFile(
+ const WebKit::WebString& vfs_file_name,
+ bool sync_dir) {
+ return SimpleDatabaseSystem::GetInstance()->DeleteFile(
+ vfs_file_name, sync_dir);
+}
+
+long TestShellWebKitInit::databaseGetFileAttributes(
+ const WebKit::WebString& vfs_file_name) {
+ return SimpleDatabaseSystem::GetInstance()->GetFileAttributes(
+ vfs_file_name);
+}
+
+long long TestShellWebKitInit::databaseGetFileSize(
+ const WebKit::WebString& vfs_file_name) {
+ return SimpleDatabaseSystem::GetInstance()->GetFileSize(vfs_file_name);
+}
+
+unsigned long long TestShellWebKitInit::visitedLinkHash(
+ const char* canonicalURL,
+ size_t length) {
+ return 0;
+}
+
+bool TestShellWebKitInit::isLinkVisited(unsigned long long linkHash) {
+ return false;
+}
+
+WebKit::WebMessagePortChannel* TestShellWebKitInit::createMessagePortChannel() {
+ return NULL;
+}
+
+void TestShellWebKitInit::prefetchHostName(const WebKit::WebString&) {
+}
+
WebKit::WebData TestShellWebKitInit::loadResource(const char* name) {
if (!strcmp(name, "deleteButton")) {
// Create a red 30x30 square.
@@ -170,3 +239,47 @@ WebKit::WebString TestShellWebKitInit::queryLocalizedString(
return WebKitClientImpl::queryLocalizedString(name, value1, value2);
}
+WebKit::WebString TestShellWebKitInit::defaultLocale() {
+ return ASCIIToUTF16("en-US");
+}
+
+WebKit::WebStorageNamespace* TestShellWebKitInit::createLocalStorageNamespace(
+ const WebKit::WebString& path, unsigned quota) {
+ // Enforce quota here, ignoring the value from the renderer as in Chrome.
+ return WebKit::WebStorageNamespace::createLocalStorageNamespace(
+ path,
+ WebKit::WebStorageNamespace::m_localStorageQuota);
+}
+
+void TestShellWebKitInit::dispatchStorageEvent(
+ const WebKit::WebString& key,
+ const WebKit::WebString& old_value, const WebKit::WebString& new_value,
+ const WebKit::WebString& origin, const WebKit::WebURL& url,
+ bool is_local_storage) {
+ // The event is dispatched by the proxy.
+}
+
+WebKit::WebIDBFactory* TestShellWebKitInit::idbFactory() {
+ return WebKit::WebIDBFactory::create();
+}
+
+void TestShellWebKitInit::createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
+ const WebKit::WebString& keyPath,
+ WebKit::WebVector<WebKit::WebIDBKey>& keys_out) {
+ WebKit::WebVector<WebKit::WebIDBKey> keys(values.size());
+ for (size_t i = 0; i < values.size(); ++i) {
+ keys[i] = WebKit::WebIDBKey::createFromValueAndKeyPath(
+ values[i], WebKit::WebIDBKeyPath::create(keyPath));
+ }
+ keys_out.swap(keys);
+}
+
+WebKit::WebSharedWorkerRepository*
+TestShellWebKitInit::sharedWorkerRepository() {
+ return NULL;
+}
+
+WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() {
+ return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
+}
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index ce2bcaf..8690991 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -34,75 +34,27 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
explicit TestShellWebKitInit(bool layout_test_mode);
~TestShellWebKitInit();
- virtual WebKit::WebMimeRegistry* mimeRegistry() {
- return mime_registry_.get();
- }
-
- WebKit::WebClipboard* clipboard();
-
- virtual WebKit::WebFileUtilities* fileUtilities() {
- return &file_utilities_;
- }
-
- virtual WebKit::WebSandboxSupport* sandboxSupport() {
- return NULL;
- }
-
- virtual WebKit::WebCookieJar* cookieJar() {
- return &cookie_jar_;
- }
-
- virtual WebKit::WebBlobRegistry* blobRegistry() {
- return blob_registry_.get();
- }
-
- virtual WebKit::WebFileSystem* fileSystem() {
- return &file_system_;
- }
-
- virtual bool sandboxEnabled() {
- return true;
- }
-
+ virtual WebKit::WebMimeRegistry* mimeRegistry();
+ virtual WebKit::WebClipboard* clipboard();
+ virtual WebKit::WebFileUtilities* fileUtilities();
+ virtual WebKit::WebSandboxSupport* sandboxSupport();
+ virtual WebKit::WebCookieJar* cookieJar();
+ virtual WebKit::WebBlobRegistry* blobRegistry();
+ virtual WebKit::WebFileSystem* fileSystem();
+ virtual bool sandboxEnabled();
virtual WebKit::WebKitClient::FileHandle databaseOpenFile(
- const WebKit::WebString& vfs_file_name, int desired_flags) {
- return SimpleDatabaseSystem::GetInstance()->OpenFile(
- vfs_file_name, desired_flags);
- }
-
+ const WebKit::WebString& vfs_file_name, int desired_flags);
virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name,
- bool sync_dir) {
- return SimpleDatabaseSystem::GetInstance()->DeleteFile(
- vfs_file_name, sync_dir);
- }
-
+ bool sync_dir);
virtual long databaseGetFileAttributes(
- const WebKit::WebString& vfs_file_name) {
- return SimpleDatabaseSystem::GetInstance()->GetFileAttributes(
- vfs_file_name);
- }
-
+ const WebKit::WebString& vfs_file_name);
virtual long long databaseGetFileSize(
- const WebKit::WebString& vfs_file_name) {
- return SimpleDatabaseSystem::GetInstance()->GetFileSize(vfs_file_name);
- }
-
+ const WebKit::WebString& vfs_file_name);
virtual unsigned long long visitedLinkHash(const char* canonicalURL,
- size_t length) {
- return 0;
- }
-
- virtual bool isLinkVisited(unsigned long long linkHash) {
- return false;
- }
-
- virtual WebKit::WebMessagePortChannel* createMessagePortChannel() {
- return NULL;
- }
-
- virtual void prefetchHostName(const WebKit::WebString&) {
- }
-
+ size_t length);
+ virtual bool isLinkVisited(unsigned long long linkHash);
+ virtual WebKit::WebMessagePortChannel* createMessagePortChannel();
+ virtual void prefetchHostName(const WebKit::WebString&);
virtual WebKit::WebData loadResource(const char* name);
virtual WebKit::WebString queryLocalizedString(
WebKit::WebLocalizedString::Name name);
@@ -112,39 +64,23 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
WebKit::WebLocalizedString::Name name,
const WebKit::WebString& value1, const WebKit::WebString& value2);
- virtual WebKit::WebString defaultLocale() {
- return ASCIIToUTF16("en-US");
- }
+ virtual WebKit::WebString defaultLocale();
virtual WebKit::WebStorageNamespace* createLocalStorageNamespace(
- const WebKit::WebString& path, unsigned quota) {
- // Enforce quota here, ignoring the value from the renderer as in Chrome.
- return WebKit::WebStorageNamespace::createLocalStorageNamespace(path,
- WebKit::WebStorageNamespace::m_localStorageQuota);
- }
-
- void dispatchStorageEvent(const WebKit::WebString& key,
- const WebKit::WebString& old_value, const WebKit::WebString& new_value,
- const WebKit::WebString& origin, const WebKit::WebURL& url,
- bool is_local_storage) {
- // The event is dispatched by the proxy.
- }
+ const WebKit::WebString& path, unsigned quota);
- virtual WebKit::WebIDBFactory* idbFactory() {
- return WebKit::WebIDBFactory::create();
- }
+ virtual void dispatchStorageEvent(const WebKit::WebString& key,
+ const WebKit::WebString& old_value,
+ const WebKit::WebString& new_value,
+ const WebKit::WebString& origin,
+ const WebKit::WebURL& url,
+ bool is_local_storage);
+ virtual WebKit::WebIDBFactory* idbFactory();
virtual void createIDBKeysFromSerializedValuesAndKeyPath(
const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
const WebKit::WebString& keyPath,
- WebKit::WebVector<WebKit::WebIDBKey>& keys_out) {
- WebKit::WebVector<WebKit::WebIDBKey> keys(values.size());
- for (size_t i = 0; i < values.size(); ++i) {
- keys[i] = WebKit::WebIDBKey::createFromValueAndKeyPath(
- values[i], WebKit::WebIDBKeyPath::create(keyPath));
- }
- keys_out.swap(keys);
- }
+ WebKit::WebVector<WebKit::WebIDBKey>& keys_out);
#if defined(OS_WIN)
void SetThemeEngine(WebKit::WebThemeEngine* engine) {
@@ -156,13 +92,8 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
}
#endif
- virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository() {
- return NULL;
- }
-
- virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() {
- return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
- }
+ virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository();
+ virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D();
private:
scoped_ptr<webkit_glue::SimpleWebMimeRegistryImpl> mime_registry_;
diff --git a/webkit/tools/test_shell/test_web_worker.cc b/webkit/tools/test_shell/test_web_worker.cc
new file mode 100644
index 0000000..3f064c0
--- /dev/null
+++ b/webkit/tools/test_shell/test_web_worker.cc
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 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 "webkit/tools/test_shell/test_web_worker.h"
+
+TestWebWorker::TestWebWorker() {
+ AddRef(); // Adds the reference held for worker object.
+ AddRef(); // Adds the reference held for worker context object.
+}
+
+void TestWebWorker::workerObjectDestroyed() {
+ Release(); // Releases the reference held for worker object.
+}
+
+void TestWebWorker::workerContextDestroyed() {
+ Release(); // Releases the reference held for worker context object.
+}
+
+WebKit::WebWorker* TestWebWorker::createWorker(
+ WebKit::WebWorkerClient* client) {
+ return NULL;
+}
+
+WebKit::WebNotificationPresenter* TestWebWorker::notificationPresenter() {
+ return NULL;
+}
+
+WebKit::WebApplicationCacheHost* TestWebWorker::createApplicationCacheHost(
+ WebKit::WebApplicationCacheHostClient*) {
+ return NULL;
+}
+
+bool TestWebWorker::allowDatabase(WebKit::WebFrame* frame,
+ const WebKit::WebString& name,
+ const WebKit::WebString& display_name,
+ unsigned long estimated_size) {
+ return true;
+}
+
+TestWebWorker::~TestWebWorker() {}
diff --git a/webkit/tools/test_shell/test_web_worker.h b/webkit/tools/test_shell/test_web_worker.h
index 2be9964..c7e8c94 100644
--- a/webkit/tools/test_shell/test_web_worker.h
+++ b/webkit/tools/test_shell/test_web_worker.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -26,10 +26,7 @@ class TestWebWorker : public WebKit::WebWorker,
public WebKit::WebWorkerClient,
public base::RefCounted<TestWebWorker> {
public:
- TestWebWorker() {
- AddRef(); // Adds the reference held for worker object.
- AddRef(); // Adds the reference held for worker context object.
- }
+ TestWebWorker();
// WebWorker methods:
virtual void startWorkerContext(const WebKit::WebURL& script_url,
@@ -42,9 +39,7 @@ class TestWebWorker : public WebKit::WebWorker,
const WebKit::WebString& message,
const WebKit::WebMessagePortChannelArray& channel) {
}
- virtual void workerObjectDestroyed() {
- Release(); // Releases the reference held for worker object.
- }
+ virtual void workerObjectDestroyed();
virtual void clientDestroyed() {
}
@@ -70,30 +65,20 @@ class TestWebWorker : public WebKit::WebWorker,
virtual void confirmMessageFromWorkerObject(bool has_pending_activity) { }
virtual void reportPendingActivity(bool has_pending_activity) { }
virtual void workerContextClosed() { }
- virtual void workerContextDestroyed() {
- Release(); // Releases the reference held for worker context object.
- }
- virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient* client) {
- return NULL;
- }
- virtual WebKit::WebNotificationPresenter* notificationPresenter() {
- return NULL;
- }
+ virtual void workerContextDestroyed();
+ virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient* client);
+ virtual WebKit::WebNotificationPresenter* notificationPresenter();
virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
- WebKit::WebApplicationCacheHostClient*) {
- return NULL;
- }
+ WebKit::WebApplicationCacheHostClient*);
virtual bool allowDatabase(WebKit::WebFrame* frame,
const WebKit::WebString& name,
const WebKit::WebString& display_name,
- unsigned long estimated_size) {
- return true;
- }
+ unsigned long estimated_size);
private:
friend class base::RefCounted<TestWebWorker>;
- ~TestWebWorker() {}
+ virtual ~TestWebWorker();
DISALLOW_COPY_AND_ASSIGN(TestWebWorker);
};