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

Unified Diff: components/sync/device_info/device_info_sync_bridge_unittest.cc

Issue 2620783002: [sync] Handle local changes in AutocompleteSyncBridge (Closed)
Patch Set: rebase Created 3 years, 11 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
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/model/recording_model_type_change_processor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/device_info/device_info_sync_bridge_unittest.cc
diff --git a/components/sync/device_info/device_info_sync_bridge_unittest.cc b/components/sync/device_info/device_info_sync_bridge_unittest.cc
index 6f996f49f6c43c81acb8647f5d0c8da5aa54202b..bac124139cd114a9d005e69a2ad892549d9237bf 100644
--- a/components/sync/device_info/device_info_sync_bridge_unittest.cc
+++ b/components/sync/device_info/device_info_sync_bridge_unittest.cc
@@ -21,6 +21,7 @@
#include "components/sync/model/fake_model_type_change_processor.h"
#include "components/sync/model/metadata_batch.h"
#include "components/sync/model/model_type_store_test_util.h"
+#include "components/sync/model/recording_model_type_change_processor.h"
#include "components/sync/protocol/model_type_state.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -170,43 +171,6 @@ EntityDataMap InlineEntityDataMap(
return map;
}
-// Instead of actually processing anything, simply accumulates all instructions
-// in members that can then be accessed. TODO(skym): If this ends up being
-// useful for other model type unittests it should be moved out to a shared
-// location.
-class RecordingModelTypeChangeProcessor : public FakeModelTypeChangeProcessor {
- public:
- RecordingModelTypeChangeProcessor() {}
- ~RecordingModelTypeChangeProcessor() override {}
-
- void Put(const std::string& storage_key,
- std::unique_ptr<EntityData> entity_data,
- MetadataChangeList* metadata_changes) override {
- put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data)));
- }
-
- void Delete(const std::string& storage_key,
- MetadataChangeList* metadata_changes) override {
- delete_set_.insert(storage_key);
- }
-
- void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override {
- std::swap(metadata_, batch);
- }
-
- const std::multimap<std::string, std::unique_ptr<EntityData>>& put_multimap()
- const {
- return put_multimap_;
- }
- const std::set<std::string>& delete_set() const { return delete_set_; }
- const MetadataBatch* metadata() const { return metadata_.get(); }
-
- private:
- std::multimap<std::string, std::unique_ptr<EntityData>> put_multimap_;
- std::set<std::string> delete_set_;
- std::unique_ptr<MetadataBatch> metadata_;
-};
-
} // namespace
class DeviceInfoSyncBridgeTest : public testing::Test,
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/model/recording_model_type_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698