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

Unified Diff: components/sync/test/fake_server/fake_server_entity.cc

Issue 2328393002: [Sync] Add a sanity integration test for USS. (Closed)
Patch Set: Rebase. 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/test/fake_server/fake_server_entity.cc
diff --git a/components/sync/test/fake_server/fake_server_entity.cc b/components/sync/test/fake_server/fake_server_entity.cc
index 3bb5301eaa24f60815c61271fea48fa645567c5c..3f58ca533148bc93d8e5d1b1e573c77456697b39 100644
--- a/components/sync/test/fake_server/fake_server_entity.cc
+++ b/components/sync/test/fake_server/fake_server_entity.cc
@@ -39,14 +39,6 @@ namespace fake_server {
FakeServerEntity::~FakeServerEntity() {}
-const std::string& FakeServerEntity::GetId() const {
- return id_;
-}
-
-ModelType FakeServerEntity::GetModelType() const {
- return model_type_;
-}
-
int64_t FakeServerEntity::GetVersion() const {
return version_;
}
@@ -108,10 +100,18 @@ ModelType FakeServerEntity::GetModelTypeFromId(const string& id) {
}
FakeServerEntity::FakeServerEntity(const string& id,
+ const string& client_defined_unique_tag,
const ModelType& model_type,
int64_t version,
const string& name)
- : id_(id), model_type_(model_type), version_(version), name_(name) {}
+ : id_(id),
+ client_defined_unique_tag_(client_defined_unique_tag),
+ model_type_(model_type),
+ version_(version),
+ name_(name) {
+ // There shouldn't be a unique_tag if the type is bookmarks.
+ DCHECK(model_type != syncer::BOOKMARKS || client_defined_unique_tag.empty());
+}
void FakeServerEntity::SerializeBaseProtoFields(
sync_pb::SyncEntity* sync_entity) const {
@@ -120,6 +120,8 @@ void FakeServerEntity::SerializeBaseProtoFields(
// FakeServerEntity fields
sync_entity->set_id_string(id_);
+ if (!client_defined_unique_tag_.empty())
+ sync_entity->set_client_defined_unique_tag(client_defined_unique_tag_);
sync_entity->set_version(version_);
sync_entity->set_name(name_);
« no previous file with comments | « components/sync/test/fake_server/fake_server_entity.h ('k') | components/sync/test/fake_server/permanent_entity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698