Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/test/base/chrome_render_view_host_test_harness.cc

Issue 12374007: signin: force web signin flow initiated visits to accounts.google.com to their own process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/signin_manager_factory.h"
8 #include "chrome/browser/signin/signin_manager_fake.h"
7 #include "chrome/test/base/testing_profile.h" 9 #include "chrome/test/base/testing_profile.h"
8 10
9 #if defined(USE_ASH) 11 #if defined(USE_ASH)
10 #include "ash/shell.h" 12 #include "ash/shell.h"
11 #endif 13 #endif
12 14
13 #if defined(USE_AURA) 15 #if defined(USE_AURA)
14 #include "ui/aura/env.h" 16 #include "ui/aura/env.h"
15 #include "ui/aura/root_window.h" 17 #include "ui/aura/root_window.h"
16 #endif 18 #endif
17 19
18 using content::RenderViewHostTester; 20 using content::RenderViewHostTester;
19 using content::RenderViewHostTestHarness; 21 using content::RenderViewHostTestHarness;
20 22
21 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness() 23 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness()
22 : RenderViewHostTestHarness() { 24 : RenderViewHostTestHarness() {
23 } 25 }
24 26
25 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() { 27 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() {
26 } 28 }
27 29
28 TestingProfile* ChromeRenderViewHostTestHarness::profile() { 30 TestingProfile* ChromeRenderViewHostTestHarness::profile() {
29 return static_cast<TestingProfile*>(browser_context_.get()); 31 return static_cast<TestingProfile*>(browser_context_.get());
30 } 32 }
31 33
32 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { 34 RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() {
33 return RenderViewHostTester::For(rvh()); 35 return RenderViewHostTester::For(rvh());
34 } 36 }
35 37
38 static ProfileKeyedService* BuildSigninManagerFake(Profile* profile) {
39 return new FakeSigninManager(profile);
40 }
41
36 void ChromeRenderViewHostTestHarness::SetUp() { 42 void ChromeRenderViewHostTestHarness::SetUp() {
37 if (!browser_context_.get()) 43 Profile* profile = Profile::FromBrowserContext(browser_context_.get());
38 browser_context_.reset(new TestingProfile()); 44 if (!profile) {
45 profile = new TestingProfile();
46 browser_context_.reset(profile);
47 }
48 SigninManagerFactory::GetInstance()->SetTestingFactory(
49 profile, BuildSigninManagerFake);
39 RenderViewHostTestHarness::SetUp(); 50 RenderViewHostTestHarness::SetUp();
40 } 51 }
41 52
42 void ChromeRenderViewHostTestHarness::TearDown() { 53 void ChromeRenderViewHostTestHarness::TearDown() {
43 RenderViewHostTestHarness::TearDown(); 54 RenderViewHostTestHarness::TearDown();
44 #if defined(USE_ASH) 55 #if defined(USE_ASH)
45 ash::Shell::DeleteInstance(); 56 ash::Shell::DeleteInstance();
46 #endif 57 #endif
47 #if defined(USE_AURA) 58 #if defined(USE_AURA)
48 aura::Env::DeleteInstance(); 59 aura::Env::DeleteInstance();
49 #endif 60 #endif
50 } 61 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698