OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "content/browser/renderer_host/render_view_host_impl.h" | 12 #include "content/browser/renderer_host/render_view_host_impl.h" |
13 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 13 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
14 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
15 #include "content/test/test_renderer_host.h" | 15 #include "content/test/test_renderer_host.h" |
16 | 16 |
17 // This file provides a testing framework for mocking out the RenderProcessHost | 17 // This file provides a testing framework for mocking out the RenderProcessHost |
18 // layer. It allows you to test RenderViewHost, TabContents, | 18 // layer. It allows you to test RenderViewHost, TabContents, |
19 // NavigationController, and other layers above that without running an actual | 19 // NavigationController, and other layers above that without running an actual |
20 // renderer process. | 20 // renderer process. |
21 // | 21 // |
22 // To use, derive your test base class from RenderViewHostTestHarness. | 22 // To use, derive your test base class from RenderViewHostImplTestHarness. |
23 | 23 |
24 namespace content { | 24 class TestTabContents; |
25 class SiteInstance; | 25 struct ViewHostMsg_FrameNavigate_Params; |
26 } | |
27 | 26 |
28 namespace gfx { | 27 namespace gfx { |
29 class Rect; | 28 class Rect; |
30 } | 29 } |
31 | 30 |
32 struct ViewHostMsg_FrameNavigate_Params; | 31 namespace content { |
33 | 32 |
34 namespace content { | 33 class SiteInstance; |
35 | 34 |
36 // Utility function to initialize ViewHostMsg_NavigateParams_Params | 35 // Utility function to initialize ViewHostMsg_NavigateParams_Params |
37 // with given |page_id|, |url| and |transition_type|. | 36 // with given |page_id|, |url| and |transition_type|. |
38 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, | 37 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, |
39 int page_id, | 38 int page_id, |
40 const GURL& url, | 39 const GURL& url, |
41 PageTransition transition_type); | 40 PageTransition transition_type); |
42 | 41 |
43 // TestRenderViewHostView ------------------------------------------------------ | 42 // TestRenderViewHostView ------------------------------------------------------ |
44 | 43 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 302 |
304 // Adds methods to get straight at the impl classes. | 303 // Adds methods to get straight at the impl classes. |
305 class RenderViewHostImplTestHarness : public RenderViewHostTestHarness { | 304 class RenderViewHostImplTestHarness : public RenderViewHostTestHarness { |
306 public: | 305 public: |
307 RenderViewHostImplTestHarness(); | 306 RenderViewHostImplTestHarness(); |
308 virtual ~RenderViewHostImplTestHarness(); | 307 virtual ~RenderViewHostImplTestHarness(); |
309 | 308 |
310 TestRenderViewHost* test_rvh(); | 309 TestRenderViewHost* test_rvh(); |
311 TestRenderViewHost* pending_test_rvh(); | 310 TestRenderViewHost* pending_test_rvh(); |
312 TestRenderViewHost* active_test_rvh(); | 311 TestRenderViewHost* active_test_rvh(); |
| 312 TestTabContents* contents(); |
313 | 313 |
314 private: | 314 private: |
315 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); | 315 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); |
316 }; | 316 }; |
317 | 317 |
318 } // namespace content | 318 } // namespace content |
319 | 319 |
320 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ | 320 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ |
OLD | NEW |