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

Side by Side Diff: components/signin/core/browser/test_signin_client.cc

Issue 276463002: non-new-profile-management creates a "no-op" style account_reconcilor, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TestSigninClient for AccountReconcilorTests Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "components/signin/core/browser/test_signin_client.h" 6 #include "components/signin/core/browser/test_signin_client.h"
7 #include "components/signin/core/browser/webdata/token_service_table.h" 7 #include "components/signin/core/browser/webdata/token_service_table.h"
8 #include "components/webdata/common/web_data_service_base.h" 8 #include "components/webdata/common/web_data_service_base.h"
9 #include "components/webdata/common/web_database_service.h" 9 #include "components/webdata/common/web_database_service.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 #if defined(OS_IOS) 12 #if defined(OS_IOS)
13 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h" 13 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h"
14 #endif 14 #endif
15 15
16 namespace { 16 namespace {
17 17
18 // Helper for testing. 18 // Helper for testing.
19 const int kInvalidProcessId = -1; 19 const int kInvalidProcessId = -1;
20 } 20 }
21 21
22 TestSigninClient::TestSigninClient() 22 TestSigninClient::TestSigninClient()
23 : request_context_(new net::TestURLRequestContextGetter( 23 : request_context_(new net::TestURLRequestContextGetter(
24 base::MessageLoopProxy::current())) { 24 base::MessageLoopProxy::current())) {
Roger Tawa OOO till Jul 10th 2014/05/27 19:15:38 Set |pref_service_| member to NULL.
Mike Lerman 2014/05/27 19:43:03 Done.
25 LoadDatabase(); 25 LoadDatabase();
26 } 26 }
27 27
28 TestSigninClient::TestSigninClient(PrefService* pref_service)
29 : pref_service_(pref_service) {}
30
28 TestSigninClient::~TestSigninClient() {} 31 TestSigninClient::~TestSigninClient() {}
29 32
30 PrefService* TestSigninClient::GetPrefs() { return NULL; } 33 PrefService* TestSigninClient::GetPrefs() {
34 return pref_service_;
35 }
31 36
32 scoped_refptr<TokenWebData> TestSigninClient::GetDatabase() { 37 scoped_refptr<TokenWebData> TestSigninClient::GetDatabase() {
33 return database_; 38 return database_;
34 } 39 }
35 40
36 bool TestSigninClient::CanRevokeCredentials() { return true; } 41 bool TestSigninClient::CanRevokeCredentials() { return true; }
37 42
38 net::URLRequestContextGetter* TestSigninClient::GetURLRequestContext() { 43 net::URLRequestContextGetter* TestSigninClient::GetURLRequestContext() {
39 return request_context_; 44 return request_context_;
40 } 45 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 signin_host_id_ = kInvalidProcessId; 95 signin_host_id_ = kInvalidProcessId;
91 } 96 }
92 97
93 bool TestSigninClient::IsSigninProcess(int process_id) const { 98 bool TestSigninClient::IsSigninProcess(int process_id) const {
94 return process_id == signin_host_id_; 99 return process_id == signin_host_id_;
95 } 100 }
96 101
97 bool TestSigninClient::HasSigninProcess() const { 102 bool TestSigninClient::HasSigninProcess() const {
98 return signin_host_id_ != kInvalidProcessId; 103 return signin_host_id_ != kInvalidProcessId;
99 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698