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

Unified Diff: sync/internal_api/test/test_entry_factory.cc

Issue 11474036: Remove initial_sync_ended bits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another rebase 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/internal_api/sync_manager_impl_unittest.cc ('k') | sync/internal_api/test/test_user_share.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/test/test_entry_factory.cc
diff --git a/sync/internal_api/test/test_entry_factory.cc b/sync/internal_api/test/test_entry_factory.cc
index 3cf0dcfec051c3ae621f31f9b29afa74b0dc3736..f57841253c9ef086a86e2ec2c42cd4ae5a868877 100644
--- a/sync/internal_api/test/test_entry_factory.cc
+++ b/sync/internal_api/test/test_entry_factory.cc
@@ -164,6 +164,28 @@ int64 TestEntryFactory::CreateSyncedItem(
return entry.Get(syncable::META_HANDLE);
}
+int64 TestEntryFactory::CreateUnappliedRootNode(
+ ModelType model_type) {
+ syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, directory_);
+ sync_pb::EntitySpecifics specifics;
+ AddDefaultFieldValue(model_type, &specifics);
+ syncable::Id node_id = TestIdFactory::MakeServer("xyz");
+ syncable::MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,
+ node_id);
+ DCHECK(entry.good());
+ // Make it look like sort of like a pending creation from the server.
+ // The SERVER_PARENT_ID and UNIQUE_CLIENT_TAG aren't quite right, but
+ // it's good enough for our purposes.
+ entry.Put(syncable::SERVER_VERSION, 1);
+ entry.Put(syncable::IS_UNAPPLIED_UPDATE, true);
+ entry.Put(syncable::SERVER_IS_DIR, false);
+ entry.Put(syncable::SERVER_PARENT_ID, TestIdFactory::root());
+ entry.Put(syncable::SERVER_SPECIFICS, specifics);
+ entry.Put(syncable::NON_UNIQUE_NAME, "xyz");
+
+ return entry.Get(syncable::META_HANDLE);
+}
+
bool TestEntryFactory::SetServerSpecificsForItem(
int64 meta_handle,
const sync_pb::EntitySpecifics specifics) {
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | sync/internal_api/test/test_user_share.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698