OLD | NEW |
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) |
| 13 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h" |
| 14 #endif |
| 15 |
12 TestSigninClient::TestSigninClient() | 16 TestSigninClient::TestSigninClient() |
13 : request_context_(new net::TestURLRequestContextGetter( | 17 : request_context_(new net::TestURLRequestContextGetter( |
14 base::MessageLoopProxy::current())) { | 18 base::MessageLoopProxy::current())) { |
15 LoadDatabase(); | 19 LoadDatabase(); |
16 } | 20 } |
17 | 21 |
18 TestSigninClient::~TestSigninClient() {} | 22 TestSigninClient::~TestSigninClient() {} |
19 | 23 |
20 PrefService* TestSigninClient::GetPrefs() { return NULL; } | 24 PrefService* TestSigninClient::GetPrefs() { return NULL; } |
21 | 25 |
(...skipping 27 matching lines...) Expand all Loading... |
49 | 53 |
50 bool TestSigninClient::ShouldMergeSigninCredentialsIntoCookieJar() { | 54 bool TestSigninClient::ShouldMergeSigninCredentialsIntoCookieJar() { |
51 return true; | 55 return true; |
52 } | 56 } |
53 | 57 |
54 void TestSigninClient::SetCookieChangedCallback( | 58 void TestSigninClient::SetCookieChangedCallback( |
55 const CookieChangedCallback& callback) {} | 59 const CookieChangedCallback& callback) {} |
56 | 60 |
57 #if defined(OS_IOS) | 61 #if defined(OS_IOS) |
58 ios::ProfileOAuth2TokenServiceIOSProvider* TestSigninClient::GetIOSProvider() { | 62 ios::ProfileOAuth2TokenServiceIOSProvider* TestSigninClient::GetIOSProvider() { |
59 // Just returns NULL for now. It should be changed to return an | 63 return GetIOSProviderAsFake(); |
60 // |ios::FakeProfileOAuth2TokenServiceIOSProvider|. | 64 } |
61 return NULL; | 65 |
| 66 ios::FakeProfileOAuth2TokenServiceIOSProvider* |
| 67 TestSigninClient::GetIOSProviderAsFake() { |
| 68 if (!iosProvider_) { |
| 69 iosProvider_.reset(new ios::FakeProfileOAuth2TokenServiceIOSProvider()); |
| 70 } |
| 71 return iosProvider_.get(); |
62 } | 72 } |
63 #endif | 73 #endif |
OLD | NEW |