Chromium Code Reviews| 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/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/signin/fake_signin_manager.h" | 8 #include "chrome/browser/signin/fake_signin_manager.h" |
| 9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 SigninManagerBase* signin = new SigninManagerBase(); | 42 SigninManagerBase* signin = new SigninManagerBase(); |
| 43 signin->Initialize(profile, NULL); | 43 signin->Initialize(profile, NULL); |
| 44 return signin; | 44 return signin; |
| 45 #else | 45 #else |
| 46 FakeSigninManager* manager = new FakeSigninManager(profile); | 46 FakeSigninManager* manager = new FakeSigninManager(profile); |
| 47 manager->Initialize(profile, g_browser_process->local_state()); | 47 manager->Initialize(profile, g_browser_process->local_state()); |
| 48 return manager; | 48 return manager; |
| 49 #endif | 49 #endif |
| 50 } | 50 } |
| 51 | 51 |
| 52 void ChromeRenderViewHostTestHarness::SetUp() { | |
| 53 RenderViewHostTestHarness::SetUp(); | |
| 54 SigninManagerFactory::GetInstance()->SetTestingFactory( | |
| 55 profile(), BuildSigninManagerFake); | |
| 56 } | |
| 57 | |
| 58 void ChromeRenderViewHostTestHarness::TearDown() { | 52 void ChromeRenderViewHostTestHarness::TearDown() { |
| 59 RenderViewHostTestHarness::TearDown(); | 53 RenderViewHostTestHarness::TearDown(); |
| 60 #if defined(USE_ASH) | 54 #if defined(USE_ASH) |
| 61 ash::Shell::DeleteInstance(); | 55 ash::Shell::DeleteInstance(); |
| 62 #endif | 56 #endif |
| 63 #if defined(USE_AURA) | 57 #if defined(USE_AURA) |
| 64 aura::Env::DeleteInstance(); | 58 aura::Env::DeleteInstance(); |
| 65 #endif | 59 #endif |
| 66 } | 60 } |
| 67 | 61 |
| 68 content::BrowserContext* | 62 content::BrowserContext* |
| 69 ChromeRenderViewHostTestHarness::CreateBrowserContext() { | 63 ChromeRenderViewHostTestHarness::CreateBrowserContext() { |
| 70 return new TestingProfile(); | 64 TestingProfile* profile = new TestingProfile(); |
|
Andrew T Wilson (Slow)
2014/03/10 12:30:45
Use TestingProfile::Builder and set the testing fa
blundell
2014/03/11 12:02:47
+1, great catch Drew.
On 2014/03/10 12:30:45, And
| |
| 65 SigninManagerFactory::GetInstance()->SetTestingFactory( | |
| 66 profile, BuildSigninManagerFake); | |
| 67 return profile; | |
| 71 } | 68 } |
| OLD | NEW |