OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEST_RENDER_VIEW_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_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 "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "content/browser/renderer_host/mock_render_process_host.h" | 13 #include "content/browser/renderer_host/mock_render_process_host.h" |
14 #include "content/browser/renderer_host/render_view_host.h" | 14 #include "content/browser/renderer_host/render_view_host.h" |
15 #include "content/browser/renderer_host/render_view_host_factory.h" | 15 #include "content/browser/renderer_host/render_view_host_factory.h" |
16 #include "content/browser/renderer_host/render_widget_host_view.h" | 16 #include "content/browser/renderer_host/render_widget_host_view.h" |
17 #include "content/common/page_transition_types.h" | 17 #include "content/common/page_transition_types.h" |
| 18 #include "chrome/test/testing_browser_process_test.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 | 20 |
20 namespace gfx { | 21 namespace gfx { |
21 class Rect; | 22 class Rect; |
22 } | 23 } |
23 | 24 |
24 class NavigationController; | 25 class NavigationController; |
25 class SiteInstance; | 26 class SiteInstance; |
26 class TestingProfile; | 27 class TestingProfile; |
27 class TestTabContents; | 28 class TestTabContents; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // Instead, we set it right before we create a new RenderViewHost, which | 278 // Instead, we set it right before we create a new RenderViewHost, which |
278 // happens before the RenderProcessHost is created. This way, the instance | 279 // happens before the RenderProcessHost is created. This way, the instance |
279 // has the correct factory and creates our special RenderProcessHosts. | 280 // has the correct factory and creates our special RenderProcessHosts. |
280 RenderProcessHostFactory* render_process_host_factory_; | 281 RenderProcessHostFactory* render_process_host_factory_; |
281 | 282 |
282 DISALLOW_COPY_AND_ASSIGN(TestRenderViewHostFactory); | 283 DISALLOW_COPY_AND_ASSIGN(TestRenderViewHostFactory); |
283 }; | 284 }; |
284 | 285 |
285 // RenderViewHostTestHarness --------------------------------------------------- | 286 // RenderViewHostTestHarness --------------------------------------------------- |
286 | 287 |
287 class RenderViewHostTestHarness : public testing::Test { | 288 class RenderViewHostTestHarness : public TestingBrowserProcessTest { |
288 public: | 289 public: |
289 RenderViewHostTestHarness(); | 290 RenderViewHostTestHarness(); |
290 virtual ~RenderViewHostTestHarness(); | 291 virtual ~RenderViewHostTestHarness(); |
291 | 292 |
292 NavigationController& controller(); | 293 NavigationController& controller(); |
293 virtual TestTabContents* contents(); | 294 virtual TestTabContents* contents(); |
294 TestRenderViewHost* rvh(); | 295 TestRenderViewHost* rvh(); |
295 TestRenderViewHost* pending_rvh(); | 296 TestRenderViewHost* pending_rvh(); |
296 TestRenderViewHost* active_rvh(); | 297 TestRenderViewHost* active_rvh(); |
297 TestingProfile* profile(); | 298 TestingProfile* profile(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 MockRenderProcessHostFactory rph_factory_; | 330 MockRenderProcessHostFactory rph_factory_; |
330 TestRenderViewHostFactory rvh_factory_; | 331 TestRenderViewHostFactory rvh_factory_; |
331 | 332 |
332 private: | 333 private: |
333 scoped_ptr<TestTabContents> contents_; | 334 scoped_ptr<TestTabContents> contents_; |
334 | 335 |
335 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 336 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
336 }; | 337 }; |
337 | 338 |
338 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ | 339 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ |
OLD | NEW |