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

Side by Side Diff: sync/internal_api/test/test_entry_factory.cc

Issue 805633004: Enable Null Syncable ID which is different than Root ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback Created 6 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 unified diff | Download patch
« no previous file with comments | « sync/internal_api/sync_rollback_manager_base.cc ('k') | sync/internal_api/write_node.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/internal_api/public/test/test_entry_factory.h" 5 #include "sync/internal_api/public/test/test_entry_factory.h"
6 6
7 #include "sync/syncable/directory.h" 7 #include "sync/syncable/directory.h"
8 #include "sync/syncable/entry.h" 8 #include "sync/syncable/entry.h"
9 #include "sync/syncable/mutable_entry.h" 9 #include "sync/syncable/mutable_entry.h"
10 #include "sync/syncable/syncable_id.h" 10 #include "sync/syncable/syncable_id.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 const string& item_id, 69 const string& item_id,
70 const sync_pb::EntitySpecifics& specifics, 70 const sync_pb::EntitySpecifics& specifics,
71 bool is_unique) { 71 bool is_unique) {
72 WriteTransaction trans(FROM_HERE, UNITTEST, directory_); 72 WriteTransaction trans(FROM_HERE, UNITTEST, directory_);
73 MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM, 73 MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,
74 Id::CreateFromServerId(item_id)); 74 Id::CreateFromServerId(item_id));
75 DCHECK(entry.good()); 75 DCHECK(entry.good());
76 entry.PutServerVersion(GetNextRevision()); 76 entry.PutServerVersion(GetNextRevision());
77 entry.PutIsUnappliedUpdate(true); 77 entry.PutIsUnappliedUpdate(true);
78 entry.PutServerNonUniqueName(item_id); 78 entry.PutServerNonUniqueName(item_id);
79 entry.PutServerParentId(syncable::GetNullId()); 79 entry.PutServerParentId(syncable::Id::GetRoot());
80 entry.PutServerIsDir(is_unique); 80 entry.PutServerIsDir(is_unique);
81 entry.PutServerSpecifics(specifics); 81 entry.PutServerSpecifics(specifics);
82 if (is_unique) { // For top-level nodes. 82 if (is_unique) { // For top-level nodes.
83 entry.PutUniqueServerTag( 83 entry.PutUniqueServerTag(
84 ModelTypeToRootTag(GetModelTypeFromSpecifics(specifics))); 84 ModelTypeToRootTag(GetModelTypeFromSpecifics(specifics)));
85 } 85 }
86 return entry.GetMetahandle(); 86 return entry.GetMetahandle();
87 } 87 }
88 88
89 void TestEntryFactory::CreateUnsyncedItem( 89 void TestEntryFactory::CreateUnsyncedItem(
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 return false; 300 return false;
301 } 301 }
302 return entry.GetIsUnappliedUpdate(); 302 return entry.GetIsUnappliedUpdate();
303 } 303 }
304 304
305 int64 TestEntryFactory::GetNextRevision() { 305 int64 TestEntryFactory::GetNextRevision() {
306 return next_revision_++; 306 return next_revision_++;
307 } 307 }
308 308
309 } // namespace syncer 309 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_rollback_manager_base.cc ('k') | sync/internal_api/write_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698