OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_PROFILE_SYNC_FACTORY_MOCK_H__ | |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_FACTORY_MOCK_H__ | |
7 #pragma once | |
8 | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/sync/profile_sync_service.h" | |
11 #include "chrome/browser/sync/profile_sync_factory.h" | |
12 #include "testing/gmock/include/gmock/gmock.h" | |
13 | |
14 namespace browser_sync { | |
15 class AssociatorInterface; | |
16 class ChangeProcessor; | |
17 } | |
18 | |
19 class ProfileSyncFactoryMock : public ProfileSyncFactory { | |
20 public: | |
21 ProfileSyncFactoryMock(); | |
22 ProfileSyncFactoryMock( | |
23 browser_sync::AssociatorInterface* model_associator, | |
24 browser_sync::ChangeProcessor* change_processor); | |
25 virtual ~ProfileSyncFactoryMock(); | |
26 | |
27 MOCK_METHOD1(CreateProfileSyncService, | |
28 ProfileSyncService*(const std::string&)); | |
29 MOCK_METHOD1(RegisterDataTypes, void(ProfileSyncService*)); | |
30 MOCK_METHOD2(CreateDataTypeManager, | |
31 browser_sync::DataTypeManager*( | |
32 browser_sync::SyncBackendHost*, | |
33 const browser_sync::DataTypeController::TypeMap*)); | |
34 MOCK_METHOD3(CreateGenericChangeProcessor, | |
35 browser_sync::GenericChangeProcessor*( | |
36 ProfileSyncService* profile_sync_service, | |
37 browser_sync::UnrecoverableErrorHandler* error_handler, | |
38 const base::WeakPtr<SyncableService>& local_service)); | |
39 MOCK_METHOD0(CreateSharedChangeProcessor, | |
40 browser_sync::SharedChangeProcessor*()); | |
41 MOCK_METHOD2(CreateAppSyncComponents, | |
42 SyncComponents(ProfileSyncService* profile_sync_service, | |
43 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
44 MOCK_CONST_METHOD1(GetAutofillProfileSyncableService, | |
45 base::WeakPtr<SyncableService>( | |
46 WebDataService* web_data_service)); | |
47 MOCK_CONST_METHOD1(GetAutocompleteSyncableService, | |
48 base::WeakPtr<SyncableService>( | |
49 WebDataService* web_data_service)); | |
50 MOCK_METHOD2(CreateBookmarkSyncComponents, | |
51 SyncComponents(ProfileSyncService* profile_sync_service, | |
52 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
53 MOCK_METHOD2(CreateExtensionSyncComponents, | |
54 SyncComponents(ProfileSyncService* profile_sync_service, | |
55 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
56 MOCK_METHOD4(CreateExtensionOrAppSettingSyncComponents, | |
57 SyncComponents(syncable::ModelType model_type, | |
58 SyncableService* settings_service, | |
59 ProfileSyncService* profile_sync_service, | |
60 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
61 MOCK_METHOD3(CreatePasswordSyncComponents, | |
62 SyncComponents( | |
63 ProfileSyncService* profile_sync_service, | |
64 PasswordStore* password_store, | |
65 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
66 MOCK_METHOD2(CreatePreferenceSyncComponents, | |
67 SyncComponents(ProfileSyncService* profile_sync_service, | |
68 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
69 MOCK_METHOD2(CreateSessionSyncComponents, | |
70 SyncComponents(ProfileSyncService* profile_sync_service, | |
71 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
72 MOCK_METHOD2(CreateThemeSyncComponents, | |
73 SyncComponents(ProfileSyncService* profile_sync_service, | |
74 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
75 MOCK_METHOD3(CreateTypedUrlSyncComponents, | |
76 SyncComponents( | |
77 ProfileSyncService* profile_sync_service, | |
78 history::HistoryBackend* history_backend, | |
79 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
80 MOCK_METHOD2(CreateSearchEngineSyncComponents, | |
81 SyncComponents( | |
82 ProfileSyncService* profile_sync_service, | |
83 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
84 MOCK_METHOD2(CreateAppNotificationSyncComponents, | |
85 SyncComponents( | |
86 ProfileSyncService* profile_sync_service, | |
87 browser_sync::UnrecoverableErrorHandler* error_handler)); | |
88 | |
89 private: | |
90 SyncComponents MakeSyncComponents(); | |
91 | |
92 scoped_ptr<browser_sync::AssociatorInterface> model_associator_; | |
93 scoped_ptr<browser_sync::ChangeProcessor> change_processor_; | |
94 }; | |
95 | |
96 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_FACTORY_MOCK_H__ | |
OLD | NEW |