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

Side by Side Diff: ios/public/test/test_chrome_browser_provider.mm

Issue 1158223003: [iOS] Add FakeSyncService and factory for testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ios/public/test/test_chrome_browser_provider.h" 5 #include "ios/public/test/test_chrome_browser_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ios/public/test/fake_string_provider.h" 8 #include "ios/public/test/fake_string_provider.h"
9 #import "ios/public/test/test_keyed_service_provider.h"
9 10
10 namespace { 11 namespace {
11 const char kUIScheme[] = "uischeme"; 12 const char kUIScheme[] = "uischeme";
12 } 13 }
13 14
14 namespace ios { 15 namespace ios {
15 16
16 TestChromeBrowserProvider::TestChromeBrowserProvider() 17 TestChromeBrowserProvider::TestChromeBrowserProvider()
17 : string_provider_(new FakeStringProvider) { 18 : string_provider_(new FakeStringProvider),
19 test_keyed_service_provider_(new TestKeyedServiceProvider) {
18 } 20 }
19 21
20 TestChromeBrowserProvider::~TestChromeBrowserProvider() { 22 TestChromeBrowserProvider::~TestChromeBrowserProvider() {
21 } 23 }
22 24
23 // static 25 // static
24 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() { 26 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() {
25 ChromeBrowserProvider* provider = GetChromeBrowserProvider(); 27 ChromeBrowserProvider* provider = GetChromeBrowserProvider();
26 DCHECK(provider); 28 DCHECK(provider);
27 return static_cast<TestChromeBrowserProvider*>(provider); 29 return static_cast<TestChromeBrowserProvider*>(provider);
28 } 30 }
29 31
30 StringProvider* TestChromeBrowserProvider::GetStringProvider() { 32 StringProvider* TestChromeBrowserProvider::GetStringProvider() {
31 return string_provider_.get(); 33 return string_provider_.get();
32 } 34 }
33 35
36 KeyedServiceProvider* TestChromeBrowserProvider::GetKeyedServiceProvider() {
37 return test_keyed_service_provider_.get();
38 }
39
34 const char* TestChromeBrowserProvider::GetChromeUIScheme() { 40 const char* TestChromeBrowserProvider::GetChromeUIScheme() {
35 return kUIScheme; 41 return kUIScheme;
36 } 42 }
37 43
38 } // namespace ios 44 } // namespace ios
OLDNEW
« no previous file with comments | « ios/public/test/test_chrome_browser_provider.h ('k') | ios/public/test/test_keyed_service_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698