| 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 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "components/browser_sync/profile_sync_service.h" | 13 #include "components/browser_sync/profile_sync_service.h" |
| 14 #include "components/sync/base/model_type.h" | 14 #include "components/sync/base/model_type.h" |
| 15 #include "components/sync/device_info/device_info.h" | 15 #include "components/sync/device_info/device_info.h" |
| 16 #include "components/sync/driver/change_processor.h" | 16 #include "components/sync/driver/change_processor.h" |
| 17 #include "components/sync/driver/data_type_controller.h" | 17 #include "components/sync/driver/data_type_controller.h" |
| 18 #include "components/sync/protocol/sync_protocol_error.h" | 18 #include "components/sync/protocol/sync_protocol_error.h" |
| 19 #include "google_apis/gaia/google_service_auth_error.h" | 19 #include "google_apis/gaia/google_service_auth_error.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 | 21 |
| 22 namespace browser_sync { |
| 23 |
| 22 class ProfileSyncServiceMock : public ProfileSyncService { | 24 class ProfileSyncServiceMock : public ProfileSyncService { |
| 23 public: | 25 public: |
| 24 explicit ProfileSyncServiceMock(InitParams init_params); | 26 explicit ProfileSyncServiceMock(InitParams init_params); |
| 25 // 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 |
| 26 // create a StrictMock or NiceMock of ProfileSyncServiceMock, because those | 28 // create a StrictMock or NiceMock of ProfileSyncServiceMock, because those |
| 27 // template classes cannot handle the input class having constructors with | 29 // template classes cannot handle the input class having constructors with |
| 28 // arguments passed by value. Otherwise use the constructor above for cleaner | 30 // arguments passed by value. Otherwise use the constructor above for cleaner |
| 29 // code. | 31 // code. |
| 30 explicit ProfileSyncServiceMock(InitParams* init_params); | 32 explicit ProfileSyncServiceMock(InitParams* init_params); |
| 31 | 33 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 57 MOCK_CONST_METHOD0(IsEncryptEverythingEnabled, bool()); | 59 MOCK_CONST_METHOD0(IsEncryptEverythingEnabled, bool()); |
| 58 MOCK_METHOD0(EnableEncryptEverything, void()); | 60 MOCK_METHOD0(EnableEncryptEverything, void()); |
| 59 | 61 |
| 60 MOCK_METHOD1(ChangePreferredDataTypes, | 62 MOCK_METHOD1(ChangePreferredDataTypes, |
| 61 void(syncer::ModelTypeSet preferred_types)); | 63 void(syncer::ModelTypeSet preferred_types)); |
| 62 MOCK_CONST_METHOD0(GetActiveDataTypes, syncer::ModelTypeSet()); | 64 MOCK_CONST_METHOD0(GetActiveDataTypes, syncer::ModelTypeSet()); |
| 63 MOCK_CONST_METHOD0(GetPreferredDataTypes, syncer::ModelTypeSet()); | 65 MOCK_CONST_METHOD0(GetPreferredDataTypes, syncer::ModelTypeSet()); |
| 64 MOCK_CONST_METHOD0(GetRegisteredDataTypes, syncer::ModelTypeSet()); | 66 MOCK_CONST_METHOD0(GetRegisteredDataTypes, syncer::ModelTypeSet()); |
| 65 MOCK_CONST_METHOD0(GetLastCycleSnapshot, syncer::SyncCycleSnapshot()); | 67 MOCK_CONST_METHOD0(GetLastCycleSnapshot, syncer::SyncCycleSnapshot()); |
| 66 | 68 |
| 67 MOCK_METHOD1(QueryDetailedSyncStatus, | 69 MOCK_METHOD1(QueryDetailedSyncStatus, bool(SyncBackendHost::Status* result)); |
| 68 bool(browser_sync::SyncBackendHost::Status* result)); | |
| 69 MOCK_CONST_METHOD0(GetAuthError, const GoogleServiceAuthError&()); | 70 MOCK_CONST_METHOD0(GetAuthError, const GoogleServiceAuthError&()); |
| 70 MOCK_CONST_METHOD0(IsFirstSetupInProgress, bool()); | 71 MOCK_CONST_METHOD0(IsFirstSetupInProgress, bool()); |
| 71 MOCK_CONST_METHOD0(GetLastSyncedTimeString, base::string16()); | 72 MOCK_CONST_METHOD0(GetLastSyncedTimeString, base::string16()); |
| 72 MOCK_CONST_METHOD0(HasUnrecoverableError, bool()); | 73 MOCK_CONST_METHOD0(HasUnrecoverableError, bool()); |
| 73 MOCK_CONST_METHOD0(IsSyncActive, bool()); | 74 MOCK_CONST_METHOD0(IsSyncActive, bool()); |
| 74 MOCK_CONST_METHOD0(IsBackendInitialized, bool()); | 75 MOCK_CONST_METHOD0(IsBackendInitialized, bool()); |
| 75 MOCK_CONST_METHOD0(IsSyncRequested, bool()); | 76 MOCK_CONST_METHOD0(IsSyncRequested, bool()); |
| 76 MOCK_CONST_METHOD0(waiting_for_auth, bool()); | 77 MOCK_CONST_METHOD0(waiting_for_auth, bool()); |
| 77 MOCK_METHOD1(OnActionableError, void(const syncer::SyncProtocolError&)); | 78 MOCK_METHOD1(OnActionableError, void(const syncer::SyncProtocolError&)); |
| 78 MOCK_CONST_METHOD1(IsDataTypeControllerRunning, bool(syncer::ModelType)); | 79 MOCK_CONST_METHOD1(IsDataTypeControllerRunning, bool(syncer::ModelType)); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 91 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); | 92 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); |
| 92 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); | 93 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); |
| 93 | 94 |
| 94 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); | 95 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); |
| 95 MOCK_METHOD2(SetEncryptionPassphrase, | 96 MOCK_METHOD2(SetEncryptionPassphrase, |
| 96 void(const std::string& passphrase, PassphraseType type)); | 97 void(const std::string& passphrase, PassphraseType type)); |
| 97 | 98 |
| 98 MOCK_METHOD0(OnSetupInProgressHandleDestroyed, void()); | 99 MOCK_METHOD0(OnSetupInProgressHandleDestroyed, void()); |
| 99 }; | 100 }; |
| 100 | 101 |
| 102 } // namespace browser_sync |
| 103 |
| 101 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 104 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
| OLD | NEW |