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 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 5 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
6 | 6 |
7 #include "chrome/test/base/testing_profile.h" | 7 #include "chrome/test/base/testing_profile.h" |
8 | 8 |
9 #if defined(USE_AURA) | 9 #if defined(USE_AURA) |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
12 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
13 #endif | 13 #endif |
14 | 14 |
15 using content::RenderViewHostTester; | 15 using content::RenderViewHostTester; |
16 | 16 |
17 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness() | 17 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness() |
18 : RenderViewHostTestHarness() { | 18 : RenderViewHostTestHarness() { |
19 } | 19 } |
20 | 20 |
21 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() { | 21 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() { |
22 } | 22 } |
23 | 23 |
24 TestingProfile* ChromeRenderViewHostTestHarness::profile() { | 24 TestingProfile* ChromeRenderViewHostTestHarness::profile() { |
25 return static_cast<TestingProfile*>(browser_context_.get()); | 25 return static_cast<TestingProfile*>(browser_context_.get()); |
26 } | 26 } |
27 | 27 |
| 28 content::WebContents* ChromeRenderViewHostTestHarness::contents() { |
| 29 return web_contents(); |
| 30 } |
| 31 |
28 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { | 32 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { |
29 return RenderViewHostTester::For(rvh()); | 33 return RenderViewHostTester::For(rvh()); |
30 } | 34 } |
31 | 35 |
32 void ChromeRenderViewHostTestHarness::SetUp() { | 36 void ChromeRenderViewHostTestHarness::SetUp() { |
33 if (!browser_context_.get()) | 37 if (!browser_context_.get()) |
34 browser_context_.reset(new TestingProfile()); | 38 browser_context_.reset(new TestingProfile()); |
35 RenderViewHostTestHarness::SetUp(); | 39 RenderViewHostTestHarness::SetUp(); |
36 } | 40 } |
37 | 41 |
38 void ChromeRenderViewHostTestHarness::TearDown() { | 42 void ChromeRenderViewHostTestHarness::TearDown() { |
39 RenderViewHostTestHarness::TearDown(); | 43 RenderViewHostTestHarness::TearDown(); |
40 #if defined(USE_AURA) | 44 #if defined(USE_AURA) |
41 ash::Shell::DeleteInstance(); | 45 ash::Shell::DeleteInstance(); |
42 aura::Env::DeleteInstance(); | 46 aura::Env::DeleteInstance(); |
43 #endif | 47 #endif |
44 } | 48 } |
OLD | NEW |