| 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_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 5 #ifndef COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
| 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // The second constructor defers to the first one. Use it when you need to | 27 // The second constructor defers to the first one. Use it when you need to |
| 28 // create a StrictMock or NiceMock of ProfileSyncServiceMock, because those | 28 // create a StrictMock or NiceMock of ProfileSyncServiceMock, because those |
| 29 // template classes cannot handle the input class having constructors with | 29 // template classes cannot handle the input class having constructors with |
| 30 // arguments passed by value. Otherwise use the constructor above for cleaner | 30 // arguments passed by value. Otherwise use the constructor above for cleaner |
| 31 // code. | 31 // code. |
| 32 explicit ProfileSyncServiceMock(InitParams* init_params); | 32 explicit ProfileSyncServiceMock(InitParams* init_params); |
| 33 | 33 |
| 34 virtual ~ProfileSyncServiceMock(); | 34 virtual ~ProfileSyncServiceMock(); |
| 35 | 35 |
| 36 MOCK_METHOD4( | 36 MOCK_METHOD4( |
| 37 OnBackendInitialized, | 37 OnEngineInitialized, |
| 38 void(const syncer::WeakHandle<syncer::JsBackend>&, | 38 void(const syncer::WeakHandle<syncer::JsBackend>&, |
| 39 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, | 39 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, |
| 40 const std::string&, | 40 const std::string&, |
| 41 bool)); | 41 bool)); |
| 42 MOCK_METHOD0(OnSyncCycleCompleted, void()); | 42 MOCK_METHOD0(OnSyncCycleCompleted, void()); |
| 43 MOCK_METHOD2(OnUserChoseDatatypes, | 43 MOCK_METHOD2(OnUserChoseDatatypes, |
| 44 void(bool sync_everything, syncer::ModelTypeSet chosen_types)); | 44 void(bool sync_everything, syncer::ModelTypeSet chosen_types)); |
| 45 | 45 |
| 46 MOCK_METHOD2(OnUnrecoverableError, | 46 MOCK_METHOD2(OnUnrecoverableError, |
| 47 void(const tracked_objects::Location& location, | 47 void(const tracked_objects::Location& location, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 66 MOCK_CONST_METHOD0(GetRegisteredDataTypes, syncer::ModelTypeSet()); | 66 MOCK_CONST_METHOD0(GetRegisteredDataTypes, syncer::ModelTypeSet()); |
| 67 MOCK_CONST_METHOD0(GetLastCycleSnapshot, syncer::SyncCycleSnapshot()); | 67 MOCK_CONST_METHOD0(GetLastCycleSnapshot, syncer::SyncCycleSnapshot()); |
| 68 | 68 |
| 69 MOCK_METHOD1(QueryDetailedSyncStatus, | 69 MOCK_METHOD1(QueryDetailedSyncStatus, |
| 70 bool(syncer::SyncEngine::Status* result)); | 70 bool(syncer::SyncEngine::Status* result)); |
| 71 MOCK_CONST_METHOD0(GetAuthError, const GoogleServiceAuthError&()); | 71 MOCK_CONST_METHOD0(GetAuthError, const GoogleServiceAuthError&()); |
| 72 MOCK_CONST_METHOD0(IsFirstSetupInProgress, bool()); | 72 MOCK_CONST_METHOD0(IsFirstSetupInProgress, bool()); |
| 73 MOCK_CONST_METHOD0(GetLastSyncedTimeString, base::string16()); | 73 MOCK_CONST_METHOD0(GetLastSyncedTimeString, base::string16()); |
| 74 MOCK_CONST_METHOD0(HasUnrecoverableError, bool()); | 74 MOCK_CONST_METHOD0(HasUnrecoverableError, bool()); |
| 75 MOCK_CONST_METHOD0(IsSyncActive, bool()); | 75 MOCK_CONST_METHOD0(IsSyncActive, bool()); |
| 76 MOCK_CONST_METHOD0(IsBackendInitialized, bool()); | 76 MOCK_CONST_METHOD0(IsEngineInitialized, bool()); |
| 77 MOCK_CONST_METHOD0(IsSyncRequested, bool()); | 77 MOCK_CONST_METHOD0(IsSyncRequested, bool()); |
| 78 MOCK_CONST_METHOD0(waiting_for_auth, bool()); | 78 MOCK_CONST_METHOD0(waiting_for_auth, bool()); |
| 79 MOCK_METHOD1(OnActionableError, void(const syncer::SyncProtocolError&)); | 79 MOCK_METHOD1(OnActionableError, void(const syncer::SyncProtocolError&)); |
| 80 MOCK_CONST_METHOD1(IsDataTypeControllerRunning, bool(syncer::ModelType)); | 80 MOCK_CONST_METHOD1(IsDataTypeControllerRunning, bool(syncer::ModelType)); |
| 81 | 81 |
| 82 // DataTypeManagerObserver mocks. | 82 // DataTypeManagerObserver mocks. |
| 83 MOCK_METHOD1(OnConfigureDone, | 83 MOCK_METHOD1(OnConfigureDone, |
| 84 void(const syncer::DataTypeManager::ConfigureResult&)); | 84 void(const syncer::DataTypeManager::ConfigureResult&)); |
| 85 MOCK_METHOD0(OnConfigureStart, void()); | 85 MOCK_METHOD0(OnConfigureStart, void()); |
| 86 | 86 |
| 87 MOCK_CONST_METHOD0(CanSyncStart, bool()); | 87 MOCK_CONST_METHOD0(CanSyncStart, bool()); |
| 88 MOCK_CONST_METHOD0(IsManaged, bool()); | 88 MOCK_CONST_METHOD0(IsManaged, bool()); |
| 89 | 89 |
| 90 MOCK_CONST_METHOD0(IsPassphraseRequired, bool()); | 90 MOCK_CONST_METHOD0(IsPassphraseRequired, bool()); |
| 91 MOCK_CONST_METHOD0(IsPassphraseRequiredForDecryption, bool()); | 91 MOCK_CONST_METHOD0(IsPassphraseRequiredForDecryption, bool()); |
| 92 MOCK_CONST_METHOD0(IsUsingSecondaryPassphrase, bool()); | 92 MOCK_CONST_METHOD0(IsUsingSecondaryPassphrase, bool()); |
| 93 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); | 93 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); |
| 94 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); | 94 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); |
| 95 | 95 |
| 96 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); | 96 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); |
| 97 MOCK_METHOD2(SetEncryptionPassphrase, | 97 MOCK_METHOD2(SetEncryptionPassphrase, |
| 98 void(const std::string& passphrase, PassphraseType type)); | 98 void(const std::string& passphrase, PassphraseType type)); |
| 99 | 99 |
| 100 MOCK_METHOD0(OnSetupInProgressHandleDestroyed, void()); | 100 MOCK_METHOD0(OnSetupInProgressHandleDestroyed, void()); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace browser_sync | 103 } // namespace browser_sync |
| 104 | 104 |
| 105 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 105 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
| OLD | NEW |