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 CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // A utility used by sync tests to create a TestingProfile with a Google | 30 // A utility used by sync tests to create a TestingProfile with a Google |
31 // Services username stored in a (Testing)PrefService. | 31 // Services username stored in a (Testing)PrefService. |
32 static TestingProfile* MakeSignedInTestingProfile(); | 32 static TestingProfile* MakeSignedInTestingProfile(); |
33 | 33 |
34 // Helper routine to be used in conjunction with | 34 // Helper routine to be used in conjunction with |
35 // BrowserContextKeyedServiceFactory::SetTestingFactory(). | 35 // BrowserContextKeyedServiceFactory::SetTestingFactory(). |
36 static KeyedService* BuildMockProfileSyncService( | 36 static KeyedService* BuildMockProfileSyncService( |
37 content::BrowserContext* profile); | 37 content::BrowserContext* profile); |
38 | 38 |
39 MOCK_METHOD0(DisableForUser, void()); | 39 MOCK_METHOD0(DisableForUser, void()); |
40 MOCK_METHOD3(OnBackendInitialized, | 40 MOCK_METHOD4(OnBackendInitialized, |
41 void(const syncer::WeakHandle<syncer::JsBackend>&, | 41 void(const syncer::WeakHandle<syncer::JsBackend>&, |
42 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, | 42 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, |
| 43 const std::string&, |
43 bool)); | 44 bool)); |
44 MOCK_METHOD0(OnSyncCycleCompleted, void()); | 45 MOCK_METHOD0(OnSyncCycleCompleted, void()); |
45 MOCK_METHOD0(OnAuthError, void()); | 46 MOCK_METHOD0(OnAuthError, void()); |
46 MOCK_METHOD4(OnUserSubmittedAuth, | 47 MOCK_METHOD4(OnUserSubmittedAuth, |
47 void(const std::string& username, | 48 void(const std::string& username, |
48 const std::string& password, | 49 const std::string& password, |
49 const std::string& captcha, | 50 const std::string& captcha, |
50 const std::string& access_code)); | 51 const std::string& access_code)); |
51 MOCK_METHOD0(OnUserCancelledDialog, void()); | 52 MOCK_METHOD0(OnUserCancelledDialog, void()); |
52 MOCK_CONST_METHOD0(GetAuthenticatedUsername, base::string16()); | 53 MOCK_CONST_METHOD0(GetAuthenticatedUsername, base::string16()); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 const syncer::SyncProtocolError&)); | 94 const syncer::SyncProtocolError&)); |
94 MOCK_METHOD1(SetSetupInProgress, void(bool)); | 95 MOCK_METHOD1(SetSetupInProgress, void(bool)); |
95 MOCK_CONST_METHOD0(IsSessionsDataTypeControllerRunning, bool()); | 96 MOCK_CONST_METHOD0(IsSessionsDataTypeControllerRunning, bool()); |
96 | 97 |
97 MOCK_CONST_METHOD0(GetAllSignedInDevicesMock, | 98 MOCK_CONST_METHOD0(GetAllSignedInDevicesMock, |
98 std::vector<browser_sync::DeviceInfo*>* ()); | 99 std::vector<browser_sync::DeviceInfo*>* ()); |
99 // This is to get around the fact that GMOCK does not handle Scoped*. | 100 // This is to get around the fact that GMOCK does not handle Scoped*. |
100 virtual ScopedVector<browser_sync::DeviceInfo> | 101 virtual ScopedVector<browser_sync::DeviceInfo> |
101 GetAllSignedInDevices() const OVERRIDE; | 102 GetAllSignedInDevices() const OVERRIDE; |
102 | 103 |
103 virtual scoped_ptr<browser_sync::DeviceInfo> GetLocalDeviceInfo() | |
104 const OVERRIDE; | |
105 MOCK_CONST_METHOD0(GetLocalDeviceInfoMock, | |
106 browser_sync::DeviceInfo*()); | |
107 MOCK_CONST_METHOD0(GetLocalSyncCacheGUID, std::string()); | |
108 | |
109 // DataTypeManagerObserver mocks. | 104 // DataTypeManagerObserver mocks. |
110 MOCK_METHOD0(OnConfigureBlocked, void()); | 105 MOCK_METHOD0(OnConfigureBlocked, void()); |
111 MOCK_METHOD1(OnConfigureDone, | 106 MOCK_METHOD1(OnConfigureDone, |
112 void(const browser_sync::DataTypeManager::ConfigureResult&)); | 107 void(const browser_sync::DataTypeManager::ConfigureResult&)); |
113 MOCK_METHOD0(OnConfigureRetry, void()); | 108 MOCK_METHOD0(OnConfigureRetry, void()); |
114 MOCK_METHOD0(OnConfigureStart, void()); | 109 MOCK_METHOD0(OnConfigureStart, void()); |
115 | 110 |
116 MOCK_METHOD0(IsSyncEnabledAndLoggedIn, bool()); | 111 MOCK_METHOD0(IsSyncEnabledAndLoggedIn, bool()); |
117 MOCK_CONST_METHOD0(IsManaged, bool()); | 112 MOCK_CONST_METHOD0(IsManaged, bool()); |
118 MOCK_METHOD0(IsOAuthRefreshTokenAvailable, bool()); | 113 MOCK_METHOD0(IsOAuthRefreshTokenAvailable, bool()); |
119 | 114 |
120 MOCK_CONST_METHOD0(IsPassphraseRequired, bool()); | 115 MOCK_CONST_METHOD0(IsPassphraseRequired, bool()); |
121 MOCK_CONST_METHOD0(IsPassphraseRequiredForDecryption, bool()); | 116 MOCK_CONST_METHOD0(IsPassphraseRequiredForDecryption, bool()); |
122 MOCK_CONST_METHOD0(IsUsingSecondaryPassphrase, bool()); | 117 MOCK_CONST_METHOD0(IsUsingSecondaryPassphrase, bool()); |
123 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); | 118 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); |
124 MOCK_CONST_METHOD0(GetPassphraseTime, base::Time()); | 119 MOCK_CONST_METHOD0(GetPassphraseTime, base::Time()); |
125 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); | 120 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); |
126 | 121 |
127 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); | 122 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); |
128 MOCK_METHOD2(SetEncryptionPassphrase, void(const std::string& passphrase, | 123 MOCK_METHOD2(SetEncryptionPassphrase, void(const std::string& passphrase, |
129 PassphraseType type)); | 124 PassphraseType type)); |
130 | 125 |
131 MOCK_METHOD1(StartUpSlowBackendComponents, void(BackendMode)); | 126 MOCK_METHOD1(StartUpSlowBackendComponents, void(BackendMode)); |
132 }; | 127 }; |
133 | 128 |
134 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 129 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
OLD | NEW |