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

Unified Diff: chrome/test/sync/engine/test_syncable_utils.h

Issue 371029: Remove unique naming. (Closed)
Patch Set: Ready and about to go in! Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/sync/engine/mock_server_connection.cc ('k') | chrome/test/sync/engine/test_syncable_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/sync/engine/test_syncable_utils.h
diff --git a/chrome/test/sync/engine/test_syncable_utils.h b/chrome/test/sync/engine/test_syncable_utils.h
new file mode 100755
index 0000000000000000000000000000000000000000..4d6ce9c75bd24707622ce3910fcca3843d821324
--- /dev/null
+++ b/chrome/test/sync/engine/test_syncable_utils.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Utilities that are useful in verifying the state of items in a
+// syncable database.
+
+#ifndef CHROME_TEST_SYNC_ENGINE_TEST_SYNCABLE_UTILS_H_
+#define CHROME_TEST_SYNC_ENGINE_TEST_SYNCABLE_UTILS_H_
+
+#include "chrome/browser/sync/syncable/syncable.h"
+
+namespace syncable {
+
+class BaseTransaction;
+class Id;
+
+// Count the number of entries with a given name inside of a parent.
+// Useful to check folder structure and for porting older tests that
+// rely on uniqueness inside of folders.
+int CountEntriesWithName(BaseTransaction* rtrans,
+ const syncable::Id& parent_id,
+ const PathString& name);
+
+// Get the first entry ID with name in a parent. The entry *must* exist.
+Id GetFirstEntryWithName(BaseTransaction* rtrans,
+ const syncable::Id& parent_id,
+ const PathString& name);
+
+// Assert that there's only one entry by this name in this parent.
+// Return the Id.
+Id GetOnlyEntryWithName(BaseTransaction* rtrans,
+ const syncable::Id& parent_id,
+ const PathString& name);
+
+} // namespace syncable
+
+#endif // CHROME_TEST_SYNC_ENGINE_TEST_SYNCABLE_UTILS_H_
« no previous file with comments | « chrome/test/sync/engine/mock_server_connection.cc ('k') | chrome/test/sync/engine/test_syncable_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698