OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 SYNC_API_FAKE_MODEL_TYPE_CHANGE_PROCESSOR_H_ | |
6 #define SYNC_API_FAKE_MODEL_TYPE_CHANGE_PROCESSOR_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "sync/api/metadata_change_list.h" | |
11 #include "sync/api/model_type_change_processor.h" | |
12 #include "sync/internal_api/public/base/model_type.h" | |
13 | |
14 namespace syncer_v2 { | |
15 | |
16 class ModelTypeService; | |
17 | |
18 // A ModelTypeChangeProcessor implementation for tests. | |
19 class FakeModelTypeChangeProcessor : public ModelTypeChangeProcessor { | |
20 public: | |
21 static std::unique_ptr<ModelTypeChangeProcessor> Create( | |
22 syncer::ModelType type, | |
23 ModelTypeService* service); | |
24 | |
25 FakeModelTypeChangeProcessor(); | |
26 ~FakeModelTypeChangeProcessor() override; | |
27 | |
28 // ModelTypeChangeProcessor overrides | |
29 void Put(const std::string& client_tag, | |
30 std::unique_ptr<EntityData> entity_data, | |
31 MetadataChangeList* metadata_change_list) override; | |
32 void Delete(const std::string& client_tag, | |
33 MetadataChangeList* metadata_change_list) override; | |
34 void OnMetadataLoaded(syncer::SyncError error, | |
35 std::unique_ptr<MetadataBatch> batch) override; | |
36 void OnSyncStarting(syncer::DataTypeErrorHandler* error_handler, | |
37 const StartCallback& callback) override; | |
38 void DisableSync() override; | |
39 syncer::SyncError CreateAndUploadError( | |
40 const tracked_objects::Location& location, | |
41 const std::string& message) override; | |
42 }; | |
43 | |
44 } // namespace syncer_v2 | |
45 | |
46 #endif // SYNC_API_FAKE_MODEL_TYPE_CHANGE_PROCESSOR_H_ | |
OLD | NEW |