Chromium Code Reviews| 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 Profile; | |
| 21 | |
| 22 namespace content { | |
| 23 class BrowserContext; | |
| 24 } | |
|
Roger Tawa OOO till Jul 10th
2014/05/27 19:15:38
Do we need these forward declares? I'm not sure t
Mike Lerman
2014/05/27 19:43:03
Done.
| |
| 25 | |
| 20 // An implementation of SigninClient for use in unittests. Instantiates test | 26 // An implementation of SigninClient for use in unittests. Instantiates test |
| 21 // versions of the various objects that SigninClient is required to provide as | 27 // versions of the various objects that SigninClient is required to provide as |
| 22 // part of its interface. | 28 // part of its interface. |
| 23 class TestSigninClient : public SigninClient { | 29 class TestSigninClient : public SigninClient { |
| 24 public: | 30 public: |
| 25 TestSigninClient(); | 31 TestSigninClient(); |
| 32 TestSigninClient(PrefService* pref_service); | |
| 26 virtual ~TestSigninClient(); | 33 virtual ~TestSigninClient(); |
| 27 | 34 |
| 28 // SigninClient implementation that is specialized for unit tests. | 35 // SigninClient implementation that is specialized for unit tests. |
| 29 | 36 |
| 30 // Returns NULL. | 37 // Returns NULL. |
| 31 // NOTE: This should be changed to return a properly-initalized PrefService | 38 // NOTE: This should be changed to return a properly-initalized PrefService |
| 32 // once there is a unit test that requires it. | 39 // once there is a unit test that requires it. |
| 33 virtual PrefService* GetPrefs() OVERRIDE; | 40 virtual PrefService* GetPrefs() OVERRIDE; |
| 34 | 41 |
| 35 // Returns a pointer to a loaded database. | 42 // Returns a pointer to a loaded database. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 | 74 |
| 68 private: | 75 private: |
| 69 // Loads the token database. | 76 // Loads the token database. |
| 70 void LoadDatabase(); | 77 void LoadDatabase(); |
| 71 | 78 |
| 72 base::ScopedTempDir temp_dir_; | 79 base::ScopedTempDir temp_dir_; |
| 73 scoped_refptr<net::TestURLRequestContextGetter> request_context_; | 80 scoped_refptr<net::TestURLRequestContextGetter> request_context_; |
| 74 scoped_refptr<TokenWebData> database_; | 81 scoped_refptr<TokenWebData> database_; |
| 75 int signin_host_id_; | 82 int signin_host_id_; |
| 76 | 83 |
| 84 PrefService* pref_service_; | |
| 85 | |
| 77 #if defined(OS_IOS) | 86 #if defined(OS_IOS) |
| 78 scoped_ptr<ios::FakeProfileOAuth2TokenServiceIOSProvider> iosProvider_; | 87 scoped_ptr<ios::FakeProfileOAuth2TokenServiceIOSProvider> iosProvider_; |
| 79 #endif | 88 #endif |
| 80 | 89 |
| 81 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); | 90 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); |
| 82 }; | 91 }; |
| 83 | 92 |
| 84 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 93 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
| OLD | NEW |