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

Unified Diff: sync/test/engine/test_syncable_utils.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/test/engine/test_syncable_utils.h ('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 38734203af028f56748948f25719755024449298..e5ff28577500100fe5c6ac59dc164027666771bd 100644
--- a/sync/test/engine/test_syncable_utils.cc
+++ b/sync/test/engine/test_syncable_utils.cc
@@ -9,6 +9,9 @@
#include "sync/syncable/base_transaction.h"
#include "sync/syncable/directory.h"
#include "sync/syncable/entry.h"
+#include "sync/syncable/mutable_entry.h"
+#include "sync/syncable/write_transaction.h"
+#include "sync/test/engine/test_id_factory.h"
using std::string;
@@ -62,5 +65,29 @@ Id GetOnlyEntryWithName(BaseTransaction* rtrans,
return GetFirstEntryWithName(rtrans, parent_id, name);
}
+void CreateTypeRoot(WriteTransaction* trans,
+ syncable::Directory *dir,
+ ModelType type) {
+ std::string tag_name = syncer::ModelTypeToRootTag(type);
+ syncable::MutableEntry node(trans,
+ syncable::CREATE,
+ TestIdFactory::root(),
+ tag_name);
+ DCHECK(node.good());
+ node.Put(syncable::UNIQUE_SERVER_TAG, tag_name);
+ node.Put(syncable::IS_DIR, true);
+ node.Put(syncable::SERVER_IS_DIR, false);
+ 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::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);
+}
+
} // namespace syncable
} // namespace syncer
« no previous file with comments | « sync/test/engine/test_syncable_utils.h ('k') | sync/test/test_directory_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698