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

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

Issue 2696263002: Refactor ViewsDelegate and MD-ify the icon-to-text spacing for checkbox and radiobutton (Closed)
Patch Set: Fix unit tests to use a ViewsDelegate to guard against crashes Created 3 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h"
9 #include "build/build_config.h" 10 #include "build/build_config.h"
10 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/signin/account_tracker_service_factory.h" 12 #include "chrome/browser/signin/account_tracker_service_factory.h"
12 #include "chrome/browser/signin/chrome_signin_client_factory.h" 13 #include "chrome/browser/signin/chrome_signin_client_factory.h"
13 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" 14 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h"
14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
15 #include "chrome/browser/signin/signin_manager_factory.h" 16 #include "chrome/browser/signin/signin_manager_factory.h"
16 #include "chrome/test/base/testing_profile.h" 17 #include "chrome/test/base/testing_profile.h"
17 #include "components/signin/core/browser/fake_signin_manager.h" 18 #include "components/signin/core/browser/fake_signin_manager.h"
18 19
(...skipping 23 matching lines...) Expand all
42 signin_client, ProfileOAuth2TokenServiceFactory::GetForProfile(profile), 43 signin_client, ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
43 account_tracker_service, 44 account_tracker_service,
44 GaiaCookieManagerServiceFactory::GetForProfile(profile))); 45 GaiaCookieManagerServiceFactory::GetForProfile(profile)));
45 manager->Initialize(g_browser_process->local_state()); 46 manager->Initialize(g_browser_process->local_state());
46 return std::move(manager); 47 return std::move(manager);
47 #endif 48 #endif
48 } 49 }
49 50
50 } // namespace 51 } // namespace
51 52
52 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness() { 53 ChromeRenderViewHostTestHarness::ChromeRenderViewHostTestHarness()
53 } 54 : views_delegate_(base::MakeUnique<views::TestViewsDelegate>()) {}
54 55
55 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() { 56 ChromeRenderViewHostTestHarness::~ChromeRenderViewHostTestHarness() {
56 } 57 }
57 58
58 TestingProfile* ChromeRenderViewHostTestHarness::profile() { 59 TestingProfile* ChromeRenderViewHostTestHarness::profile() {
59 return static_cast<TestingProfile*>(browser_context()); 60 return static_cast<TestingProfile*>(browser_context());
60 } 61 }
61 62
62 void ChromeRenderViewHostTestHarness::TearDown() { 63 void ChromeRenderViewHostTestHarness::TearDown() {
63 RenderViewHostTestHarness::TearDown(); 64 RenderViewHostTestHarness::TearDown();
64 #if defined(USE_ASH) 65 #if defined(USE_ASH)
65 ash::Shell::DeleteInstance(); 66 ash::Shell::DeleteInstance();
66 #endif 67 #endif
67 } 68 }
68 69
69 content::BrowserContext* 70 content::BrowserContext*
70 ChromeRenderViewHostTestHarness::CreateBrowserContext() { 71 ChromeRenderViewHostTestHarness::CreateBrowserContext() {
71 TestingProfile::Builder builder; 72 TestingProfile::Builder builder;
72 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), 73 builder.AddTestingFactory(SigninManagerFactory::GetInstance(),
73 BuildSigninManagerFake); 74 BuildSigninManagerFake);
74 return builder.Build().release(); 75 return builder.Build().release();
75 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698