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

Unified Diff: sync/engine/directory_commit_contribution_unittest.cc

Issue 1023843002: Sync: support implicit permanent folders in commits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | sync/engine/get_commit_ids.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/directory_commit_contribution_unittest.cc
diff --git a/sync/engine/directory_commit_contribution_unittest.cc b/sync/engine/directory_commit_contribution_unittest.cc
index 720f0889190a42577de2ed989c2679fc8aea8dbc..3f297a7cd77f96d2185e9df2f71dae9224f232ea 100644
--- a/sync/engine/directory_commit_contribution_unittest.cc
+++ b/sync/engine/directory_commit_contribution_unittest.cc
@@ -38,13 +38,15 @@ class DirectoryCommitContributionTest : public ::testing::Test {
ModelType type,
const std::string& tag,
const sync_pb::AttachmentMetadata& attachment_metadata) {
- syncable::Entry parent_entry(trans, syncable::GET_TYPE_ROOT, type);
- syncable::MutableEntry entry(
- trans,
- syncable::CREATE,
- type,
- parent_entry.GetId(),
- tag);
+ // For bookmarks specify the Bookmarks root folder as the parent;
+ // for other types leave the parent ID empty
+ syncable::Id parent_id;
+ if (type == BOOKMARKS) {
+ syncable::Entry parent_entry(trans, syncable::GET_TYPE_ROOT, type);
+ parent_id = parent_entry.GetId();
+ }
+
+ syncable::MutableEntry entry(trans, syncable::CREATE, type, parent_id, tag);
if (attachment_metadata.record_size() > 0) {
entry.PutAttachmentMetadata(attachment_metadata);
}
« no previous file with comments | « no previous file | sync/engine/get_commit_ids.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698