summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-14 23:54:47 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-14 23:54:47 +0000
commita5add2c2624eaffd9290ee6b760b504cfc07a2ed (patch)
treef2a0dd83cbbf771fdf9ed8f01e72a89dfa9d3390
parent98723c4a32b20c4ba1ed95b0e9056788fb413ce6 (diff)
downloadchromium_src-a5add2c2624eaffd9290ee6b760b504cfc07a2ed.zip
chromium_src-a5add2c2624eaffd9290ee6b760b504cfc07a2ed.tar.gz
chromium_src-a5add2c2624eaffd9290ee6b760b504cfc07a2ed.tar.bz2
More test out-of-lining.
BUG=none TEST=compiles Review URL: http://codereview.chromium.org/6484043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74879 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--app/app.gyp1
-rw-r--r--app/test_suite.cc65
-rw-r--r--app/test_suite.h63
-rw-r--r--chrome/browser/autofill/phone_field.cc2
-rw-r--r--chrome/browser/autofill/phone_field.h2
-rw-r--r--chrome/browser/browsing_data_database_helper.cc2
-rw-r--r--chrome/browser/browsing_data_database_helper.h2
-rw-r--r--chrome/browser/browsing_data_local_storage_helper.cc2
-rw-r--r--chrome/browser/browsing_data_local_storage_helper.h2
-rw-r--r--chrome/browser/dom_ui/web_ui_browsertest.cc4
-rw-r--r--chrome/browser/dom_ui/web_ui_browsertest.h2
-rw-r--r--chrome/browser/net/gaia/token_service_unittest.cc3
-rw-r--r--chrome/browser/net/gaia/token_service_unittest.h1
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.cc34
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.h18
-rw-r--r--chrome/browser/safe_browsing/prefix_set.cc2
-rw-r--r--chrome/browser/safe_browsing/prefix_set.h1
-rw-r--r--chrome/browser/sync/engine/syncapi.cc2
-rw-r--r--chrome/browser/sync/engine/syncapi.h1
-rw-r--r--chrome/chrome_tests.gypi4
-rw-r--r--chrome/renderer/mock_render_thread.cc8
-rw-r--r--chrome/renderer/mock_render_thread.h4
-rw-r--r--chrome/test/live_sync/live_sessions_sync_test.h2
-rw-r--r--chrome/test/signaling_task.cc16
-rw-r--r--chrome/test/signaling_task.h16
-rw-r--r--chrome/test/test_browser_window.cc93
-rw-r--r--chrome/test/test_browser_window.h48
-rw-r--r--chrome/test/test_location_bar.cc36
-rw-r--r--chrome/test/test_location_bar.h26
-rw-r--r--chrome/test/testing_profile.cc9
-rw-r--r--chrome/test/testing_profile.h8
-rw-r--r--chrome/test/webdriver/commands/create_session.cc8
-rw-r--r--chrome/test/webdriver/commands/create_session.h9
-rw-r--r--chrome/test/webdriver/commands/implicit_wait_command.cc16
-rw-r--r--chrome/test/webdriver/commands/implicit_wait_command.h11
-rw-r--r--chrome/test/webdriver/commands/url_command.cc18
-rw-r--r--chrome/test/webdriver/commands/url_command.h13
37 files changed, 403 insertions, 151 deletions
diff --git a/app/app.gyp b/app/app.gyp
index 107d4b30..d1b3198 100644
--- a/app/app.gyp
+++ b/app/app.gyp
@@ -58,6 +58,7 @@
'sql/connection_unittest.cc',
'sql/statement_unittest.cc',
'sql/transaction_unittest.cc',
+ 'test_suite.cc',
'test_suite.h',
],
'include_dirs': [
diff --git a/app/test_suite.cc b/app/test_suite.cc
new file mode 100644
index 0000000..7eaedd6
--- /dev/null
+++ b/app/test_suite.cc
@@ -0,0 +1,65 @@
+// 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 "app/test_suite.h"
+
+#include "app/app_paths.h"
+#include "base/path_service.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
+#include "build/build_config.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_paths.h"
+
+#if defined(OS_MACOSX)
+#include "base/mac/mac_util.h"
+#endif
+
+AppTestSuite::AppTestSuite(int argc, char** argv) : TestSuite(argc, argv) {}
+
+AppTestSuite::~AppTestSuite() {}
+
+void AppTestSuite::Initialize() {
+ base::mac::ScopedNSAutoreleasePool autorelease_pool;
+
+ base::TestSuite::Initialize();
+
+ app::RegisterPathProvider();
+ ui::RegisterPathProvider();
+#if defined(OS_MACOSX)
+ // Look in the framework bundle for resources.
+ // TODO(port): make a resource bundle for non-app exes. What's done here
+ // isn't really right because this code needs to depend on chrome_dll
+ // being built. This is inappropriate in app.
+ FilePath path;
+ PathService::Get(base::DIR_EXE, &path);
+#if defined(GOOGLE_CHROME_BUILD)
+ path = path.AppendASCII("Google Chrome Framework.framework");
+#elif defined(CHROMIUM_BUILD)
+ path = path.AppendASCII("Chromium Framework.framework");
+#else
+#error Unknown branding
+#endif
+ base::mac::SetOverrideAppBundlePath(path);
+#elif defined(OS_POSIX)
+ FilePath pak_dir;
+ PathService::Get(base::DIR_MODULE, &pak_dir);
+ pak_dir = pak_dir.AppendASCII("app_unittests_strings");
+ PathService::Override(ui::DIR_LOCALES, pak_dir);
+ PathService::Override(ui::FILE_RESOURCES_PAK,
+ pak_dir.AppendASCII("app_resources.pak"));
+#endif
+
+ // Force unittests to run using en-US so if we test against string
+ // output, it'll pass regardless of the system language.
+ ResourceBundle::InitSharedInstance("en-US");
+}
+
+void AppTestSuite::Shutdown() {
+ ResourceBundle::CleanupSharedInstance();
+
+#if defined(OS_MACOSX)
+ base::mac::SetOverrideAppBundle(NULL);
+#endif
+ TestSuite::Shutdown();
+}
diff --git a/app/test_suite.h b/app/test_suite.h
index 72cc28c..34e784d 100644
--- a/app/test_suite.h
+++ b/app/test_suite.h
@@ -6,71 +6,16 @@
#define APP_TEST_SUITE_H_
#pragma once
-#include "build/build_config.h"
-
-#include "app/app_paths.h"
-#include "base/path_service.h"
-#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/test/test_suite.h"
-#include "build/build_config.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/ui_base_paths.h"
-
-#if defined(OS_MACOSX)
-#include "base/mac/mac_util.h"
-#endif
class AppTestSuite : public base::TestSuite {
public:
- AppTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
- }
+ AppTestSuite(int argc, char** argv);
+ virtual ~AppTestSuite();
protected:
-
- virtual void Initialize() {
- base::mac::ScopedNSAutoreleasePool autorelease_pool;
-
- base::TestSuite::Initialize();
-
- app::RegisterPathProvider();
- ui::RegisterPathProvider();
-#if defined(OS_MACOSX)
- // Look in the framework bundle for resources.
- // TODO(port): make a resource bundle for non-app exes. What's done here
- // isn't really right because this code needs to depend on chrome_dll
- // being built. This is inappropriate in app.
- FilePath path;
- PathService::Get(base::DIR_EXE, &path);
-#if defined(GOOGLE_CHROME_BUILD)
- path = path.AppendASCII("Google Chrome Framework.framework");
-#elif defined(CHROMIUM_BUILD)
- path = path.AppendASCII("Chromium Framework.framework");
-#else
-#error Unknown branding
-#endif
- base::mac::SetOverrideAppBundlePath(path);
-#elif defined(OS_POSIX)
- FilePath pak_dir;
- PathService::Get(base::DIR_MODULE, &pak_dir);
- pak_dir = pak_dir.AppendASCII("app_unittests_strings");
- PathService::Override(ui::DIR_LOCALES, pak_dir);
- PathService::Override(ui::FILE_RESOURCES_PAK,
- pak_dir.AppendASCII("app_resources.pak"));
-#endif
-
- // Force unittests to run using en-US so if we test against string
- // output, it'll pass regardless of the system language.
- ResourceBundle::InitSharedInstance("en-US");
- }
-
- virtual void Shutdown() {
- ResourceBundle::CleanupSharedInstance();
-
-#if defined(OS_MACOSX)
- base::mac::SetOverrideAppBundle(NULL);
-#endif
- TestSuite::Shutdown();
- }
+ virtual void Initialize();
+ virtual void Shutdown();
};
#endif // APP_TEST_SUITE_H_
diff --git a/chrome/browser/autofill/phone_field.cc b/chrome/browser/autofill/phone_field.cc
index 9928b2a..f6b41a2 100644
--- a/chrome/browser/autofill/phone_field.cc
+++ b/chrome/browser/autofill/phone_field.cc
@@ -15,6 +15,8 @@
#include "grit/autofill_resources.h"
#include "ui/base/l10n/l10n_util.h"
+PhoneField::~PhoneField() {}
+
// static
PhoneField* PhoneField::Parse(std::vector<AutoFillField*>::const_iterator* iter,
bool is_ecml) {
diff --git a/chrome/browser/autofill/phone_field.h b/chrome/browser/autofill/phone_field.h
index 53b0f02..2563a81 100644
--- a/chrome/browser/autofill/phone_field.h
+++ b/chrome/browser/autofill/phone_field.h
@@ -21,6 +21,8 @@ class AutoFillField;
// - number
class PhoneField : public FormField {
public:
+ virtual ~PhoneField();
+
static PhoneField* Parse(std::vector<AutoFillField*>::const_iterator* iter,
bool is_ecml);
static PhoneField* ParseECML(
diff --git a/chrome/browser/browsing_data_database_helper.cc b/chrome/browser/browsing_data_database_helper.cc
index c302b57..9f2ecd3 100644
--- a/chrome/browser/browsing_data_database_helper.cc
+++ b/chrome/browser/browsing_data_database_helper.cc
@@ -189,6 +189,8 @@ void CannedBrowsingDataDatabaseHelper::StartFetching(
this, &CannedBrowsingDataDatabaseHelper::ConvertInfoInWebKitThread));
}
+CannedBrowsingDataDatabaseHelper::~CannedBrowsingDataDatabaseHelper() {}
+
void CannedBrowsingDataDatabaseHelper::ConvertInfoInWebKitThread() {
base::AutoLock auto_lock(lock_);
for (std::vector<PendingDatabaseInfo>::const_iterator
diff --git a/chrome/browser/browsing_data_database_helper.h b/chrome/browser/browsing_data_database_helper.h
index fa1d069..2d870ee1 100644
--- a/chrome/browser/browsing_data_database_helper.h
+++ b/chrome/browser/browsing_data_database_helper.h
@@ -139,7 +139,7 @@ class CannedBrowsingDataDatabaseHelper : public BrowsingDataDatabaseHelper {
std::string description;
};
- virtual ~CannedBrowsingDataDatabaseHelper() {}
+ virtual ~CannedBrowsingDataDatabaseHelper();
// Converts the pending database info structs to database info structs.
void ConvertInfoInWebKitThread();
diff --git a/chrome/browser/browsing_data_local_storage_helper.cc b/chrome/browser/browsing_data_local_storage_helper.cc
index e16f24d..a08eb56 100644
--- a/chrome/browser/browsing_data_local_storage_helper.cc
+++ b/chrome/browser/browsing_data_local_storage_helper.cc
@@ -179,6 +179,8 @@ void CannedBrowsingDataLocalStorageHelper::StartFetching(
ConvertPendingInfoInWebKitThread));
}
+CannedBrowsingDataLocalStorageHelper::~CannedBrowsingDataLocalStorageHelper() {}
+
void CannedBrowsingDataLocalStorageHelper::ConvertPendingInfoInWebKitThread() {
base::AutoLock auto_lock(lock_);
for (std::vector<GURL>::iterator info = pending_local_storage_info_.begin();
diff --git a/chrome/browser/browsing_data_local_storage_helper.h b/chrome/browser/browsing_data_local_storage_helper.h
index 227b200..e1db472 100644
--- a/chrome/browser/browsing_data_local_storage_helper.h
+++ b/chrome/browser/browsing_data_local_storage_helper.h
@@ -126,7 +126,7 @@ class CannedBrowsingDataLocalStorageHelper
virtual void CancelNotification() {}
private:
- virtual ~CannedBrowsingDataLocalStorageHelper() {}
+ virtual ~CannedBrowsingDataLocalStorageHelper();
// Convert the pending local storage info to local storage info objects.
void ConvertPendingInfoInWebKitThread();
diff --git a/chrome/browser/dom_ui/web_ui_browsertest.cc b/chrome/browser/dom_ui/web_ui_browsertest.cc
index f373586..6bb35bf 100644
--- a/chrome/browser/dom_ui/web_ui_browsertest.cc
+++ b/chrome/browser/dom_ui/web_ui_browsertest.cc
@@ -39,6 +39,10 @@ void WebUIBrowserTest::SetUpInProcessBrowserTestFixture() {
ResourceBundle::AddDataPackToSharedInstance(resources_pack_path);
}
+WebUIMessageHandler* WebUIBrowserTest::GetMockMessageHandler() {
+ return NULL;
+}
+
void WebUIBrowserTest::BuildJavaScriptTest(const FilePath& src_path,
std::string* content) {
ASSERT_TRUE(content != NULL);
diff --git a/chrome/browser/dom_ui/web_ui_browsertest.h b/chrome/browser/dom_ui/web_ui_browsertest.h
index d98216f..44db102 100644
--- a/chrome/browser/dom_ui/web_ui_browsertest.h
+++ b/chrome/browser/dom_ui/web_ui_browsertest.h
@@ -33,7 +33,7 @@ class WebUIBrowserTest : public InProcessBrowserTest {
virtual void SetUpInProcessBrowserTestFixture();
// Returns a mock WebUI object under test (if any).
- virtual WebUIMessageHandler* GetMockMessageHandler() { return NULL; }
+ virtual WebUIMessageHandler* GetMockMessageHandler();
private:
// Builds a javascript test in the form:
diff --git a/chrome/browser/net/gaia/token_service_unittest.cc b/chrome/browser/net/gaia/token_service_unittest.cc
index 8650442..e3560b6 100644
--- a/chrome/browser/net/gaia/token_service_unittest.cc
+++ b/chrome/browser/net/gaia/token_service_unittest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/net/gaia/token_service_unittest.h"
#include "base/command_line.h"
+#include "base/synchronization/waitable_event.h"
#include "chrome/browser/password_manager/encryptor.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/gaia/gaia_auth_fetcher_unittest.h"
@@ -60,7 +61,7 @@ void TokenServiceTestHarness::WaitForDBLoadCompletion() {
// The WebDB does all work on the DB thread. This will add an event
// to the end of the DB thread, so when we reach this task, all DB
// operations should be complete.
- WaitableEvent done(false, false);
+ base::WaitableEvent done(false, false);
BrowserThread::PostTask(
BrowserThread::DB, FROM_HERE, new SignalingTask(&done));
done.Wait();
diff --git a/chrome/browser/net/gaia/token_service_unittest.h b/chrome/browser/net/gaia/token_service_unittest.h
index 9481d22..8f48e78 100644
--- a/chrome/browser/net/gaia/token_service_unittest.h
+++ b/chrome/browser/net/gaia/token_service_unittest.h
@@ -8,6 +8,7 @@
#define CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_UNITTEST_H_
#pragma once
+#include "base/synchronization/waitable_event.h"
#include "chrome/browser/net/gaia/token_service.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/net/gaia/gaia_auth_consumer.h"
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.cc b/chrome/browser/renderer_host/test/test_render_view_host.cc
index da89186..60e9f33 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.cc
+++ b/chrome/browser/renderer_host/test/test_render_view_host.cc
@@ -111,6 +111,35 @@ TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
TestRenderWidgetHostView::~TestRenderWidgetHostView() {
}
+RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const {
+ return NULL;
+}
+
+gfx::NativeView TestRenderWidgetHostView::GetNativeView() {
+ return NULL;
+}
+
+bool TestRenderWidgetHostView::HasFocus() {
+ return true;
+}
+
+void TestRenderWidgetHostView::Show() {
+ is_showing_ = true;
+}
+
+void TestRenderWidgetHostView::Hide() {
+ is_showing_ = false;
+}
+
+bool TestRenderWidgetHostView::IsShowing() {
+ return is_showing_;
+}
+
+void TestRenderWidgetHostView::RenderViewGone(base::TerminationStatus status,
+ int error_code) {
+ delete this;
+}
+
gfx::Rect TestRenderWidgetHostView::GetViewBounds() const {
return gfx::Rect();
}
@@ -202,6 +231,11 @@ void TestRenderWidgetHostView::ShowCompositorHostWindow(bool show) {
}
#endif
+bool TestRenderWidgetHostView::ContainsNativeView(
+ gfx::NativeView native_view) const {
+ return false;
+}
+
TestRenderViewHostFactory::TestRenderViewHostFactory(
RenderProcessHostFactory* rph_factory)
: render_process_host_factory_(rph_factory) {
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h
index 0323e7e..dfc3d53 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test/test_render_view_host.h
@@ -54,11 +54,11 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) {}
virtual void InitAsFullscreen() {}
- virtual RenderWidgetHost* GetRenderWidgetHost() const { return NULL; }
+ virtual RenderWidgetHost* GetRenderWidgetHost() const;
virtual void DidBecomeSelected() {}
virtual void WasHidden() {}
virtual void SetSize(const gfx::Size& size) {}
- virtual gfx::NativeView GetNativeView() { return NULL; }
+ virtual gfx::NativeView GetNativeView();
virtual void MovePluginWindows(
const std::vector<webkit::npapi::WebPluginGeometry>& moves) {}
#if defined(OS_WIN)
@@ -68,11 +68,11 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
#endif
virtual void Focus() {}
virtual void Blur() {}
- virtual bool HasFocus() { return true; }
+ virtual bool HasFocus();
virtual void AdvanceFocus(bool reverse) {}
- virtual void Show() { is_showing_ = true; }
- virtual void Hide() { is_showing_ = false; }
- virtual bool IsShowing() { return is_showing_; }
+ virtual void Show();
+ virtual void Hide();
+ virtual bool IsShowing();
virtual gfx::Rect GetViewBounds() const;
virtual void SetIsLoading(bool is_loading) {}
virtual void UpdateCursor(const WebCursor& cursor) {}
@@ -84,7 +84,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
const gfx::Rect& scroll_rect, int scroll_dx, int scroll_dy,
const std::vector<gfx::Rect>& rects) {}
virtual void RenderViewGone(base::TerminationStatus status,
- int error_code) { delete this; }
+ int error_code);
virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) { }
virtual void Destroy() {}
virtual void PrepareToDestroy() {}
@@ -140,9 +140,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
virtual void AcceleratedCompositingActivated(bool activated) { }
#endif
- virtual bool ContainsNativeView(gfx::NativeView native_view) const {
- return false;
- }
+ virtual bool ContainsNativeView(gfx::NativeView native_view) const;
bool is_showing() const { return is_showing_; }
diff --git a/chrome/browser/safe_browsing/prefix_set.cc b/chrome/browser/safe_browsing/prefix_set.cc
index 9f86f3a..dae9578 100644
--- a/chrome/browser/safe_browsing/prefix_set.cc
+++ b/chrome/browser/safe_browsing/prefix_set.cc
@@ -68,6 +68,8 @@ PrefixSet::PrefixSet(const std::vector<SBPrefix>& prefixes) {
}
}
+PrefixSet::~PrefixSet() {}
+
bool PrefixSet::Exists(SBPrefix prefix) const {
if (index_.empty())
return false;
diff --git a/chrome/browser/safe_browsing/prefix_set.h b/chrome/browser/safe_browsing/prefix_set.h
index df32372..229b772 100644
--- a/chrome/browser/safe_browsing/prefix_set.h
+++ b/chrome/browser/safe_browsing/prefix_set.h
@@ -60,6 +60,7 @@ namespace safe_browsing {
class PrefixSet {
public:
explicit PrefixSet(const std::vector<SBPrefix>& prefixes);
+ ~PrefixSet();
// |true| if |prefix| was in |prefixes| passed to the constructor.
bool Exists(SBPrefix prefix) const;
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 3d5ccc4..12fe48d 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -939,6 +939,8 @@ SyncManager::ExtraChangeRecordData::~ExtraChangeRecordData() {}
SyncManager::ChangeRecord::ChangeRecord()
: id(kInvalidId), action(ACTION_ADD) {}
+SyncManager::ChangeRecord::~ChangeRecord() {}
+
DictionaryValue* SyncManager::ChangeRecord::ToValue(
const BaseTransaction* trans) const {
DictionaryValue* value = new DictionaryValue();
diff --git a/chrome/browser/sync/engine/syncapi.h b/chrome/browser/sync/engine/syncapi.h
index 09cda86..2be895c 100644
--- a/chrome/browser/sync/engine/syncapi.h
+++ b/chrome/browser/sync/engine/syncapi.h
@@ -609,6 +609,7 @@ class SyncManager {
ACTION_UPDATE,
};
ChangeRecord();
+ ~ChangeRecord();
// Transfers ownership of the DictionaryValue to the caller.
DictionaryValue* ToValue(const BaseTransaction* trans) const;
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index f8ab47c..61c87eb 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -144,9 +144,13 @@
'test/model_test_utils.h',
'test/profile_mock.cc',
'test/profile_mock.h',
+ 'test/signaling_task.cc',
+ 'test/signaling_task.h',
+ 'test/test_browser_window.cc',
'test/test_browser_window.h',
'test/test_launcher_utils.cc',
'test/test_launcher_utils.h',
+ 'test/test_location_bar.cc',
'test/test_location_bar.h',
'test/test_switches.cc',
'test/test_switches.h',
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index 3640987..f6a26b7 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -55,6 +55,14 @@ void MockRenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) {
filter->OnFilterRemoved();
}
+bool MockRenderThread::IsExtensionProcess() const {
+ return is_extension_process_;
+}
+
+bool MockRenderThread::IsIncognitoProcess() const {
+ return false;
+}
+
// Called by the Widget. Used to send messages to the browser.
// We short-circuit the mechanim and handle the messages right here on this
// class.
diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h
index e711222..130480a 100644
--- a/chrome/renderer/mock_render_thread.h
+++ b/chrome/renderer/mock_render_thread.h
@@ -56,8 +56,8 @@ class MockRenderThread : public RenderThreadBase {
virtual void WidgetHidden() { }
virtual void WidgetRestored() { }
- virtual bool IsExtensionProcess() const { return is_extension_process_; }
- virtual bool IsIncognitoProcess() const { return false; }
+ virtual bool IsExtensionProcess() const;
+ virtual bool IsIncognitoProcess() const;
void SetExtensionProcess(bool value) { is_extension_process_ = value; }
//////////////////////////////////////////////////////////////////////////
diff --git a/chrome/test/live_sync/live_sessions_sync_test.h b/chrome/test/live_sync/live_sessions_sync_test.h
index e081ad7..87c3a65 100644
--- a/chrome/test/live_sync/live_sessions_sync_test.h
+++ b/chrome/test/live_sync/live_sessions_sync_test.h
@@ -95,7 +95,7 @@ class LiveSessionsSyncTest : public LiveSyncTest {
Browser* GetBrowser(int index);
// Sets up the TestSessionService helper and the new browser windows.
- bool SetupClients();
+ virtual bool SetupClients();
// Open a single tab and return the TabContents. TabContents must be checked
// to ensure the tab opened successsfully.
diff --git a/chrome/test/signaling_task.cc b/chrome/test/signaling_task.cc
new file mode 100644
index 0000000..cecf0b2
--- /dev/null
+++ b/chrome/test/signaling_task.cc
@@ -0,0 +1,16 @@
+// Copyright (c) 2010 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 "chrome/test/signaling_task.h"
+
+#include "base/synchronization/waitable_event.h"
+
+SignalingTask::SignalingTask(base::WaitableEvent* event) : event_(event) {
+}
+
+SignalingTask::~SignalingTask() {}
+
+void SignalingTask::Run() {
+ event_->Signal();
+}
diff --git a/chrome/test/signaling_task.h b/chrome/test/signaling_task.h
index c745393..c01c787 100644
--- a/chrome/test/signaling_task.h
+++ b/chrome/test/signaling_task.h
@@ -8,21 +8,21 @@
#define CHROME_TEST_SIGNALING_TASK_H_
#pragma once
-#include "base/synchronization/waitable_event.h"
+#include "base/task.h"
-using base::WaitableEvent;
+namespace base {
+class WaitableEvent;
+}
class SignalingTask : public Task {
public:
- explicit SignalingTask(WaitableEvent* event) : event_(event) {
- }
+ explicit SignalingTask(base::WaitableEvent* event);
+ virtual ~SignalingTask();
- virtual void Run() {
- event_->Signal();
- }
+ virtual void Run();
private:
- WaitableEvent* event_;
+ base::WaitableEvent* event_;
};
#endif // CHROME_TEST_SIGNALING_TASK_H_
diff --git a/chrome/test/test_browser_window.cc b/chrome/test/test_browser_window.cc
new file mode 100644
index 0000000..b76935d
--- /dev/null
+++ b/chrome/test/test_browser_window.cc
@@ -0,0 +1,93 @@
+// 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 "chrome/test/test_browser_window.h"
+
+#include "ui/gfx/rect.h"
+
+TestBrowserWindow::TestBrowserWindow(Browser* browser) {}
+
+TestBrowserWindow::~TestBrowserWindow() {}
+
+bool TestBrowserWindow::IsActive() const {
+ return false;
+}
+
+gfx::NativeWindow TestBrowserWindow::GetNativeHandle() {
+ return NULL;
+}
+
+BrowserWindowTesting* TestBrowserWindow::GetBrowserWindowTesting() {
+ return NULL;
+}
+
+StatusBubble* TestBrowserWindow::GetStatusBubble() {
+ return NULL;
+}
+
+gfx::Rect TestBrowserWindow::GetRestoredBounds() const {
+ return gfx::Rect();
+}
+
+gfx::Rect TestBrowserWindow::GetBounds() const {
+ return gfx::Rect();
+}
+
+bool TestBrowserWindow::IsMaximized() const {
+ return false;
+}
+
+bool TestBrowserWindow::IsFullscreen() const {
+ return false;
+}
+
+bool TestBrowserWindow::IsFullscreenBubbleVisible() const {
+ return false;
+}
+
+LocationBar* TestBrowserWindow::GetLocationBar() const {
+ return const_cast<TestLocationBar*>(&location_bar_);
+}
+
+bool TestBrowserWindow::PreHandleKeyboardEvent(
+ const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut) {
+ return false;
+}
+
+bool TestBrowserWindow::IsBookmarkBarVisible() const {
+ return false;
+}
+
+bool TestBrowserWindow::IsBookmarkBarAnimating() const {
+ return false;
+}
+
+bool TestBrowserWindow::IsTabStripEditable() const {
+ return false;
+}
+
+bool TestBrowserWindow::IsToolbarVisible() const {
+ return false;
+}
+
+views::Window* TestBrowserWindow::ShowAboutChromeDialog() {
+ return NULL;
+}
+
+bool TestBrowserWindow::IsDownloadShelfVisible() const {
+ return false;
+}
+
+DownloadShelf* TestBrowserWindow::GetDownloadShelf() {
+ return NULL;
+}
+
+int TestBrowserWindow::GetExtraRenderViewHeight() const {
+ return 0;
+}
+
+gfx::Rect TestBrowserWindow::GetInstantBounds() {
+ return gfx::Rect();
+}
diff --git a/chrome/test/test_browser_window.h b/chrome/test/test_browser_window.h
index 38ee19b..bd79648 100644
--- a/chrome/test/test_browser_window.h
+++ b/chrome/test/test_browser_window.h
@@ -14,8 +14,8 @@
// See BrowserWithTestWindowTest for an example of using this class.
class TestBrowserWindow : public BrowserWindow {
public:
- explicit TestBrowserWindow(Browser* browser) {}
- virtual ~TestBrowserWindow() {}
+ explicit TestBrowserWindow(Browser* browser);
+ virtual ~TestBrowserWindow();
virtual void Init() {}
virtual void Show() {}
@@ -23,26 +23,24 @@ class TestBrowserWindow : public BrowserWindow {
virtual void Close() {}
virtual void Activate() {}
virtual void Deactivate() {}
- virtual bool IsActive() const { return false; }
+ virtual bool IsActive() const;
virtual void FlashFrame() {}
- virtual gfx::NativeWindow GetNativeHandle() { return NULL; }
- virtual BrowserWindowTesting* GetBrowserWindowTesting() { return NULL; }
- virtual StatusBubble* GetStatusBubble() { return NULL; }
+ virtual gfx::NativeWindow GetNativeHandle();
+ virtual BrowserWindowTesting* GetBrowserWindowTesting();
+ virtual StatusBubble* GetStatusBubble();
virtual void SelectedTabToolbarSizeChanged(bool is_animating) {}
virtual void UpdateTitleBar() {}
virtual void ShelfVisibilityChanged() {}
virtual void UpdateDevTools() {}
virtual void UpdateLoadingAnimations(bool should_animate) {}
virtual void SetStarredState(bool is_starred) {}
- virtual gfx::Rect GetRestoredBounds() const { return gfx::Rect(); }
- virtual gfx::Rect GetBounds() const { return gfx::Rect(); }
- virtual bool IsMaximized() const { return false; }
+ virtual gfx::Rect GetRestoredBounds() const;
+ virtual gfx::Rect GetBounds() const;
+ virtual bool IsMaximized() const;
virtual void SetFullscreen(bool fullscreen) {}
- virtual bool IsFullscreen() const { return false; }
- virtual bool IsFullscreenBubbleVisible() const { return false; }
- virtual LocationBar* GetLocationBar() const {
- return const_cast<TestLocationBar*>(&location_bar_);
- }
+ virtual bool IsFullscreen() const;
+ virtual bool IsFullscreenBubbleVisible() const;
+ virtual LocationBar* GetLocationBar() const;
virtual void SetFocusToLocationBar(bool select_all) {}
virtual void UpdateReloadStopState(bool is_loading, bool force) {}
virtual void UpdateToolbar(TabContentsWrapper* contents,
@@ -54,9 +52,7 @@ class TestBrowserWindow : public BrowserWindow {
virtual void RotatePaneFocus(bool forwards) {}
virtual void ShowAppMenu() {}
virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
- bool* is_keyboard_shortcut) {
- return false;
- }
+ bool* is_keyboard_shortcut);
virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {}
virtual void ShowCreateWebAppShortcutsDialog(TabContents* tab_contents) {}
virtual void ShowCreateChromeAppShortcutsDialog(Profile* profile,
@@ -65,21 +61,21 @@ class TestBrowserWindow : public BrowserWindow {
virtual void ToggleCompactNavigationBar() {}
#endif // defined(TOOLKIT_VIEWS)
- virtual bool IsBookmarkBarVisible() const { return false; }
- virtual bool IsBookmarkBarAnimating() const { return false; }
- virtual bool IsTabStripEditable() const { return false; }
- virtual bool IsToolbarVisible() const { return false; }
+ virtual bool IsBookmarkBarVisible() const;
+ virtual bool IsBookmarkBarAnimating() const;
+ virtual bool IsTabStripEditable() const;
+ virtual bool IsToolbarVisible() const;
virtual void ConfirmAddSearchProvider(const TemplateURL* template_url,
Profile* profile) {}
virtual void ToggleBookmarkBar() {}
- virtual views::Window* ShowAboutChromeDialog() { return NULL; }
+ virtual views::Window* ShowAboutChromeDialog();
virtual void ShowUpdateChromeDialog() {}
virtual void ShowTaskManager() {}
virtual void ShowBackgroundPages() {}
virtual void ShowBookmarkManager() {}
virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) {}
- virtual bool IsDownloadShelfVisible() const { return false; }
- virtual DownloadShelf* GetDownloadShelf() { return NULL; }
+ virtual bool IsDownloadShelfVisible() const;
+ virtual DownloadShelf* GetDownloadShelf();
virtual void ShowReportBugDialog() {}
virtual void ShowClearBrowsingDataDialog() {}
virtual void ShowImportDialog() {}
@@ -95,7 +91,7 @@ class TestBrowserWindow : public BrowserWindow {
virtual void ShowHTMLDialog(HtmlDialogUIDelegate* delegate,
gfx::NativeWindow parent_window) {}
virtual void UserChangedTheme() {}
- virtual int GetExtraRenderViewHeight() const { return 0; }
+ virtual int GetExtraRenderViewHeight() const;
virtual void TabContentsFocused(TabContents* tab_contents) {}
virtual void ShowPageInfo(Profile* profile,
const GURL& url,
@@ -109,7 +105,7 @@ class TestBrowserWindow : public BrowserWindow {
virtual void PrepareForInstant() {}
virtual void ShowInstant(TabContents* preview_contents) {}
virtual void HideInstant(bool instant_is_active) {}
- virtual gfx::Rect GetInstantBounds() { return gfx::Rect(); }
+ virtual gfx::Rect GetInstantBounds();
#if defined(OS_CHROMEOS)
virtual void ShowKeyboardOverlay(gfx::NativeWindow owning_window) {}
diff --git a/chrome/test/test_location_bar.cc b/chrome/test/test_location_bar.cc
new file mode 100644
index 0000000..9d59a0a
--- /dev/null
+++ b/chrome/test/test_location_bar.cc
@@ -0,0 +1,36 @@
+// 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 "chrome/test/test_location_bar.h"
+
+TestLocationBar::TestLocationBar()
+ : disposition_(CURRENT_TAB),
+ transition_(PageTransition::LINK) {
+}
+
+TestLocationBar::~TestLocationBar() {}
+
+std::wstring TestLocationBar::GetInputString() const {
+ return input_string_;
+}
+
+WindowOpenDisposition TestLocationBar::GetWindowOpenDisposition() const {
+ return disposition_;
+}
+
+PageTransition::Type TestLocationBar::GetPageTransition() const {
+ return transition_;
+}
+
+const AutocompleteEditView* TestLocationBar::location_entry() const {
+ return NULL;
+}
+
+AutocompleteEditView* TestLocationBar::location_entry() {
+ return NULL;
+}
+
+LocationBarTesting* TestLocationBar::GetLocationBarForTesting() {
+ return NULL;
+}
diff --git a/chrome/test/test_location_bar.h b/chrome/test/test_location_bar.h
index e1c8b98..a74c2ad 100644
--- a/chrome/test/test_location_bar.h
+++ b/chrome/test/test_location_bar.h
@@ -13,10 +13,8 @@
class TestLocationBar : public LocationBar {
public:
- TestLocationBar()
- : disposition_(CURRENT_TAB),
- transition_(PageTransition::LINK) {
- }
+ TestLocationBar();
+ virtual ~TestLocationBar();
void set_input_string(const std::wstring& input_string) {
input_string_ = input_string;
@@ -31,11 +29,9 @@ class TestLocationBar : public LocationBar {
// Overridden from LocationBar:
virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) {}
virtual void SetSuggestedText(const string16& text) {}
- virtual std::wstring GetInputString() const { return input_string_; }
- virtual WindowOpenDisposition GetWindowOpenDisposition() const {
- return disposition_;
- }
- virtual PageTransition::Type GetPageTransition() const { return transition_; }
+ virtual std::wstring GetInputString() const;
+ virtual WindowOpenDisposition GetWindowOpenDisposition() const;
+ virtual PageTransition::Type GetPageTransition() const;
virtual void AcceptInput() {}
virtual void FocusLocation(bool select_all) {}
virtual void FocusSearch() {}
@@ -44,15 +40,9 @@ class TestLocationBar : public LocationBar {
virtual void InvalidatePageActions() {}
virtual void SaveStateToContents(TabContents* contents) {}
virtual void Revert() {}
- virtual const AutocompleteEditView* location_entry() const {
- return NULL;
- }
- virtual AutocompleteEditView* location_entry() {
- return NULL;
- }
- virtual LocationBarTesting* GetLocationBarForTesting() {
- return NULL;
- }
+ virtual const AutocompleteEditView* location_entry() const;
+ virtual AutocompleteEditView* location_entry();
+ virtual LocationBarTesting* GetLocationBarForTesting();
private:
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index 285338f..43016f3 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -781,3 +781,12 @@ void TestingProfile::DestroyWebDataService() {
web_data_service_->Shutdown();
}
+
+DerivedTestingProfile::DerivedTestingProfile(Profile* profile)
+ : original_profile_(profile) {}
+
+DerivedTestingProfile::~DerivedTestingProfile() {}
+
+ProfileId DerivedTestingProfile::GetRuntimeId() {
+ return original_profile_->GetRuntimeId();
+}
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index f7c3efa..89b67ce 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -391,12 +391,10 @@ class TestingProfile : public Profile {
// site information.
class DerivedTestingProfile : public TestingProfile {
public:
- explicit DerivedTestingProfile(Profile* profile)
- : original_profile_(profile) {}
+ explicit DerivedTestingProfile(Profile* profile);
+ virtual ~DerivedTestingProfile();
- virtual ProfileId GetRuntimeId() {
- return original_profile_->GetRuntimeId();
- }
+ virtual ProfileId GetRuntimeId();
protected:
Profile* original_profile_;
diff --git a/chrome/test/webdriver/commands/create_session.cc b/chrome/test/webdriver/commands/create_session.cc
index d8f5112..9f30d15 100644
--- a/chrome/test/webdriver/commands/create_session.cc
+++ b/chrome/test/webdriver/commands/create_session.cc
@@ -15,6 +15,14 @@
namespace webdriver {
+CreateSession::CreateSession(const std::vector<std::string>& path_segments,
+ const DictionaryValue* const parameters)
+ : Command(path_segments, parameters) {}
+
+CreateSession::~CreateSession() {}
+
+bool CreateSession::DoesPost() { return true; }
+
void CreateSession::ExecutePost(Response* const response) {
SessionManager* session_manager = SessionManager::GetInstance();
Session* session = session_manager->Create();
diff --git a/chrome/test/webdriver/commands/create_session.h b/chrome/test/webdriver/commands/create_session.h
index 1d7a81e..5e8a2c0 100644
--- a/chrome/test/webdriver/commands/create_session.h
+++ b/chrome/test/webdriver/commands/create_session.h
@@ -21,12 +21,11 @@ namespace webdriver {
// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session
class CreateSession : public Command {
public:
- inline CreateSession(const std::vector<std::string>& path_segments,
- const DictionaryValue* const parameters)
- : Command(path_segments, parameters) {}
- virtual ~CreateSession() {}
+ CreateSession(const std::vector<std::string>& path_segments,
+ const DictionaryValue* const parameters);
+ virtual ~CreateSession();
- virtual bool DoesPost() { return true; }
+ virtual bool DoesPost();
virtual void ExecutePost(Response* const response);
private:
diff --git a/chrome/test/webdriver/commands/implicit_wait_command.cc b/chrome/test/webdriver/commands/implicit_wait_command.cc
index b15fd41..e7eb725 100644
--- a/chrome/test/webdriver/commands/implicit_wait_command.cc
+++ b/chrome/test/webdriver/commands/implicit_wait_command.cc
@@ -9,6 +9,14 @@
namespace webdriver {
+ImplicitWaitCommand::ImplicitWaitCommand(
+ const std::vector<std::string>& path_segments,
+ const DictionaryValue* const parameters)
+ : WebDriverCommand(path_segments, parameters),
+ ms_to_wait_(0) {}
+
+ImplicitWaitCommand::~ImplicitWaitCommand() {}
+
bool ImplicitWaitCommand::Init(Response* const response) {
if (!(WebDriverCommand::Init(response))) {
SET_WEBDRIVER_ERROR(response, "Failure on Init for find element",
@@ -26,6 +34,10 @@ bool ImplicitWaitCommand::Init(Response* const response) {
return true;
}
+bool ImplicitWaitCommand::DoesPost() {
+ return true;
+}
+
void ImplicitWaitCommand::ExecutePost(Response* const response) {
// Validate the wait time before setting it to the session.
if (ms_to_wait_ < 0) {
@@ -41,5 +53,9 @@ void ImplicitWaitCommand::ExecutePost(Response* const response) {
response->set_status(kSuccess);
}
+bool ImplicitWaitCommand::RequiresValidTab() {
+ return true;
+}
+
} // namespace webdriver
diff --git a/chrome/test/webdriver/commands/implicit_wait_command.h b/chrome/test/webdriver/commands/implicit_wait_command.h
index 0475c4b..f0abf5b 100644
--- a/chrome/test/webdriver/commands/implicit_wait_command.h
+++ b/chrome/test/webdriver/commands/implicit_wait_command.h
@@ -19,19 +19,18 @@ namespace webdriver {
// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/timeouts/implicit_wait
class ImplicitWaitCommand : public WebDriverCommand {
public:
- inline ImplicitWaitCommand(const std::vector<std::string>& path_segments,
- const DictionaryValue* const parameters)
- : WebDriverCommand(path_segments, parameters), ms_to_wait_(0) {}
- virtual ~ImplicitWaitCommand() {}
+ ImplicitWaitCommand(const std::vector<std::string>& path_segments,
+ const DictionaryValue* const parameters);
+ virtual ~ImplicitWaitCommand();
virtual bool Init(Response* const response);
- virtual bool DoesPost() { return true; }
+ virtual bool DoesPost();
virtual void ExecutePost(Response* const response);
private:
int ms_to_wait_;
- virtual bool RequiresValidTab() { return true; }
+ virtual bool RequiresValidTab();
DISALLOW_COPY_AND_ASSIGN(ImplicitWaitCommand);
};
diff --git a/chrome/test/webdriver/commands/url_command.cc b/chrome/test/webdriver/commands/url_command.cc
index 2be30cd..d84dc31 100644
--- a/chrome/test/webdriver/commands/url_command.cc
+++ b/chrome/test/webdriver/commands/url_command.cc
@@ -8,6 +8,20 @@
namespace webdriver {
+URLCommand::URLCommand(const std::vector<std::string>& path_segments,
+ const DictionaryValue* const parameters)
+ : WebDriverCommand(path_segments, parameters) {}
+
+URLCommand::~URLCommand() {}
+
+bool URLCommand::DoesGet() {
+ return true;
+}
+
+bool URLCommand::DoesPost() {
+ return true;
+}
+
void URLCommand::ExecuteGet(Response* const response) {
std::string url;
if (!session_->GetURL(&url)) {
@@ -38,4 +52,8 @@ void URLCommand::ExecutePost(Response* const response) {
response->set_status(kSuccess);
}
+bool URLCommand::RequiresValidTab() {
+ return true;
+}
+
} // namespace webdriver
diff --git a/chrome/test/webdriver/commands/url_command.h b/chrome/test/webdriver/commands/url_command.h
index db1b7fc..06c6200 100644
--- a/chrome/test/webdriver/commands/url_command.h
+++ b/chrome/test/webdriver/commands/url_command.h
@@ -17,18 +17,17 @@ namespace webdriver {
// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/url
class URLCommand : public WebDriverCommand {
public:
- inline URLCommand(const std::vector<std::string>& path_segments,
- const DictionaryValue* const parameters)
- : WebDriverCommand(path_segments, parameters) {}
- virtual ~URLCommand() {}
+ URLCommand(const std::vector<std::string>& path_segments,
+ const DictionaryValue* const parameters);
+ virtual ~URLCommand();
- virtual bool DoesGet() { return true; }
- virtual bool DoesPost() { return true; }
+ virtual bool DoesGet();
+ virtual bool DoesPost();
virtual void ExecuteGet(Response* const response);
virtual void ExecutePost(Response* const response);
private:
- virtual bool RequiresValidTab() { return true; }
+ virtual bool RequiresValidTab();
DISALLOW_COPY_AND_ASSIGN(URLCommand);
};