| 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/browser/webdata/web_data_service_factory.h" |
| 7 #include "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
| 8 | 9 |
| 9 #if defined(USE_ASH) | 10 #if defined(USE_ASH) |
| 10 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 11 #endif | 12 #endif |
| 12 | 13 |
| 13 #if defined(USE_AURA) | 14 #if defined(USE_AURA) |
| 14 #include "ui/aura/env.h" | 15 #include "ui/aura/env.h" |
| 15 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
| 16 #endif | 17 #endif |
| (...skipping 16 matching lines...) Expand all Loading... |
| 33 return web_contents(); | 34 return web_contents(); |
| 34 } | 35 } |
| 35 | 36 |
| 36 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { | 37 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { |
| 37 return RenderViewHostTester::For(rvh()); | 38 return RenderViewHostTester::For(rvh()); |
| 38 } | 39 } |
| 39 | 40 |
| 40 void ChromeRenderViewHostTestHarness::SetUp() { | 41 void ChromeRenderViewHostTestHarness::SetUp() { |
| 41 if (!browser_context_.get()) | 42 if (!browser_context_.get()) |
| 42 browser_context_.reset(new TestingProfile()); | 43 browser_context_.reset(new TestingProfile()); |
| 44 // WebDataService is not used in ChromeRenderViewHostTest, but requires DB |
| 45 // thread if instantiated. |
| 46 WebDataServiceFactory::GetInstance()->SetTestingFactory( |
| 47 Profile::FromBrowserContext(browser_context_.get()), NULL); |
| 48 |
| 43 RenderViewHostTestHarness::SetUp(); | 49 RenderViewHostTestHarness::SetUp(); |
| 44 } | 50 } |
| 45 | 51 |
| 46 void ChromeRenderViewHostTestHarness::TearDown() { | 52 void ChromeRenderViewHostTestHarness::TearDown() { |
| 47 RenderViewHostTestHarness::TearDown(); | 53 RenderViewHostTestHarness::TearDown(); |
| 48 #if defined(USE_ASH) | 54 #if defined(USE_ASH) |
| 49 ash::Shell::DeleteInstance(); | 55 ash::Shell::DeleteInstance(); |
| 50 #endif | 56 #endif |
| 51 #if defined(USE_AURA) | 57 #if defined(USE_AURA) |
| 52 aura::Env::DeleteInstance(); | 58 aura::Env::DeleteInstance(); |
| 53 #endif | 59 #endif |
| 54 } | 60 } |
| OLD | NEW |