OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // A base test fixture for mocking sync and signin infrastructure. Used for | 5 // A base test fixture for mocking sync and signin infrastructure. Used for |
6 // testing sync-related code. | 6 // testing sync-related code. |
7 | 7 |
8 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_USERNAME_TEST_BASE_H_ | 8 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_USERNAME_TEST_BASE_H_ |
9 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_USERNAME_TEST_BASE_H_ | 9 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_USERNAME_TEST_BASE_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "components/autofill/core/common/password_form.h" | 13 #include "components/autofill/core/common/password_form.h" |
14 #include "components/pref_registry/testing_pref_service_syncable.h" | |
15 #include "components/signin/core/browser/account_tracker_service.h" | 14 #include "components/signin/core/browser/account_tracker_service.h" |
16 #include "components/signin/core/browser/signin_manager_base.h" | 15 #include "components/signin/core/browser/signin_manager_base.h" |
17 #include "components/signin/core/browser/test_signin_client.h" | 16 #include "components/signin/core/browser/test_signin_client.h" |
18 #include "components/sync/base/model_type.h" | 17 #include "components/sync/base/model_type.h" |
19 #include "components/sync/driver/fake_sync_service.h" | 18 #include "components/sync/driver/fake_sync_service.h" |
| 19 #include "components/sync_preferences/testing_pref_service_syncable.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 namespace password_manager { | 22 namespace password_manager { |
23 | 23 |
24 class SyncUsernameTestBase : public testing::Test { | 24 class SyncUsernameTestBase : public testing::Test { |
25 public: | 25 public: |
26 SyncUsernameTestBase(); | 26 SyncUsernameTestBase(); |
27 ~SyncUsernameTestBase() override; | 27 ~SyncUsernameTestBase() override; |
28 | 28 |
29 // Instruct the signin manager to sign in with |email| or out. | 29 // Instruct the signin manager to sign in with |email| or out. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 class FakeSigninManagerBase : public SigninManagerBase { | 62 class FakeSigninManagerBase : public SigninManagerBase { |
63 public: | 63 public: |
64 FakeSigninManagerBase(SigninClient* client, | 64 FakeSigninManagerBase(SigninClient* client, |
65 AccountTrackerService* account_tracker_service) | 65 AccountTrackerService* account_tracker_service) |
66 : SigninManagerBase(client, account_tracker_service) {} | 66 : SigninManagerBase(client, account_tracker_service) {} |
67 | 67 |
68 using SigninManagerBase::clear_authenticated_user; | 68 using SigninManagerBase::clear_authenticated_user; |
69 }; | 69 }; |
70 | 70 |
71 user_prefs::TestingPrefServiceSyncable prefs_; | 71 sync_preferences::TestingPrefServiceSyncable prefs_; |
72 TestSigninClient signin_client_; | 72 TestSigninClient signin_client_; |
73 AccountTrackerService account_tracker_; | 73 AccountTrackerService account_tracker_; |
74 FakeSigninManagerBase signin_manager_; | 74 FakeSigninManagerBase signin_manager_; |
75 LocalFakeSyncService sync_service_; | 75 LocalFakeSyncService sync_service_; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace password_manager | 78 } // namespace password_manager |
79 | 79 |
80 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_USERNAME_TEST_BASE_H_ | 80 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_USERNAME_TEST_BASE_H_ |
OLD | NEW |