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 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" |
12 #include "components/signin/core/browser/signin_client.h" | 13 #include "components/signin/core/browser/signin_client.h" |
13 #include "net/url_request/url_request_test_util.h" | 14 #include "net/url_request/url_request_test_util.h" |
14 | 15 |
| 16 #if defined(OS_IOS) |
| 17 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h" |
| 18 #endif |
| 19 |
15 // An implementation of SigninClient for use in unittests. Instantiates test | 20 // An implementation of SigninClient for use in unittests. Instantiates test |
16 // versions of the various objects that SigninClient is required to provide as | 21 // versions of the various objects that SigninClient is required to provide as |
17 // part of its interface. | 22 // part of its interface. |
18 class TestSigninClient : public SigninClient { | 23 class TestSigninClient : public SigninClient { |
19 public: | 24 public: |
20 TestSigninClient(); | 25 TestSigninClient(); |
21 virtual ~TestSigninClient(); | 26 virtual ~TestSigninClient(); |
22 | 27 |
23 // SigninClient implementation that is specialized for unit tests. | 28 // SigninClient implementation that is specialized for unit tests. |
24 | 29 |
(...skipping 18 matching lines...) Expand all Loading... |
43 virtual ios::ProfileOAuth2TokenServiceIOSProvider* GetIOSProvider() OVERRIDE; | 48 virtual ios::ProfileOAuth2TokenServiceIOSProvider* GetIOSProvider() OVERRIDE; |
44 #endif | 49 #endif |
45 | 50 |
46 // Returns true. | 51 // Returns true. |
47 virtual bool ShouldMergeSigninCredentialsIntoCookieJar() OVERRIDE; | 52 virtual bool ShouldMergeSigninCredentialsIntoCookieJar() OVERRIDE; |
48 | 53 |
49 // Does nothing. | 54 // Does nothing. |
50 virtual void SetCookieChangedCallback(const CookieChangedCallback& callback) | 55 virtual void SetCookieChangedCallback(const CookieChangedCallback& callback) |
51 OVERRIDE; | 56 OVERRIDE; |
52 | 57 |
| 58 #if defined(OS_IOS) |
| 59 ios::FakeProfileOAuth2TokenServiceIOSProvider* GetIOSProviderAsFake(); |
| 60 #endif |
| 61 |
53 private: | 62 private: |
54 // Loads the token database. | 63 // Loads the token database. |
55 void LoadDatabase(); | 64 void LoadDatabase(); |
56 | 65 |
57 base::ScopedTempDir temp_dir_; | 66 base::ScopedTempDir temp_dir_; |
58 scoped_refptr<net::TestURLRequestContextGetter> request_context_; | 67 scoped_refptr<net::TestURLRequestContextGetter> request_context_; |
59 scoped_refptr<TokenWebData> database_; | 68 scoped_refptr<TokenWebData> database_; |
60 | 69 |
| 70 #if defined(OS_IOS) |
| 71 scoped_ptr<ios::FakeProfileOAuth2TokenServiceIOSProvider> iosProvider_; |
| 72 #endif |
| 73 |
61 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); | 74 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); |
62 }; | 75 }; |
63 | 76 |
64 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 77 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
OLD | NEW |