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

Side by Side Diff: components/sync/engine_impl/test_entry_factory.cc

Issue 2502253003: [Sync] Move GenerateSyncableHash to base. (Closed)
Patch Set: Keep full syncable/ DEP. Created 4 years, 1 month 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
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 "components/sync/engine_impl/test_entry_factory.h" 5 #include "components/sync/engine_impl/test_entry_factory.h"
6 6
7 #include "components/sync/base/hash_util.h"
7 #include "components/sync/base/model_type.h" 8 #include "components/sync/base/model_type.h"
8 #include "components/sync/syncable/directory.h" 9 #include "components/sync/syncable/directory.h"
9 #include "components/sync/syncable/entry.h" 10 #include "components/sync/syncable/entry.h"
10 #include "components/sync/syncable/model_neutral_mutable_entry.h" 11 #include "components/sync/syncable/model_neutral_mutable_entry.h"
11 #include "components/sync/syncable/mutable_entry.h" 12 #include "components/sync/syncable/mutable_entry.h"
12 #include "components/sync/syncable/syncable_id.h" 13 #include "components/sync/syncable/syncable_id.h"
13 #include "components/sync/syncable/syncable_model_neutral_write_transaction.h" 14 #include "components/sync/syncable/syncable_model_neutral_write_transaction.h"
14 #include "components/sync/syncable/syncable_read_transaction.h" 15 #include "components/sync/syncable/syncable_read_transaction.h"
15 #include "components/sync/syncable/syncable_util.h"
16 #include "components/sync/syncable/syncable_write_transaction.h" 16 #include "components/sync/syncable/syncable_write_transaction.h"
17 #include "components/sync/test/engine/test_id_factory.h" 17 #include "components/sync/test/engine/test_id_factory.h"
18 18
19 using std::string; 19 using std::string;
20 20
21 namespace syncer { 21 namespace syncer {
22 22
23 using syncable::Id; 23 using syncable::Id;
24 using syncable::MutableEntry; 24 using syncable::MutableEntry;
25 using syncable::UNITTEST; 25 using syncable::UNITTEST;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 MutableEntry entry(&trans, syncable::CREATE, model_type, parent_id, name); 165 MutableEntry entry(&trans, syncable::CREATE, model_type, parent_id, name);
166 if (!entry.good()) { 166 if (!entry.good()) {
167 NOTREACHED(); 167 NOTREACHED();
168 return syncable::kInvalidMetaHandle; 168 return syncable::kInvalidMetaHandle;
169 } 169 }
170 170
171 entry.PutId(item_id); 171 entry.PutId(item_id);
172 entry.PutCtime(now); 172 entry.PutCtime(now);
173 entry.PutMtime(now); 173 entry.PutMtime(now);
174 entry.PutUniqueClientTag(syncable::GenerateSyncableHash(model_type, name)); 174 entry.PutUniqueClientTag(GenerateSyncableHash(model_type, name));
175 entry.PutBaseVersion(version); 175 entry.PutBaseVersion(version);
176 entry.PutIsUnsynced(false); 176 entry.PutIsUnsynced(false);
177 entry.PutNonUniqueName(name); 177 entry.PutNonUniqueName(name);
178 entry.PutIsDir(is_folder); 178 entry.PutIsDir(is_folder);
179 entry.PutIsDel(false); 179 entry.PutIsDel(false);
180 entry.PutParentId(parent_id); 180 entry.PutParentId(parent_id);
181 181
182 entry.PutServerCtime(now); 182 entry.PutServerCtime(now);
183 entry.PutServerMtime(now); 183 entry.PutServerMtime(now);
184 entry.PutServerVersion(version); 184 entry.PutServerVersion(version);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 return false; 337 return false;
338 } 338 }
339 return entry.GetIsUnappliedUpdate(); 339 return entry.GetIsUnappliedUpdate();
340 } 340 }
341 341
342 int64_t TestEntryFactory::GetNextRevision() { 342 int64_t TestEntryFactory::GetNextRevision() {
343 return next_revision_++; 343 return next_revision_++;
344 } 344 }
345 345
346 } // namespace syncer 346 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine_impl/syncer_util.cc ('k') | components/sync/engine_impl/uss_migrator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698