| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FAKE_SIGNIN_MANAGER_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "components/signin/core/browser/signin_manager.h" | 13 #include "components/signin/core/browser/signin_manager.h" |
| 14 #include "components/signin/core/browser/signin_metrics.h" | 14 #include "components/signin/core/browser/signin_metrics.h" |
| 15 | 15 |
| 16 // SigninManager to use for testing. Tests should use the type | 16 // SigninManager to use for testing. Tests should use the type |
| 17 // SigninManagerForTesting to ensure that the right type for their platform is | 17 // SigninManagerForTesting to ensure that the right type for their platform is |
| 18 // used. | 18 // used. |
| 19 | 19 |
| 20 // Overrides InitTokenService to do-nothing in tests. | |
| 21 class FakeSigninManagerBase : public SigninManagerBase { | 20 class FakeSigninManagerBase : public SigninManagerBase { |
| 22 public: | 21 public: |
| 23 FakeSigninManagerBase(SigninClient* client, | 22 FakeSigninManagerBase(SigninClient* client, |
| 24 AccountTrackerService* account_tracker_service); | 23 AccountTrackerService* account_tracker_service); |
| 25 ~FakeSigninManagerBase() override; | 24 ~FakeSigninManagerBase() override; |
| 26 | 25 |
| 26 bool AuthInProgress() const override; |
| 27 |
| 28 void SetAuthInProgress(bool auth_in_progress); |
| 29 |
| 27 void SignIn(const std::string& account_id); | 30 void SignIn(const std::string& account_id); |
| 31 |
| 32 private: |
| 33 bool auth_in_progress_; |
| 28 }; | 34 }; |
| 29 | 35 |
| 30 #if !defined(OS_CHROMEOS) | 36 #if !defined(OS_CHROMEOS) |
| 31 | 37 |
| 32 // A signin manager that bypasses actual authentication routines with servers | 38 // A signin manager that bypasses actual authentication routines with servers |
| 33 // and accepts the credentials provided to StartSignIn. | 39 // and accepts the credentials provided to StartSignIn. |
| 34 class FakeSigninManager : public SigninManager { | 40 class FakeSigninManager : public SigninManager { |
| 35 public: | 41 public: |
| 36 FakeSigninManager(SigninClient* client, | 42 FakeSigninManager(SigninClient* client, |
| 37 ProfileOAuth2TokenService* token_service, | 43 ProfileOAuth2TokenService* token_service, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 65 | 71 |
| 66 void CompletePendingSignin() override; | 72 void CompletePendingSignin() override; |
| 67 | 73 |
| 68 // Username specified in StartSignInWithRefreshToken() call. | 74 // Username specified in StartSignInWithRefreshToken() call. |
| 69 std::string username_; | 75 std::string username_; |
| 70 }; | 76 }; |
| 71 | 77 |
| 72 #endif // !defined (OS_CHROMEOS) | 78 #endif // !defined (OS_CHROMEOS) |
| 73 | 79 |
| 74 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ | 80 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_ |
| OLD | NEW |