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/signin/fake_signin_manager.h" | 7 #include "chrome/browser/signin/fake_signin_manager.h" |
8 #include "chrome/browser/signin/signin_manager_factory.h" | 8 #include "chrome/browser/signin/signin_manager_factory.h" |
9 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 TestingProfile* ChromeRenderViewHostTestHarness::profile() { | 30 TestingProfile* ChromeRenderViewHostTestHarness::profile() { |
31 return static_cast<TestingProfile*>(browser_context_.get()); | 31 return static_cast<TestingProfile*>(browser_context_.get()); |
32 } | 32 } |
33 | 33 |
34 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { | 34 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { |
35 return RenderViewHostTester::For(rvh()); | 35 return RenderViewHostTester::For(rvh()); |
36 } | 36 } |
37 | 37 |
38 static ProfileKeyedService* BuildSigninManagerFake(Profile* profile) { | 38 static ProfileKeyedService* BuildSigninManagerFake(Profile* profile) { |
| 39 #if defined (OS_CHROMEOS) |
| 40 return new FakeSigninManagerBase(profile); |
| 41 #else |
39 return new FakeSigninManager(profile); | 42 return new FakeSigninManager(profile); |
| 43 #endif |
40 } | 44 } |
41 | 45 |
42 void ChromeRenderViewHostTestHarness::SetUp() { | 46 void ChromeRenderViewHostTestHarness::SetUp() { |
43 Profile* profile = Profile::FromBrowserContext(browser_context_.get()); | 47 Profile* profile = Profile::FromBrowserContext(browser_context_.get()); |
44 if (!profile) { | 48 if (!profile) { |
45 profile = new TestingProfile(); | 49 profile = new TestingProfile(); |
46 browser_context_.reset(profile); | 50 browser_context_.reset(profile); |
47 } | 51 } |
48 SigninManagerFactory::GetInstance()->SetTestingFactory( | 52 SigninManagerFactory::GetInstance()->SetTestingFactory( |
49 profile, BuildSigninManagerFake); | 53 profile, BuildSigninManagerFake); |
50 RenderViewHostTestHarness::SetUp(); | 54 RenderViewHostTestHarness::SetUp(); |
51 } | 55 } |
52 | 56 |
53 void ChromeRenderViewHostTestHarness::TearDown() { | 57 void ChromeRenderViewHostTestHarness::TearDown() { |
54 RenderViewHostTestHarness::TearDown(); | 58 RenderViewHostTestHarness::TearDown(); |
55 #if defined(USE_ASH) | 59 #if defined(USE_ASH) |
56 ash::Shell::DeleteInstance(); | 60 ash::Shell::DeleteInstance(); |
57 #endif | 61 #endif |
58 #if defined(USE_AURA) | 62 #if defined(USE_AURA) |
59 aura::Env::DeleteInstance(); | 63 aura::Env::DeleteInstance(); |
60 #endif | 64 #endif |
61 } | 65 } |
OLD | NEW |