| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_MOCK_H__ | |
| 6 #define COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_MOCK_H__ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "components/sync/base/model_type.h" | |
| 11 #include "components/sync/core/data_type_error_handler.h" | |
| 12 #include "components/sync_driver/data_type_controller.h" | |
| 13 #include "components/sync_driver/sync_api_component_factory.h" | |
| 14 #include "testing/gmock/include/gmock/gmock.h" | |
| 15 | |
| 16 namespace sync_driver { | |
| 17 class AssociatorInterface; | |
| 18 class ChangeProcessor; | |
| 19 class DataTypeEncryptionHandler; | |
| 20 class DataTypeStatusTable; | |
| 21 class SyncClient; | |
| 22 } | |
| 23 | |
| 24 class SyncApiComponentFactoryMock | |
| 25 : public sync_driver::SyncApiComponentFactory { | |
| 26 public: | |
| 27 SyncApiComponentFactoryMock(); | |
| 28 SyncApiComponentFactoryMock( | |
| 29 sync_driver::AssociatorInterface* model_associator, | |
| 30 sync_driver::ChangeProcessor* change_processor); | |
| 31 ~SyncApiComponentFactoryMock() override; | |
| 32 | |
| 33 MOCK_METHOD2(RegisterDataTypes, | |
| 34 void(sync_driver::SyncService* sync_service, | |
| 35 const RegisterDataTypesMethod&)); | |
| 36 MOCK_METHOD5(CreateDataTypeManager, | |
| 37 sync_driver::DataTypeManager*( | |
| 38 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, | |
| 39 const sync_driver::DataTypeController::TypeMap*, | |
| 40 const sync_driver::DataTypeEncryptionHandler*, | |
| 41 browser_sync::SyncBackendHost*, | |
| 42 sync_driver::DataTypeManagerObserver* observer)); | |
| 43 MOCK_METHOD4(CreateSyncBackendHost, | |
| 44 browser_sync::SyncBackendHost*( | |
| 45 const std::string& name, | |
| 46 invalidation::InvalidationService* invalidator, | |
| 47 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, | |
| 48 const base::FilePath& sync_folder)); | |
| 49 | |
| 50 std::unique_ptr<sync_driver::LocalDeviceInfoProvider> | |
| 51 CreateLocalDeviceInfoProvider() override; | |
| 52 void SetLocalDeviceInfoProvider( | |
| 53 std::unique_ptr<sync_driver::LocalDeviceInfoProvider> local_device); | |
| 54 | |
| 55 std::unique_ptr<syncer::AttachmentService> CreateAttachmentService( | |
| 56 std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store, | |
| 57 const syncer::UserShare& user_share, | |
| 58 const std::string& store_birthday, | |
| 59 syncer::ModelType model_type, | |
| 60 syncer::AttachmentService::Delegate* delegate) override; | |
| 61 MOCK_METHOD2(CreateBookmarkSyncComponents, | |
| 62 SyncComponents(sync_driver::SyncService* sync_service, | |
| 63 syncer::DataTypeErrorHandler* error_handler)); | |
| 64 MOCK_METHOD3(CreateTypedUrlSyncComponents, | |
| 65 SyncComponents(sync_driver::SyncService* sync_service, | |
| 66 history::HistoryBackend* history_backend, | |
| 67 syncer::DataTypeErrorHandler* error_handler)); | |
| 68 | |
| 69 private: | |
| 70 sync_driver::SyncApiComponentFactory::SyncComponents MakeSyncComponents(); | |
| 71 | |
| 72 std::unique_ptr<sync_driver::AssociatorInterface> model_associator_; | |
| 73 std::unique_ptr<sync_driver::ChangeProcessor> change_processor_; | |
| 74 // LocalDeviceInfoProvider is initially owned by this class, | |
| 75 // transferred to caller when CreateLocalDeviceInfoProvider is called. | |
| 76 std::unique_ptr<sync_driver::LocalDeviceInfoProvider> local_device_; | |
| 77 }; | |
| 78 | |
| 79 #endif // COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_MOCK_H__ | |
| OLD | NEW |