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

Unified Diff: components/sync/model/fake_model_type_sync_bridge.cc

Issue 2864713002: [USS] Add function for update storage key for processor (Closed)
Patch Set: nit Created 3 years, 7 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/model/fake_model_type_sync_bridge.cc
diff --git a/components/sync/model/fake_model_type_sync_bridge.cc b/components/sync/model/fake_model_type_sync_bridge.cc
index 0aea9329b63b4918d180d2d5d58287f589eb6e50..4fbdbd28430b616794ebcccffbd6991cd3aa78ce 100644
--- a/components/sync/model/fake_model_type_sync_bridge.cc
+++ b/components/sync/model/fake_model_type_sync_bridge.cc
@@ -21,20 +21,6 @@ namespace syncer {
namespace {
-// It is intentionally very difficult to copy an EntityData, as in normal code
-// we never want to. However, since we store the data as an EntityData for the
-// test code here, this function is needed to manually copy it.
-std::unique_ptr<EntityData> CopyEntityData(const EntityData& old_data) {
- std::unique_ptr<EntityData> new_data(new EntityData());
- new_data->id = old_data.id;
- new_data->client_tag_hash = old_data.client_tag_hash;
- new_data->non_unique_name = old_data.non_unique_name;
- new_data->specifics = old_data.specifics;
- new_data->creation_time = old_data.creation_time;
- new_data->modification_time = old_data.modification_time;
- return new_data;
-}
-
// A simple InMemoryMetadataChangeList that provides accessors for its data.
class TestMetadataChangeList : public InMemoryMetadataChangeList {
public:
@@ -262,7 +248,6 @@ void FakeModelTypeSyncBridge::ApplyMetadataChangeList(
db_->PutMetadata(kv.first, kv.second.metadata);
break;
case TestMetadataChangeList::CLEAR:
- EXPECT_TRUE(db_->HasMetadata(kv.first));
db_->RemoveMetadata(kv.first);
break;
}
@@ -338,4 +323,16 @@ void FakeModelTypeSyncBridge::ErrorOnNextCall() {
error_next_ = true;
}
+std::unique_ptr<EntityData> FakeModelTypeSyncBridge::CopyEntityData(
+ const EntityData& old_data) {
+ std::unique_ptr<EntityData> new_data(new EntityData());
+ new_data->id = old_data.id;
+ new_data->client_tag_hash = old_data.client_tag_hash;
+ new_data->non_unique_name = old_data.non_unique_name;
+ new_data->specifics = old_data.specifics;
+ new_data->creation_time = old_data.creation_time;
+ new_data->modification_time = old_data.modification_time;
+ return new_data;
+}
+
} // namespace syncer
« no previous file with comments | « components/sync/model/fake_model_type_sync_bridge.h ('k') | components/sync/model/model_type_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698