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

Unified Diff: sync/test/engine/test_syncable_utils.cc

Issue 11636006: WIP: The Bookmark Position Megapatch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Various updates, including switch suffix to unique_client_tag style Created 8 years 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 | « sync/test/engine/mock_connection_manager.cc ('k') | sync/test/test_directory_backing_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/engine/test_syncable_utils.cc
diff --git a/sync/test/engine/test_syncable_utils.cc b/sync/test/engine/test_syncable_utils.cc
index e5ff28577500100fe5c6ac59dc164027666771bd..c7ba6ede75ba792213c849f115715d1d06388471 100644
--- a/sync/test/engine/test_syncable_utils.cc
+++ b/sync/test/engine/test_syncable_utils.cc
@@ -68,25 +68,30 @@ Id GetOnlyEntryWithName(BaseTransaction* rtrans,
void CreateTypeRoot(WriteTransaction* trans,
syncable::Directory *dir,
ModelType type) {
- std::string tag_name = syncer::ModelTypeToRootTag(type);
+ std::string tag_name = ModelTypeToRootTag(type);
+ syncable::Id node_id = TestIdFactory::MakeServer(tag_name);
+
syncable::MutableEntry node(trans,
- syncable::CREATE,
- TestIdFactory::root(),
- tag_name);
- DCHECK(node.good());
+ syncable::CREATE_NEW_UPDATE_ITEM,
+ node_id);
node.Put(syncable::UNIQUE_SERVER_TAG, tag_name);
node.Put(syncable::IS_DIR, true);
- node.Put(syncable::SERVER_IS_DIR, false);
+ node.Put(syncable::SERVER_IS_DIR, true);
node.Put(syncable::IS_UNSYNCED, false);
node.Put(syncable::IS_UNAPPLIED_UPDATE, false);
node.Put(syncable::SERVER_VERSION, 20);
node.Put(syncable::BASE_VERSION, 20);
+ node.Put(syncable::SERVER_IS_DEL, false);
node.Put(syncable::IS_DEL, false);
- node.Put(syncable::ID, syncer::TestIdFactory::MakeServer(tag_name));
+
sync_pb::EntitySpecifics specifics;
syncer::AddDefaultFieldValue(type, &specifics);
node.Put(syncable::SERVER_SPECIFICS, specifics);
node.Put(syncable::SPECIFICS, specifics);
+
+ // Tag name will make a good enough NON_UNIQUE_NAME.
+ node.Put(syncable::SERVER_NON_UNIQUE_NAME, tag_name);
+ node.Put(syncable::NON_UNIQUE_NAME, tag_name);
}
} // namespace syncable
« no previous file with comments | « sync/test/engine/mock_connection_manager.cc ('k') | sync/test/test_directory_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698