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

Unified Diff: chrome/browser/sync/test/engine/test_syncable_utils.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/engine/test_syncable_utils.cc
diff --git a/chrome/browser/sync/test/engine/test_syncable_utils.cc b/chrome/browser/sync/test/engine/test_syncable_utils.cc
deleted file mode 100644
index b76f6f7effe63f902268d96b660b5ace8539cb96..0000000000000000000000000000000000000000
--- a/chrome/browser/sync/test/engine/test_syncable_utils.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2011 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 to verify the state of items in unit tests.
-
-#include "chrome/browser/sync/test/engine/test_syncable_utils.h"
-
-#include "chrome/browser/sync/syncable/syncable.h"
-
-using std::string;
-
-namespace syncable {
-
-int CountEntriesWithName(BaseTransaction* rtrans,
- const syncable::Id& parent_id,
- const string& name) {
- Directory::ChildHandles child_handles;
- rtrans->directory()->GetChildHandlesById(rtrans, parent_id, &child_handles);
- if (child_handles.size() <= 0) {
- return 0;
- }
-
- int number_of_entries_with_name = 0;
- for (Directory::ChildHandles::iterator i = child_handles.begin();
- i != child_handles.end(); ++i) {
- Entry e(rtrans, GET_BY_HANDLE, *i);
- CHECK(e.good());
- if (e.Get(NON_UNIQUE_NAME) == name) {
- ++number_of_entries_with_name;
- }
- }
- return number_of_entries_with_name;
-}
-
-Id GetFirstEntryWithName(BaseTransaction* rtrans,
- const syncable::Id& parent_id,
- const string& name) {
- Directory::ChildHandles child_handles;
- rtrans->directory()->GetChildHandlesById(rtrans, parent_id, &child_handles);
-
- for (Directory::ChildHandles::iterator i = child_handles.begin();
- i != child_handles.end(); ++i) {
- Entry e(rtrans, GET_BY_HANDLE, *i);
- CHECK(e.good());
- if (e.Get(NON_UNIQUE_NAME) == name) {
- return e.Get(ID);
- }
- }
-
- CHECK(false);
- return Id();
-}
-
-Id GetOnlyEntryWithName(BaseTransaction* rtrans,
- const syncable::Id& parent_id,
- const string& name) {
- CHECK(1 == CountEntriesWithName(rtrans, parent_id, name));
- return GetFirstEntryWithName(rtrans, parent_id, name);
-}
-
-} // namespace syncable
« no previous file with comments | « chrome/browser/sync/test/engine/test_syncable_utils.h ('k') | chrome/browser/sync/test/engine/test_user_share.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698