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 SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "sync/internal_api/public/sync_manager.h" | 12 #include "sync/internal_api/public/sync_manager.h" |
13 #include "sync/notifier/sync_notifier_registrar.h" | 13 #include "sync/notifier/invalidator_registrar.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
17 } | 17 } |
18 | 18 |
19 namespace syncer { | 19 namespace syncer { |
20 | 20 |
21 class FakeSyncEncryptionHandler; | 21 class FakeSyncEncryptionHandler; |
22 | 22 |
23 class FakeSyncManager : public SyncManager { | 23 class FakeSyncManager : public SyncManager { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const WeakHandle<JsEventHandler>& event_handler, | 74 const WeakHandle<JsEventHandler>& event_handler, |
75 const std::string& sync_server_and_path, | 75 const std::string& sync_server_and_path, |
76 int sync_server_port, | 76 int sync_server_port, |
77 bool use_ssl, | 77 bool use_ssl, |
78 const scoped_refptr<base::TaskRunner>& blocking_task_runner, | 78 const scoped_refptr<base::TaskRunner>& blocking_task_runner, |
79 scoped_ptr<HttpPostProviderFactory> post_factory, | 79 scoped_ptr<HttpPostProviderFactory> post_factory, |
80 const std::vector<ModelSafeWorker*>& workers, | 80 const std::vector<ModelSafeWorker*>& workers, |
81 ExtensionsActivityMonitor* extensions_activity_monitor, | 81 ExtensionsActivityMonitor* extensions_activity_monitor, |
82 ChangeDelegate* change_delegate, | 82 ChangeDelegate* change_delegate, |
83 const SyncCredentials& credentials, | 83 const SyncCredentials& credentials, |
84 scoped_ptr<SyncNotifier> sync_notifier, | 84 scoped_ptr<Invalidator> invalidator, |
85 const std::string& restored_key_for_bootstrapping, | 85 const std::string& restored_key_for_bootstrapping, |
86 const std::string& restored_keystore_key_for_bootstrapping, | 86 const std::string& restored_keystore_key_for_bootstrapping, |
87 scoped_ptr<InternalComponentsFactory> internal_components_factory, | 87 scoped_ptr<InternalComponentsFactory> internal_components_factory, |
88 Encryptor* encryptor, | 88 Encryptor* encryptor, |
89 UnrecoverableErrorHandler* unrecoverable_error_handler, | 89 UnrecoverableErrorHandler* unrecoverable_error_handler, |
90 ReportUnrecoverableErrorFunction | 90 ReportUnrecoverableErrorFunction |
91 report_unrecoverable_error_function) OVERRIDE; | 91 report_unrecoverable_error_function) OVERRIDE; |
92 virtual void ThrowUnrecoverableError() OVERRIDE; | 92 virtual void ThrowUnrecoverableError() OVERRIDE; |
93 virtual ModelTypeSet InitialSyncEndedTypes() OVERRIDE; | 93 virtual ModelTypeSet InitialSyncEndedTypes() OVERRIDE; |
94 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( | 94 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( |
95 ModelTypeSet types) OVERRIDE; | 95 ModelTypeSet types) OVERRIDE; |
96 virtual bool PurgePartiallySyncedTypes() OVERRIDE; | 96 virtual bool PurgePartiallySyncedTypes() OVERRIDE; |
97 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; | 97 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; |
98 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE; | 98 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE; |
99 virtual void RegisterInvalidationHandler( | 99 virtual void RegisterInvalidationHandler( |
100 SyncNotifierObserver* handler) OVERRIDE; | 100 InvalidationHandler* handler) OVERRIDE; |
101 virtual void UpdateRegisteredInvalidationIds( | 101 virtual void UpdateRegisteredInvalidationIds( |
102 SyncNotifierObserver* handler, | 102 InvalidationHandler* handler, |
103 const ObjectIdSet& ids) OVERRIDE; | 103 const ObjectIdSet& ids) OVERRIDE; |
104 virtual void UnregisterInvalidationHandler( | 104 virtual void UnregisterInvalidationHandler( |
105 SyncNotifierObserver* handler) OVERRIDE; | 105 InvalidationHandler* handler) OVERRIDE; |
106 virtual void StartSyncingNormally( | 106 virtual void StartSyncingNormally( |
107 const ModelSafeRoutingInfo& routing_info) OVERRIDE; | 107 const ModelSafeRoutingInfo& routing_info) OVERRIDE; |
108 virtual void ConfigureSyncer( | 108 virtual void ConfigureSyncer( |
109 ConfigureReason reason, | 109 ConfigureReason reason, |
110 const ModelTypeSet& types_to_config, | 110 const ModelTypeSet& types_to_config, |
111 const ModelSafeRoutingInfo& new_routing_info, | 111 const ModelSafeRoutingInfo& new_routing_info, |
112 const base::Closure& ready_task, | 112 const base::Closure& ready_task, |
113 const base::Closure& retry_task) OVERRIDE; | 113 const base::Closure& retry_task) OVERRIDE; |
114 virtual void AddObserver(Observer* observer) OVERRIDE; | 114 virtual void AddObserver(Observer* observer) OVERRIDE; |
115 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 115 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... |
142 // The types that should fail configuration attempts. These types will not | 142 // The types that should fail configuration attempts. These types will not |
143 // have their progress markers or initial_sync_ended bits set. | 143 // have their progress markers or initial_sync_ended bits set. |
144 ModelTypeSet configure_fail_types_; | 144 ModelTypeSet configure_fail_types_; |
145 // The set of types that have been cleaned up. | 145 // The set of types that have been cleaned up. |
146 ModelTypeSet cleaned_types_; | 146 ModelTypeSet cleaned_types_; |
147 // The set of types that have been downloaded. | 147 // The set of types that have been downloaded. |
148 ModelTypeSet downloaded_types_; | 148 ModelTypeSet downloaded_types_; |
149 // The set of types that have been enabled. | 149 // The set of types that have been enabled. |
150 ModelTypeSet enabled_types_; | 150 ModelTypeSet enabled_types_; |
151 | 151 |
152 // Faked notifier state. | 152 // Faked invalidator state. |
153 SyncNotifierRegistrar registrar_; | 153 InvalidatorRegistrar registrar_; |
154 | 154 |
155 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; | 155 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; |
156 | 156 |
157 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); | 157 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); |
158 }; | 158 }; |
159 | 159 |
160 } // namespace syncer | 160 } // namespace syncer |
161 | 161 |
162 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 162 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
OLD | NEW |