OLD | NEW |
1 // Copyright (c) 2011 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 // Utilities to verify the state of items in unit tests. | 5 // Utilities to verify the state of items in unit tests. |
6 | 6 |
7 #include "chrome/browser/sync/test/engine/test_syncable_utils.h" | 7 #include "sync/test/engine/test_syncable_utils.h" |
8 | 8 |
9 #include "chrome/browser/sync/syncable/syncable.h" | 9 #include "sync/syncable/syncable.h" |
10 | 10 |
11 using std::string; | 11 using std::string; |
12 | 12 |
13 namespace syncable { | 13 namespace syncable { |
14 | 14 |
15 int CountEntriesWithName(BaseTransaction* rtrans, | 15 int CountEntriesWithName(BaseTransaction* rtrans, |
16 const syncable::Id& parent_id, | 16 const syncable::Id& parent_id, |
17 const string& name) { | 17 const string& name) { |
18 Directory::ChildHandles child_handles; | 18 Directory::ChildHandles child_handles; |
19 rtrans->directory()->GetChildHandlesById(rtrans, parent_id, &child_handles); | 19 rtrans->directory()->GetChildHandlesById(rtrans, parent_id, &child_handles); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 Id GetOnlyEntryWithName(BaseTransaction* rtrans, | 55 Id GetOnlyEntryWithName(BaseTransaction* rtrans, |
56 const syncable::Id& parent_id, | 56 const syncable::Id& parent_id, |
57 const string& name) { | 57 const string& name) { |
58 CHECK(1 == CountEntriesWithName(rtrans, parent_id, name)); | 58 CHECK(1 == CountEntriesWithName(rtrans, parent_id, name)); |
59 return GetFirstEntryWithName(rtrans, parent_id, name); | 59 return GetFirstEntryWithName(rtrans, parent_id, name); |
60 } | 60 } |
61 | 61 |
62 } // namespace syncable | 62 } // namespace syncable |
OLD | NEW |