| 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; |
| 16 |
| 15 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness() | 17 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness() |
| 16 : RenderViewHostTestHarness() { | 18 : RenderViewHostTestHarness() { |
| 17 } | 19 } |
| 18 | 20 |
| 19 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() { | 21 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() { |
| 20 } | 22 } |
| 21 | 23 |
| 22 TestingProfile* ChromeRenderViewHostTestHarness::profile() { | 24 TestingProfile* ChromeRenderViewHostTestHarness::profile() { |
| 23 return static_cast<TestingProfile*>(browser_context_.get()); | 25 return static_cast<TestingProfile*>(browser_context_.get()); |
| 24 } | 26 } |
| 25 | 27 |
| 28 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { |
| 29 return RenderViewHostTester::For(rvh()); |
| 30 } |
| 31 |
| 26 void ChromeRenderViewHostTestHarness::SetUp() { | 32 void ChromeRenderViewHostTestHarness::SetUp() { |
| 27 if (!browser_context_.get()) | 33 if (!browser_context_.get()) |
| 28 browser_context_.reset(new TestingProfile()); | 34 browser_context_.reset(new TestingProfile()); |
| 29 RenderViewHostTestHarness::SetUp(); | 35 RenderViewHostTestHarness::SetUp(); |
| 30 } | 36 } |
| 31 | 37 |
| 32 void ChromeRenderViewHostTestHarness::TearDown() { | 38 void ChromeRenderViewHostTestHarness::TearDown() { |
| 33 RenderViewHostTestHarness::TearDown(); | 39 RenderViewHostTestHarness::TearDown(); |
| 34 #if defined(USE_AURA) | 40 #if defined(USE_AURA) |
| 35 ash::Shell::DeleteInstance(); | 41 ash::Shell::DeleteInstance(); |
| 36 aura::Env::DeleteInstance(); | 42 aura::Env::DeleteInstance(); |
| 37 #endif | 43 #endif |
| 38 } | 44 } |
| OLD | NEW |