Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Unified Diff: components/sync/api/fake_model_type_service.h

Issue 2369103002: [Sync] Move conflict resolution test code to FakeModelTypeService. (Closed)
Patch Set: Address comment. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/api/fake_model_type_service.h
diff --git a/components/sync/api/fake_model_type_service.h b/components/sync/api/fake_model_type_service.h
index 8924601e3331737843c78d6e51721b2a5614841b..9153d3418e50e95dfc6014245cf62a4a0a75913d 100644
--- a/components/sync/api/fake_model_type_service.h
+++ b/components/sync/api/fake_model_type_service.h
@@ -112,6 +112,13 @@ class FakeModelTypeService : public ModelTypeService {
std::string GetClientTag(const EntityData& entity_data) override;
std::string GetStorageKey(const EntityData& entity_data) override;
void OnChangeProcessorSet() override;
+ ConflictResolution ResolveConflict(
+ const EntityData& local_data,
+ const EntityData& remote_data) const override;
+
+ // Store a resolution for the next call to ResolveConflict. Note that if this
+ // is a USE_NEW resolution, the data will only exist for one resolve call.
+ void SetConflictResolution(ConflictResolution resolution);
// Sets the error that the next fallible call to the service will generate.
void SetServiceError(syncer::SyncError::ErrorType error_type);
@@ -129,6 +136,9 @@ class FakeModelTypeService : public ModelTypeService {
// Applies |change_list| to the metadata store.
void ApplyMetadataChangeList(std::unique_ptr<MetadataChangeList> change_list);
+ // The conflict resolution to use for calls to ResolveConflict.
+ std::unique_ptr<ConflictResolution> conflict_resolution_;
+
// The error to produce on the next service call.
syncer::SyncError service_error_;
};
« no previous file with comments | « chrome/browser/sync/test/integration/two_client_uss_sync_test.cc ('k') | components/sync/api/fake_model_type_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698