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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/signin/core/browser/test_signin_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/test_signin_client.cc
diff --git a/components/signin/core/browser/test_signin_client.cc b/components/signin/core/browser/test_signin_client.cc
index e197354138296c3d65d786b483a033536afd3728..7b1d6a4e339e2f043d932ffbc73ae55cb67cd0ba 100644
--- a/components/signin/core/browser/test_signin_client.cc
+++ b/components/signin/core/browser/test_signin_client.cc
@@ -13,6 +13,12 @@
#include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h"
#endif
+namespace {
+
+// Helper for testing.
+const int kInvalidProcessId = -1;
+}
+
TestSigninClient::TestSigninClient()
: request_context_(new net::TestURLRequestContextGetter(
base::MessageLoopProxy::current())) {
@@ -71,3 +77,23 @@ TestSigninClient::GetIOSProviderAsFake() {
return iosProvider_.get();
}
#endif
+
+void TestSigninClient::SetSigninProcess(int process_id) {
+ if (process_id == signin_host_id_)
+ return;
+ DLOG_IF(WARNING, signin_host_id_ != kInvalidProcessId)
+ << "Replacing in-use signin process.";
+ signin_host_id_ = process_id;
+}
+
+void TestSigninClient::ClearSigninProcess() {
+ signin_host_id_ = kInvalidProcessId;
+}
+
+bool TestSigninClient::IsSigninProcess(int process_id) const {
+ return process_id == signin_host_id_;
+}
+
+bool TestSigninClient::HasSigninProcess() const {
+ return signin_host_id_ != kInvalidProcessId;
+}
« 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