Chromium Code Reviews| Index: content/browser/renderer_host/test_render_view_host.h |
| diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h |
| index 597bde2f33dfe07314028b49d0b9a494f8ead2df..a4ce2ae7f927a8b7719b8921519b6088c9998425 100644 |
| --- a/content/browser/renderer_host/test_render_view_host.h |
| +++ b/content/browser/renderer_host/test_render_view_host.h |
| @@ -17,6 +17,13 @@ |
| #include "content/public/common/page_transition_types.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| +// This file provides a testing framework for mocking out the RenderProcessHost |
| +// layer. It allows you to test RenderViewHost, TabContents, |
| +// NavigationController, and other layers above that without running an actual |
| +// renderer process. |
| +// |
| +// To use, derive your test base class from RenderViewHostTestHarness. |
| + |
| #if defined(USE_AURA) |
| namespace aura { |
| class RootWindow; |
| @@ -40,6 +47,8 @@ class Rect; |
| class TestTabContents; |
| struct ViewHostMsg_FrameNavigate_Params; |
| +namespace content { |
| + |
| // Utility function to initialize ViewHostMsg_NavigateParams_Params |
| // with given |page_id|, |url| and |transition_type|. |
| void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, |
| @@ -47,28 +56,18 @@ void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, |
| const GURL& url, |
| content::PageTransition transition_type); |
| -// This file provides a testing framework for mocking out the RenderProcessHost |
| -// layer. It allows you to test RenderViewHost, TabContents, |
| -// NavigationController, and other layers above that without running an actual |
| -// renderer process. |
| -// |
| -// To use, derive your test base class from RenderViewHostTestHarness. |
| - |
| - |
| -namespace content { |
| - |
| // TestRenderViewHostView ------------------------------------------------------ |
| // Subclass the RenderViewHost's view so that we can call Show(), etc., |
| // without having side-effects. |
| class TestRenderWidgetHostView : public RenderWidgetHostViewBase { |
| public: |
| - explicit TestRenderWidgetHostView(RenderWidgetHost* rwh); |
| + explicit TestRenderWidgetHostView(content::RenderWidgetHost* rwh); |
|
jam
2012/03/05 23:59:28
ditto
Jói
2012/03/06 16:38:55
Done.
|
| virtual ~TestRenderWidgetHostView(); |
| // RenderWidgetHostView implementation. |
| virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE {} |
| - virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; |
| + virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; |
| virtual void SetSize(const gfx::Size& size) OVERRIDE {} |
| virtual void SetBounds(const gfx::Rect& rect) OVERRIDE {} |
| virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| @@ -115,7 +114,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase { |
| const std::vector<gfx::Rect>& rects) OVERRIDE {} |
| virtual void RenderViewGone(base::TerminationStatus status, |
| int error_code) OVERRIDE; |
| - virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) { } |
| + virtual void WillDestroyRenderWidget(content::RenderWidgetHost* rwh) { } |
| virtual void Destroy() OVERRIDE {} |
| virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE {} |
| virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; |
| @@ -187,8 +186,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase { |
| bool is_showing_; |
| }; |
| -} // namespace content |
| - |
| #if defined(COMPILER_MSVC) |
| // See comment for same warning on RenderViewHostImpl. |
| #pragma warning(push) |
| @@ -311,6 +308,8 @@ class TestRenderViewHost : public RenderViewHostImpl { |
| #pragma warning(pop) |
| #endif |
| +} // namespace content |
| + |
| // TestRenderViewHostFactory --------------------------------------------------- |
| // Manages creation of the RenderViewHosts using our special subclass. This |
| @@ -325,7 +324,7 @@ class TestRenderViewHostFactory : public RenderViewHostFactory { |
| virtual void set_render_process_host_factory( |
| content::RenderProcessHostFactory* rph_factory); |
| - virtual RenderViewHost* CreateRenderViewHost( |
| + virtual content::RenderViewHost* CreateRenderViewHost( |
| content::SiteInstance* instance, |
| content::RenderViewHostDelegate* delegate, |
| int routing_id, |
| @@ -353,9 +352,9 @@ class RenderViewHostTestHarness : public testing::Test { |
| content::NavigationController& controller(); |
| virtual TestTabContents* contents(); |
| - TestRenderViewHost* rvh(); |
| - TestRenderViewHost* pending_rvh(); |
| - TestRenderViewHost* active_rvh(); |
| + content::TestRenderViewHost* rvh(); |
| + content::TestRenderViewHost* pending_rvh(); |
| + content::TestRenderViewHost* active_rvh(); |
| content::BrowserContext* browser_context(); |
| MockRenderProcessHost* process(); |