| 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 "base/memory/scoped_ptr.h" |
| 13 #include "components/signin/core/browser/signin_client.h" | 13 #include "components/signin/core/browser/signin_client.h" |
| 14 #include "net/url_request/url_request_test_util.h" | 14 #include "net/url_request/url_request_test_util.h" |
| 15 | 15 |
| 16 #if defined(OS_IOS) | 16 #if defined(OS_IOS) |
| 17 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h" | 17 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 class PrefService; |
| 21 |
| 20 // An implementation of SigninClient for use in unittests. Instantiates test | 22 // An implementation of SigninClient for use in unittests. Instantiates test |
| 21 // versions of the various objects that SigninClient is required to provide as | 23 // versions of the various objects that SigninClient is required to provide as |
| 22 // part of its interface. | 24 // part of its interface. |
| 23 class TestSigninClient : public SigninClient { | 25 class TestSigninClient : public SigninClient { |
| 24 public: | 26 public: |
| 25 TestSigninClient(); | 27 TestSigninClient(); |
| 28 TestSigninClient(PrefService* pref_service); |
| 26 virtual ~TestSigninClient(); | 29 virtual ~TestSigninClient(); |
| 27 | 30 |
| 28 // SigninClient implementation that is specialized for unit tests. | 31 // SigninClient implementation that is specialized for unit tests. |
| 29 | 32 |
| 30 // Returns NULL. | 33 // Returns NULL. |
| 31 // NOTE: This should be changed to return a properly-initalized PrefService | 34 // NOTE: This should be changed to return a properly-initalized PrefService |
| 32 // once there is a unit test that requires it. | 35 // once there is a unit test that requires it. |
| 33 virtual PrefService* GetPrefs() OVERRIDE; | 36 virtual PrefService* GetPrefs() OVERRIDE; |
| 34 | 37 |
| 35 // Returns a pointer to a loaded database. | 38 // Returns a pointer to a loaded database. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 70 |
| 68 private: | 71 private: |
| 69 // Loads the token database. | 72 // Loads the token database. |
| 70 void LoadDatabase(); | 73 void LoadDatabase(); |
| 71 | 74 |
| 72 base::ScopedTempDir temp_dir_; | 75 base::ScopedTempDir temp_dir_; |
| 73 scoped_refptr<net::TestURLRequestContextGetter> request_context_; | 76 scoped_refptr<net::TestURLRequestContextGetter> request_context_; |
| 74 scoped_refptr<TokenWebData> database_; | 77 scoped_refptr<TokenWebData> database_; |
| 75 int signin_host_id_; | 78 int signin_host_id_; |
| 76 | 79 |
| 80 PrefService* pref_service_; |
| 81 |
| 77 #if defined(OS_IOS) | 82 #if defined(OS_IOS) |
| 78 scoped_ptr<ios::FakeProfileOAuth2TokenServiceIOSProvider> iosProvider_; | 83 scoped_ptr<ios::FakeProfileOAuth2TokenServiceIOSProvider> iosProvider_; |
| 79 #endif | 84 #endif |
| 80 | 85 |
| 81 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); | 86 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); |
| 82 }; | 87 }; |
| 83 | 88 |
| 84 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 89 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
| OLD | NEW |