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

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

Issue 296703011: Change refs from ChromeSigninClient to base SigninClient class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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
« no previous file with comments | « components/signin/core/browser/test_signin_client.h ('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 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 {
17
18 // Helper for testing.
19 const int kInvalidProcessId = -1;
20 }
21
16 TestSigninClient::TestSigninClient() 22 TestSigninClient::TestSigninClient()
17 : request_context_(new net::TestURLRequestContextGetter( 23 : request_context_(new net::TestURLRequestContextGetter(
18 base::MessageLoopProxy::current())) { 24 base::MessageLoopProxy::current())) {
19 LoadDatabase(); 25 LoadDatabase();
20 } 26 }
21 27
22 TestSigninClient::~TestSigninClient() {} 28 TestSigninClient::~TestSigninClient() {}
23 29
24 PrefService* TestSigninClient::GetPrefs() { return NULL; } 30 PrefService* TestSigninClient::GetPrefs() { return NULL; }
25 31
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 70 }
65 71
66 ios::FakeProfileOAuth2TokenServiceIOSProvider* 72 ios::FakeProfileOAuth2TokenServiceIOSProvider*
67 TestSigninClient::GetIOSProviderAsFake() { 73 TestSigninClient::GetIOSProviderAsFake() {
68 if (!iosProvider_) { 74 if (!iosProvider_) {
69 iosProvider_.reset(new ios::FakeProfileOAuth2TokenServiceIOSProvider()); 75 iosProvider_.reset(new ios::FakeProfileOAuth2TokenServiceIOSProvider());
70 } 76 }
71 return iosProvider_.get(); 77 return iosProvider_.get();
72 } 78 }
73 #endif 79 #endif
80
81 void TestSigninClient::SetSigninProcess(int process_id) {
82 if (process_id == signin_host_id_)
83 return;
84 DLOG_IF(WARNING, signin_host_id_ != kInvalidProcessId)
85 << "Replacing in-use signin process.";
86 signin_host_id_ = process_id;
87 }
88
89 void TestSigninClient::ClearSigninProcess() {
90 signin_host_id_ = kInvalidProcessId;
91 }
92
93 bool TestSigninClient::IsSigninProcess(int process_id) const {
94 return process_id == signin_host_id_;
95 }
96
97 bool TestSigninClient::HasSigninProcess() const {
98 return signin_host_id_ != kInvalidProcessId;
99 }
OLDNEW
« no previous file with comments | « components/signin/core/browser/test_signin_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698