| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/mutable_entry.h" | 8 #include "sync/syncable/mutable_entry.h" |
| 9 #include "sync/syncable/syncable_id.h" | 9 #include "sync/syncable/syncable_id.h" |
| 10 #include "sync/syncable/write_transaction.h" | 10 #include "sync/syncable/write_transaction.h" |
| 11 #include "sync/test/engine/test_id_factory.h" | 11 #include "sync/test/engine/test_id_factory.h" |
| 12 | 12 |
| 13 using std::string; | 13 using std::string; |
| 14 |
| 15 namespace syncer { |
| 16 |
| 14 using syncable::Id; | 17 using syncable::Id; |
| 15 using syncable::MutableEntry; | 18 using syncable::MutableEntry; |
| 16 using syncable::UNITTEST; | 19 using syncable::UNITTEST; |
| 17 using syncable::WriteTransaction; | 20 using syncable::WriteTransaction; |
| 18 | 21 |
| 19 namespace syncer { | |
| 20 | |
| 21 TestEntryFactory::TestEntryFactory(syncable::Directory *dir) | 22 TestEntryFactory::TestEntryFactory(syncable::Directory *dir) |
| 22 : directory_(dir), next_revision_(1) { | 23 : directory_(dir), next_revision_(1) { |
| 23 } | 24 } |
| 24 | 25 |
| 25 TestEntryFactory::~TestEntryFactory() { } | 26 TestEntryFactory::~TestEntryFactory() { } |
| 26 | 27 |
| 27 void TestEntryFactory::CreateUnappliedNewItemWithParent( | 28 void TestEntryFactory::CreateUnappliedNewItemWithParent( |
| 28 const string& item_id, | 29 const string& item_id, |
| 29 const sync_pb::EntitySpecifics& specifics, | 30 const sync_pb::EntitySpecifics& specifics, |
| 30 const string& parent_id) { | 31 const string& parent_id) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 entry.Put(syncable::SERVER_PARENT_ID, parent_id); | 157 entry.Put(syncable::SERVER_PARENT_ID, parent_id); |
| 157 | 158 |
| 158 return entry.Get(syncable::META_HANDLE); | 159 return entry.Get(syncable::META_HANDLE); |
| 159 } | 160 } |
| 160 | 161 |
| 161 int64 TestEntryFactory::GetNextRevision() { | 162 int64 TestEntryFactory::GetNextRevision() { |
| 162 return next_revision_++; | 163 return next_revision_++; |
| 163 } | 164 } |
| 164 | 165 |
| 165 } // namespace syncer | 166 } // namespace syncer |
| OLD | NEW |