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

Side by Side Diff: sync/test/engine/test_syncable_utils.h

Issue 10699044: [Sync] Move sync/{internal_api,syncable} into syncer namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Utilities that are useful in verifying the state of items in a 5 // Utilities that are useful in verifying the state of items in a
6 // syncable database. 6 // syncable database.
7 7
8 #ifndef SYNC_TEST_ENGINE_TEST_SYNCABLE_UTILS_H_ 8 #ifndef SYNC_TEST_ENGINE_TEST_SYNCABLE_UTILS_H_
9 #define SYNC_TEST_ENGINE_TEST_SYNCABLE_UTILS_H_ 9 #define SYNC_TEST_ENGINE_TEST_SYNCABLE_UTILS_H_
10 #pragma once 10 #pragma once
11 11
12 #include <string> 12 #include <string>
13 13
14 namespace syncer {
14 namespace syncable { 15 namespace syncable {
15 16
16 class BaseTransaction; 17 class BaseTransaction;
17 class Id; 18 class Id;
18 19
19 // Count the number of entries with a given name inside of a parent. 20 // Count the number of entries with a given name inside of a parent.
20 // Useful to check folder structure and for porting older tests that 21 // Useful to check folder structure and for porting older tests that
21 // rely on uniqueness inside of folders. 22 // rely on uniqueness inside of folders.
22 int CountEntriesWithName(BaseTransaction* rtrans, 23 int CountEntriesWithName(BaseTransaction* rtrans,
23 const syncable::Id& parent_id, 24 const syncable::Id& parent_id,
24 const std::string& name); 25 const std::string& name);
25 26
26 // Get the first entry ID with name in a parent. The entry *must* exist. 27 // Get the first entry ID with name in a parent. The entry *must* exist.
27 Id GetFirstEntryWithName(BaseTransaction* rtrans, 28 Id GetFirstEntryWithName(BaseTransaction* rtrans,
28 const syncable::Id& parent_id, 29 const syncable::Id& parent_id,
29 const std::string& name); 30 const std::string& name);
30 31
31 // Assert that there's only one entry by this name in this parent. 32 // Assert that there's only one entry by this name in this parent.
32 // Return the Id. 33 // Return the Id.
33 Id GetOnlyEntryWithName(BaseTransaction* rtrans, 34 Id GetOnlyEntryWithName(BaseTransaction* rtrans,
34 const syncable::Id& parent_id, 35 const syncable::Id& parent_id,
35 const std::string& name); 36 const std::string& name);
36 37
37 } // namespace syncable 38 } // namespace syncable
39 } // namespace syncer
38 40
39 #endif // SYNC_TEST_ENGINE_TEST_SYNCABLE_UTILS_H_ 41 #endif // SYNC_TEST_ENGINE_TEST_SYNCABLE_UTILS_H_
OLDNEW
« no previous file with comments | « sync/test/engine/test_directory_setter_upper.cc ('k') | sync/test/engine/test_syncable_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698