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.
5 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
7 #include "components/sync_driver/change_processor.h"
8 #include "components/sync_driver/local_device_info_provider_mock.h"
9 #include "components/sync_driver/model_associator.h"
10 #include "content/public/browser/browser_thread.h"
11 #include "sync/api/attachments/attachment_store.h"
12 #include "sync/internal_api/public/attachments/attachment_service_impl.h"
14 using sync_driver::AssociatorInterface
;
15 using sync_driver::ChangeProcessor
;
17 using testing::InvokeWithoutArgs
;
18 using testing::Return
;
20 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock()
21 : local_device_(new sync_driver::LocalDeviceInfoProviderMock()) {
24 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock(
25 AssociatorInterface
* model_associator
, ChangeProcessor
* change_processor
)
26 : model_associator_(model_associator
),
27 change_processor_(change_processor
),
28 local_device_(new sync_driver::LocalDeviceInfoProviderMock()) {
29 ON_CALL(*this, CreateBookmarkSyncComponents(_
, _
)).
33 &ProfileSyncComponentsFactoryMock::MakeSyncComponents
));
36 ProfileSyncComponentsFactoryMock::~ProfileSyncComponentsFactoryMock() {}
38 scoped_ptr
<syncer::AttachmentService
>
39 ProfileSyncComponentsFactoryMock::CreateAttachmentService(
40 scoped_ptr
<syncer::AttachmentStoreForSync
> attachment_store
,
41 const syncer::UserShare
& user_share
,
42 const std::string
& store_birthday
,
43 syncer::ModelType model_type
,
44 syncer::AttachmentService::Delegate
* delegate
) {
45 return syncer::AttachmentServiceImpl::CreateForTest();
48 ProfileSyncComponentsFactory::SyncComponents
49 ProfileSyncComponentsFactoryMock::MakeSyncComponents() {
50 return SyncComponents(model_associator_
.release(),
51 change_processor_
.release());
54 scoped_ptr
<sync_driver::LocalDeviceInfoProvider
>
55 ProfileSyncComponentsFactoryMock::CreateLocalDeviceInfoProvider() {
56 return local_device_
.Pass();
59 void ProfileSyncComponentsFactoryMock::SetLocalDeviceInfoProvider(
60 scoped_ptr
<sync_driver::LocalDeviceInfoProvider
> local_device
) {
61 local_device_
= local_device
.Pass();