summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 17:33:59 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 17:33:59 +0000
commit19fbd619f3ce5562ed34ce0fea80250a2a296b19 (patch)
treeebc5f21e25fad9c93f6c5c54fef3dcd06093b9ab
parent78962e2e1abcf55d0600dfaf437c6a0675fd77c7 (diff)
downloadchromium_src-19fbd619f3ce5562ed34ce0fea80250a2a296b19.zip
chromium_src-19fbd619f3ce5562ed34ce0fea80250a2a296b19.tar.gz
chromium_src-19fbd619f3ce5562ed34ce0fea80250a2a296b19.tar.bz2
FBTF: Minor cleanup to testing headers.
BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3136014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57345 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/back_forward_menu_model_unittest.cc1
-rw-r--r--chrome/browser/browser_commands_unittest.cc1
-rw-r--r--chrome/browser/chromeos/offline/offline_load_page_unittest.cc1
-rw-r--r--chrome/browser/cocoa/bug_report_window_controller_unittest.mm1
-rw-r--r--chrome/browser/cocoa/collected_cookies_mac_unittest.mm1
-rw-r--r--chrome/browser/cocoa/html_dialog_window_controller_unittest.mm1
-rw-r--r--chrome/browser/cocoa/sad_tab_controller_unittest.mm2
-rw-r--r--chrome/browser/cocoa/web_drop_target_unittest.mm1
-rw-r--r--chrome/browser/dom_ui/dom_ui_unittest.cc4
-rw-r--r--chrome/browser/dom_ui/html_dialog_tab_contents_delegate_unittest.cc2
-rw-r--r--chrome/browser/download/save_package_unittest.cc1
-rw-r--r--chrome/browser/find_backend_unittest.cc2
-rw-r--r--chrome/browser/geolocation/geolocation_permission_context_unittest.cc2
-rw-r--r--chrome/browser/renderer_host/render_widget_host_unittest.cc1
-rw-r--r--chrome/browser/renderer_host/test/render_view_host_unittest.cc2
-rw-r--r--chrome/browser/renderer_host/test/site_instance_unittest.cc1
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.cc84
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.h86
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc2
-rw-r--r--chrome/browser/sessions/session_service_unittest.cc1
-rw-r--r--chrome/browser/sessions/tab_restore_service_browsertest.cc1
-rw-r--r--chrome/browser/tab_contents/navigation_controller_unittest.cc2
-rw-r--r--chrome/browser/tab_contents/render_view_host_manager_unittest.cc3
-rw-r--r--chrome/browser/tab_contents/test_tab_contents.cc1
-rw-r--r--chrome/browser/tab_contents/test_tab_contents.h2
-rw-r--r--chrome/browser/tab_contents/web_contents_unittest.cc1
-rw-r--r--chrome/browser/tabs/pinned_tab_codec_unittest.cc1
-rw-r--r--chrome/browser/tabs/tab_strip_model_unittest.cc2
-rw-r--r--chrome/browser/translate/translate_manager_unittest.cc2
-rw-r--r--chrome/browser/visitedlink_unittest.cc1
-rw-r--r--chrome/browser/web_applications/web_app_unittest.cc1
-rw-r--r--chrome/browser/wrench_menu_model_unittest.cc1
-rw-r--r--chrome/test/browser_with_test_window_test.cc2
33 files changed, 157 insertions, 60 deletions
diff --git a/chrome/browser/back_forward_menu_model_unittest.cc b/chrome/browser/back_forward_menu_model_unittest.cc
index 5666002..b4be325 100644
--- a/chrome/browser/back_forward_menu_model_unittest.cc
+++ b/chrome/browser/back_forward_menu_model_unittest.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/url_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/browser_commands_unittest.cc b/chrome/browser/browser_commands_unittest.cc
index 1a776b4..81bd0f5 100644
--- a/chrome/browser/browser_commands_unittest.cc
+++ b/chrome/browser/browser_commands_unittest.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/browser_with_test_window_test.h"
#include "chrome/test/testing_profile.h"
diff --git a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc
index b2702c1..9f5fcfb 100644
--- a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc
+++ b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/chromeos/offline/offline_load_page.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
diff --git a/chrome/browser/cocoa/bug_report_window_controller_unittest.mm b/chrome/browser/cocoa/bug_report_window_controller_unittest.mm
index 8dc62bf..5c78c67 100644
--- a/chrome/browser/cocoa/bug_report_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/bug_report_window_controller_unittest.mm
@@ -11,6 +11,7 @@
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/browser/profile.h"
+#include "chrome/test/testing_profile.h"
#import "testing/gtest_mac.h"
namespace {
diff --git a/chrome/browser/cocoa/collected_cookies_mac_unittest.mm b/chrome/browser/cocoa/collected_cookies_mac_unittest.mm
index ff6f3c5..033cc71 100644
--- a/chrome/browser/cocoa/collected_cookies_mac_unittest.mm
+++ b/chrome/browser/cocoa/collected_cookies_mac_unittest.mm
@@ -11,6 +11,7 @@
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/browser/profile.h"
+#include "chrome/test/testing_profile.h"
namespace {
diff --git a/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm b/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm
index 932c266..2ec3f6f 100644
--- a/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm
@@ -15,6 +15,7 @@
#include "chrome/browser/dom_ui/dom_ui.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
#include "chrome/test/browser_with_test_window_test.h"
+#include "chrome/test/testing_profile.h"
#include "gfx/size.h"
#include "googleurl/src/gurl.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/cocoa/sad_tab_controller_unittest.mm b/chrome/browser/cocoa/sad_tab_controller_unittest.mm
index bce97a6..c125f87 100644
--- a/chrome/browser/cocoa/sad_tab_controller_unittest.mm
+++ b/chrome/browser/cocoa/sad_tab_controller_unittest.mm
@@ -7,6 +7,8 @@
#import "chrome/browser/cocoa/sad_tab_controller.h"
#import "chrome/browser/cocoa/sad_tab_view.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
+#include "chrome/test/testing_profile.h"
@interface SadTabView (ExposedForTesting)
// Implementation is below.
diff --git a/chrome/browser/cocoa/web_drop_target_unittest.mm b/chrome/browser/cocoa/web_drop_target_unittest.mm
index 99405bb..6849646 100644
--- a/chrome/browser/cocoa/web_drop_target_unittest.mm
+++ b/chrome/browser/cocoa/web_drop_target_unittest.mm
@@ -8,6 +8,7 @@
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#import "chrome/browser/cocoa/web_drop_target.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
#import "third_party/mozilla/NSPasteboard+Utils.h"
#include "webkit/glue/webdropdata.h"
diff --git a/chrome/browser/dom_ui/dom_ui_unittest.cc b/chrome/browser/dom_ui/dom_ui_unittest.cc
index ffb1870..6bee126 100644
--- a/chrome/browser/dom_ui/dom_ui_unittest.cc
+++ b/chrome/browser/dom_ui/dom_ui_unittest.cc
@@ -4,8 +4,12 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/dom_ui/new_tab_ui.h"
+#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/url_constants.h"
+#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
class DOMUITest : public RenderViewHostTestHarness {
diff --git a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate_unittest.cc b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate_unittest.cc
index a088671..8e1b7ed 100644
--- a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate_unittest.cc
+++ b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate_unittest.cc
@@ -10,9 +10,11 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/browser_with_test_window_test.h"
#include "chrome/test/test_browser_window.h"
+#include "chrome/test/testing_profile.h"
#include "gfx/rect.h"
#include "googleurl/src/gurl.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/download/save_package_unittest.cc b/chrome/browser/download/save_package_unittest.cc
index b921b63..b315097 100644
--- a/chrome/browser/download/save_package_unittest.cc
+++ b/chrome/browser/download/save_package_unittest.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/download/save_package.h"
#include "chrome/browser/net/url_request_mock_http_job.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/find_backend_unittest.cc b/chrome/browser/find_backend_unittest.cc
index 172ecf9..ac8c5ce 100644
--- a/chrome/browser/find_backend_unittest.cc
+++ b/chrome/browser/find_backend_unittest.cc
@@ -7,7 +7,9 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/find_bar_state.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/url_constants.h"
+#include "chrome/test/testing_profile.h"
typedef RenderViewHostTestHarness FindBackendTest;
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
index 96cfd68..29c1cb3 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -14,9 +14,11 @@
#include "chrome/browser/renderer_host/mock_render_process_host.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/render_messages.h"
+#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
// TestTabContents short-circuits TAB_CONTENTS_INFOBAR_REMOVED to call
diff --git a/chrome/browser/renderer_host/render_widget_host_unittest.cc b/chrome/browser/renderer_host/render_widget_host_unittest.cc
index 35f35f8..1fe03ed 100644
--- a/chrome/browser/renderer_host/render_widget_host_unittest.cc
+++ b/chrome/browser/renderer_host/render_widget_host_unittest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
+#include "chrome/test/testing_profile.h"
#include "gfx/canvas_skia.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/renderer_host/test/render_view_host_unittest.cc b/chrome/browser/renderer_host/test/render_view_host_unittest.cc
index 969f874..2ec5b95 100644
--- a/chrome/browser/renderer_host/test/render_view_host_unittest.cc
+++ b/chrome/browser/renderer_host/test/render_view_host_unittest.cc
@@ -3,7 +3,9 @@
// found in the LICENSE file.
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/render_messages.h"
class RenderViewHostTest : public RenderViewHostTestHarness {
diff --git a/chrome/browser/renderer_host/test/site_instance_unittest.cc b/chrome/browser/renderer_host/test/site_instance_unittest.cc
index d965386..f756d2e 100644
--- a/chrome/browser/renderer_host/test/site_instance_unittest.cc
+++ b/chrome/browser/renderer_host/test/site_instance_unittest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/browsing_instance.h"
#include "chrome/browser/child_process_security_policy.h"
#include "chrome/browser/renderer_host/browser_render_process_host.h"
+#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/navigation_entry.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 bc6a65b..775c3bf 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.cc
+++ b/chrome/browser/renderer_host/test/test_render_view_host.cc
@@ -5,11 +5,14 @@
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/browser_url_handler.h"
+#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_backing_store.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/dom_storage_common.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
+#include "chrome/test/testing_profile.h"
#include "gfx/rect.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/glue/password_form.h"
@@ -100,6 +103,10 @@ TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
is_showing_(false) {
}
+gfx::Rect TestRenderWidgetHostView::GetViewBounds() const {
+ return gfx::Rect();
+}
+
BackingStore* TestRenderWidgetHostView::AllocBackingStore(
const gfx::Size& size) {
return new TestBackingStore(rwh_, size);
@@ -112,6 +119,16 @@ VideoLayer* TestRenderWidgetHostView::AllocVideoLayer(
}
#if defined(OS_MACOSX)
+
+void TestRenderWidgetHostView::ShowPopupWithItems(
+ gfx::Rect bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<WebMenuItem>& items,
+ bool right_aligned) {
+}
+
gfx::Rect TestRenderWidgetHostView::GetWindowRect() {
return gfx::Rect();
}
@@ -157,6 +174,73 @@ void TestRenderWidgetHostView::GpuRenderingStateDidChange() {
}
#endif
+TestRenderViewHostFactory::TestRenderViewHostFactory(
+ RenderProcessHostFactory* rph_factory)
+ : render_process_host_factory_(rph_factory) {
+ RenderViewHostFactory::RegisterFactory(this);
+}
+
+TestRenderViewHostFactory::~TestRenderViewHostFactory() {
+ RenderViewHostFactory::UnregisterFactory();
+}
+
+void TestRenderViewHostFactory::set_render_process_host_factory(
+ RenderProcessHostFactory* rph_factory) {
+ render_process_host_factory_ = rph_factory;
+}
+
+RenderViewHost* TestRenderViewHostFactory::CreateRenderViewHost(
+ SiteInstance* instance,
+ RenderViewHostDelegate* delegate,
+ int routing_id,
+ int64 session_storage_namespace_id) {
+ // See declaration of render_process_host_factory_ below.
+ instance->set_render_process_host_factory(render_process_host_factory_);
+ return new TestRenderViewHost(instance, delegate, routing_id);
+}
+
+RenderViewHostTestHarness::RenderViewHostTestHarness()
+ : rph_factory_(),
+ rvh_factory_(&rph_factory_),
+ contents_(NULL) {
+}
+
+RenderViewHostTestHarness::~RenderViewHostTestHarness() {
+}
+
+NavigationController& RenderViewHostTestHarness::controller() {
+ return contents_->controller();
+}
+
+TestTabContents* RenderViewHostTestHarness::contents() {
+ return contents_.get();
+}
+
+TestRenderViewHost* RenderViewHostTestHarness::rvh() {
+ return static_cast<TestRenderViewHost*>(contents_->render_view_host());
+}
+
+TestRenderViewHost* RenderViewHostTestHarness::pending_rvh() {
+ return static_cast<TestRenderViewHost*>(
+ contents_->render_manager()->pending_render_view_host());
+}
+
+TestRenderViewHost* RenderViewHostTestHarness::active_rvh() {
+ return pending_rvh() ? pending_rvh() : rvh();
+}
+
+TestingProfile* RenderViewHostTestHarness::profile() {
+ return profile_.get();
+}
+
+MockRenderProcessHost* RenderViewHostTestHarness::process() {
+ return static_cast<MockRenderProcessHost*>(rvh()->process());
+}
+
+void RenderViewHostTestHarness::DeleteContents() {
+ contents_.reset();
+}
+
void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) {
controller().LoadURL(url, GURL(), 0);
GURL loaded_url(url);
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 1730806..3792c48 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test/test_render_view_host.h
@@ -14,13 +14,19 @@
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_view_host_factory.h"
-#include "chrome/browser/renderer_host/site_instance.h"
-#include "chrome/browser/tab_contents/navigation_controller.h"
-#include "chrome/browser/tab_contents/test_tab_contents.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/test/testing_profile.h"
+#include "chrome/common/page_transition_types.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace gfx {
+class Rect;
+}
+
+class NavigationController;
+class SiteInstance;
+class TestingProfile;
+class TestTabContents;
+struct ViewHostMsg_FrameNavigate_Params;
+
// Utility function to initialize ViewHostMsg_NavigateParams_Params
// with given |page_id|, |url| and |transition_type|.
void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params,
@@ -65,7 +71,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
virtual void Show() { is_showing_ = true; }
virtual void Hide() { is_showing_ = false; }
virtual bool IsShowing() { return is_showing_; }
- virtual gfx::Rect GetViewBounds() const { return gfx::Rect(); }
+ virtual gfx::Rect GetViewBounds() const;
virtual void SetIsLoading(bool is_loading) {}
virtual void UpdateCursor(const WebCursor& cursor) {}
virtual void UpdateCursorIfOverSelf() {}
@@ -88,7 +94,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
double item_font_size,
int selected_item,
const std::vector<WebMenuItem>& items,
- bool right_aligned) {}
+ bool right_aligned);
virtual gfx::Rect GetWindowRect();
virtual gfx::Rect GetRootWindowRect();
virtual void SetActive(bool active);
@@ -202,28 +208,16 @@ class TestRenderViewHost : public RenderViewHost {
// registered at a time, you can only have one of these objects at a time.
class TestRenderViewHostFactory : public RenderViewHostFactory {
public:
- explicit TestRenderViewHostFactory(RenderProcessHostFactory* rph_factory)
- : render_process_host_factory_(rph_factory) {
- RenderViewHostFactory::RegisterFactory(this);
- }
- virtual ~TestRenderViewHostFactory() {
- RenderViewHostFactory::UnregisterFactory();
- }
+ explicit TestRenderViewHostFactory(RenderProcessHostFactory* rph_factory);
+ virtual ~TestRenderViewHostFactory();
virtual void set_render_process_host_factory(
- RenderProcessHostFactory* rph_factory) {
- render_process_host_factory_ = rph_factory;
- }
-
+ RenderProcessHostFactory* rph_factory);
virtual RenderViewHost* CreateRenderViewHost(
SiteInstance* instance,
RenderViewHostDelegate* delegate,
int routing_id,
- int64 session_storage_namespace_id) {
- // See declaration of render_process_host_factory_ below.
- instance->set_render_process_host_factory(render_process_host_factory_);
- return new TestRenderViewHost(instance, delegate, routing_id);
- }
+ int64 session_storage_namespace_id);
private:
// This is a bit of a hack. With the current design of the site instances /
@@ -242,45 +236,19 @@ class TestRenderViewHostFactory : public RenderViewHostFactory {
class RenderViewHostTestHarness : public testing::Test {
public:
- RenderViewHostTestHarness()
- : rph_factory_(),
- rvh_factory_(&rph_factory_),
- contents_(NULL) {}
- virtual ~RenderViewHostTestHarness() {}
-
- NavigationController& controller() {
- return contents_->controller();
- }
-
- TestTabContents* contents() {
- return contents_.get();
- }
+ RenderViewHostTestHarness();
+ virtual ~RenderViewHostTestHarness();
- TestRenderViewHost* rvh() {
- return static_cast<TestRenderViewHost*>(contents_->render_view_host());
- }
-
- TestRenderViewHost* pending_rvh() {
- return static_cast<TestRenderViewHost*>(
- contents_->render_manager()->pending_render_view_host());
- }
-
- TestRenderViewHost* active_rvh() {
- return pending_rvh() ? pending_rvh() : rvh();
- }
-
- TestingProfile* profile() {
- return profile_.get();
- }
-
- MockRenderProcessHost* process() {
- return static_cast<MockRenderProcessHost*>(rvh()->process());
- }
+ NavigationController& controller();
+ TestTabContents* contents();
+ TestRenderViewHost* rvh();
+ TestRenderViewHost* pending_rvh();
+ TestRenderViewHost* active_rvh();
+ TestingProfile* profile();
+ MockRenderProcessHost* process();
// Frees the current tab contents for tests that want to test destruction.
- void DeleteContents() {
- contents_.reset();
- }
+ void DeleteContents();
// Creates a pending navigation to the given URL with the default parameters
// and then commits the load with a page ID one larger than any seen. This
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index eef2a80a..db67004 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -7,6 +7,8 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
+#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
static const char* kGoogleURL = "http://www.google.com/";
diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc
index b13d37c..17e41ed 100644
--- a/chrome/browser/sessions/session_service_unittest.cc
+++ b/chrome/browser/sessions/session_service_unittest.cc
@@ -23,6 +23,7 @@
#include "chrome/common/notification_type.h"
#include "chrome/test/browser_with_test_window_test.h"
#include "chrome/test/file_test_utils.h"
+#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
class SessionServiceTest : public BrowserWithTestWindowTest,
diff --git a/chrome/browser/sessions/tab_restore_service_browsertest.cc b/chrome/browser/sessions/tab_restore_service_browsertest.cc
index 7abe43c..dcbd688 100644
--- a/chrome/browser/sessions/tab_restore_service_browsertest.cc
+++ b/chrome/browser/sessions/tab_restore_service_browsertest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/sessions/session_types.h"
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sessions/tab_restore_service.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/test/render_view_test.h"
#include "chrome/test/testing_profile.h"
diff --git a/chrome/browser/tab_contents/navigation_controller_unittest.cc b/chrome/browser/tab_contents/navigation_controller_unittest.cc
index ccb47d3..6c58c35 100644
--- a/chrome/browser/tab_contents/navigation_controller_unittest.cc
+++ b/chrome/browser/tab_contents/navigation_controller_unittest.cc
@@ -10,6 +10,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/history/history.h"
+#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sessions/session_service_test_helper.h"
@@ -18,6 +19,7 @@
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
diff --git a/chrome/browser/tab_contents/render_view_host_manager_unittest.cc b/chrome/browser/tab_contents/render_view_host_manager_unittest.cc
index 5b1141a..72dfaca 100644
--- a/chrome/browser/tab_contents/render_view_host_manager_unittest.cc
+++ b/chrome/browser/tab_contents/render_view_host_manager_unittest.cc
@@ -4,13 +4,16 @@
#include "chrome/browser/browser_url_handler.h"
#include "chrome/browser/chrome_thread.h"
+#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/render_view_host_manager.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/test_notification_tracker.h"
+#include "chrome/test/testing_profile.h"
#include "ipc/ipc_message.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/tab_contents/test_tab_contents.cc b/chrome/browser/tab_contents/test_tab_contents.cc
index 86c62fd..5ed4820 100644
--- a/chrome/browser/tab_contents/test_tab_contents.cc
+++ b/chrome/browser/tab_contents/test_tab_contents.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/browser/renderer_host/render_view_host.h"
+#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/common/notification_service.h"
diff --git a/chrome/browser/tab_contents/test_tab_contents.h b/chrome/browser/tab_contents/test_tab_contents.h
index 166618d..b9d3dc9 100644
--- a/chrome/browser/tab_contents/test_tab_contents.h
+++ b/chrome/browser/tab_contents/test_tab_contents.h
@@ -6,11 +6,11 @@
#define CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_
#pragma once
-#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_registrar.h"
#include "webkit/glue/webpreferences.h"
+class Profile;
class TestRenderViewHost;
// Subclass TabContents to ensure it creates TestRenderViewHosts and does
diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc
index 2f6f88e..a4bbf7b 100644
--- a/chrome/browser/tab_contents/web_contents_unittest.cc
+++ b/chrome/browser/tab_contents/web_contents_unittest.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/pref_value_store.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
+#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/tab_contents/interstitial_page.h"
diff --git a/chrome/browser/tabs/pinned_tab_codec_unittest.cc b/chrome/browser/tabs/pinned_tab_codec_unittest.cc
index c9461eb..a94934c 100644
--- a/chrome/browser/tabs/pinned_tab_codec_unittest.cc
+++ b/chrome/browser/tabs/pinned_tab_codec_unittest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/tabs/pinned_tab_codec.h"
#include "chrome/test/browser_with_test_window_test.h"
+#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
typedef BrowserInit::LaunchWithProfile::Tab Tab;
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc
index 6ce87f1..47cb0f1 100644
--- a/chrome/browser/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/tabs/tab_strip_model_unittest.cc
@@ -6,6 +6,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
+#include "base/string_number_conversions.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/stl_util-inl.h"
@@ -29,6 +30,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/property_bag.h"
#include "chrome/common/url_constants.h"
+#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
using testing::_;
diff --git a/chrome/browser/translate/translate_manager_unittest.cc b/chrome/browser/translate/translate_manager_unittest.cc
index 8a72ba5..f2d64af 100644
--- a/chrome/browser/translate/translate_manager_unittest.cc
+++ b/chrome/browser/translate/translate_manager_unittest.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/pref_service.h"
#include "chrome/browser/renderer_host/mock_render_process_host.h"
#include "chrome/browser/tab_contents/render_view_context_menu.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/browser/translate/translate_infobar_delegate.h"
#include "chrome/browser/translate/translate_manager.h"
#include "chrome/browser/translate/translate_prefs.h"
@@ -22,6 +23,7 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/net/test_url_fetcher_factory.h"
#include "chrome/test/testing_browser_process.h"
+#include "chrome/test/testing_profile.h"
#include "grit/generated_resources.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/cld/languages/public/languages.h"
diff --git a/chrome/browser/visitedlink_unittest.cc b/chrome/browser/visitedlink_unittest.cc
index b534c41..e4ea09c 100644
--- a/chrome/browser/visitedlink_unittest.cc
+++ b/chrome/browser/visitedlink_unittest.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/visitedlink_slave.h"
+#include "chrome/test/testing_profile.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/web_applications/web_app_unittest.cc b/chrome/browser/web_applications/web_app_unittest.cc
index 1162992..33e42b8 100644
--- a/chrome/browser/web_applications/web_app_unittest.cc
+++ b/chrome/browser/web_applications/web_app_unittest.cc
@@ -9,6 +9,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
+#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/common/render_messages.h"
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/wrench_menu_model_unittest.cc b/chrome/browser/wrench_menu_model_unittest.cc
index 2b50bb0..62ead13 100644
--- a/chrome/browser/wrench_menu_model_unittest.cc
+++ b/chrome/browser/wrench_menu_model_unittest.cc
@@ -8,6 +8,7 @@
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/test/browser_with_test_window_test.h"
#include "chrome/test/menu_model_test.h"
+#include "chrome/test/testing_profile.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/test/browser_with_test_window_test.cc b/chrome/test/browser_with_test_window_test.cc
index bf6f308..7c6b0ed 100644
--- a/chrome/test/browser_with_test_window_test.cc
+++ b/chrome/test/browser_with_test_window_test.cc
@@ -9,7 +9,9 @@
#endif // defined(OS_WIN)
#include "chrome/browser/browser.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/render_messages.h"
#include "chrome/test/testing_profile.h"