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 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_MOCK_H__
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_MOCK_H__
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/sync/profile_sync_components_factory.h"
10 #include "chrome/browser/sync/profile_sync_service.h"
11 #include "components/sync_driver/data_type_controller.h"
12 #include "components/sync_driver/data_type_error_handler.h"
13 #include "testing/gmock/include/gmock/gmock.h"
15 namespace browser_sync
{
16 class AssociatorInterface
;
17 class ChangeProcessor
;
18 class DataTypeEncryptionHandler
;
19 class FailedDataTypesHandler
;
22 class ProfileSyncComponentsFactoryMock
: public ProfileSyncComponentsFactory
{
24 ProfileSyncComponentsFactoryMock();
25 ProfileSyncComponentsFactoryMock(
26 browser_sync::AssociatorInterface
* model_associator
,
27 browser_sync::ChangeProcessor
* change_processor
);
28 virtual ~ProfileSyncComponentsFactoryMock();
30 MOCK_METHOD1(RegisterDataTypes
, void(ProfileSyncService
*));
31 MOCK_METHOD6(CreateDataTypeManager
,
32 browser_sync::DataTypeManager
*(
33 const syncer::WeakHandle
<syncer::DataTypeDebugInfoListener
>&,
34 const browser_sync::DataTypeController::TypeMap
*,
35 const browser_sync::DataTypeEncryptionHandler
*,
36 browser_sync::SyncBackendHost
*,
37 browser_sync::DataTypeManagerObserver
* observer
,
38 browser_sync::FailedDataTypesHandler
*
39 failed_datatypes_handler
));
40 MOCK_METHOD3(CreateSyncBackendHost
,
41 browser_sync::SyncBackendHost
*(
42 const std::string
& name
,
44 const base::WeakPtr
<sync_driver::SyncPrefs
>& sync_prefs
));
45 MOCK_METHOD1(GetSyncableServiceForType
,
46 base::WeakPtr
<syncer::SyncableService
>(syncer::ModelType
));
47 virtual scoped_ptr
<syncer::AttachmentStore
>
48 CreateCustomAttachmentStoreForType(syncer::ModelType type
) OVERRIDE
;
49 MOCK_METHOD2(CreateBookmarkSyncComponents
,
50 SyncComponents(ProfileSyncService
* profile_sync_service
,
51 browser_sync::DataTypeErrorHandler
* error_handler
));
52 #if defined(ENABLE_THEMES)
53 MOCK_METHOD2(CreateThemeSyncComponents
,
54 SyncComponents(ProfileSyncService
* profile_sync_service
,
55 browser_sync::DataTypeErrorHandler
* error_handler
));
57 MOCK_METHOD3(CreateTypedUrlSyncComponents
,
59 ProfileSyncService
* profile_sync_service
,
60 history::HistoryBackend
* history_backend
,
61 browser_sync::DataTypeErrorHandler
* error_handler
));
64 SyncComponents
MakeSyncComponents();
66 scoped_ptr
<browser_sync::AssociatorInterface
> model_associator_
;
67 scoped_ptr
<browser_sync::ChangeProcessor
> change_processor_
;
70 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_MOCK_H__