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

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

Issue 2948303002: [Sync] Sanity test for UserEvents. (Closed)
Patch Set: Rebase Created 3 years, 6 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 | « chrome/test/BUILD.gn ('k') | components/sync/test/fake_server/unique_client_entity.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/test/fake_server/fake_server.cc
diff --git a/components/sync/test/fake_server/fake_server.cc b/components/sync/test/fake_server/fake_server.cc
index de1cb209907ecd8ea7256b7e968a9d785c977fc4..8eb3dccebe9ab1f72d774e8342d1eedc0a2f2f11 100644
--- a/components/sync/test/fake_server/fake_server.cc
+++ b/components/sync/test/fake_server/fake_server.cc
@@ -370,20 +370,19 @@ string FakeServer::CommitEntity(
}
std::unique_ptr<FakeServerEntity> entity;
+ syncer::ModelType type = GetModelType(client_entity);
if (client_entity.deleted()) {
entity = TombstoneEntity::Create(client_entity.id_string(),
client_entity.client_defined_unique_tag());
DeleteChildren(client_entity.id_string());
- } else if (GetModelType(client_entity) == syncer::NIGORI) {
+ } else if (type == syncer::NIGORI) {
// NIGORI is the only permanent item type that should be updated by the
// client.
EntityMap::const_iterator iter = entities_.find(client_entity.id_string());
CHECK(iter != entities_.end());
entity = PermanentEntity::CreateUpdatedNigoriEntity(client_entity,
*iter->second);
- } else if (client_entity.has_client_defined_unique_tag()) {
- entity = UniqueClientEntity::Create(client_entity);
- } else {
+ } else if (type == syncer::BOOKMARKS) {
// TODO(pvalenzuela): Validate entity's parent ID.
EntityMap::const_iterator iter = entities_.find(client_entity.id_string());
if (iter != entities_.end()) {
@@ -392,12 +391,8 @@ string FakeServer::CommitEntity(
} else {
entity = BookmarkEntity::CreateNew(client_entity, parent_id, client_guid);
}
- }
-
- if (!entity) {
- // TODO(pvalenzuela): Add logging so that it is easier to determine why
- // creation failed.
- return string();
+ } else {
+ entity = UniqueClientEntity::Create(client_entity);
}
const std::string id = entity->id();
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/sync/test/fake_server/unique_client_entity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698