| Index: chrome/browser/sync/test/integration/bookmarks_helper.cc
|
| diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc
|
| index 1e665d6cde93e3f0bbf553d85002afc50994c56e..e5551d5d87aadf825c74860a98c2aab627a30600 100644
|
| --- a/chrome/browser/sync/test/integration/bookmarks_helper.cc
|
| +++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc
|
| @@ -150,6 +150,20 @@ int CountNodesWithTitlesMatching(BookmarkModel* model,
|
| return count;
|
| }
|
|
|
| +// Returns the number of nodes of node type |node_type| in |model|.
|
| +int CountNodes(BookmarkModel* model, BookmarkNode::Type node_type) {
|
| + ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node());
|
| + // Walk through the model tree looking for bookmark nodes of node type
|
| + // |node_type|.
|
| + int count = 0;
|
| + while (iterator.has_next()) {
|
| + const BookmarkNode* node = iterator.Next();
|
| + if (node->type() == node_type)
|
| + ++count;
|
| + }
|
| + return count;
|
| +}
|
| +
|
| // Checks if the favicon data in |bitmap_a| and |bitmap_b| are equivalent.
|
| // Returns true if they match.
|
| bool FaviconRawBitmapsMatch(const SkBitmap& bitmap_a,
|
| @@ -771,6 +785,10 @@ const BookmarkNode* GetUniqueNodeByURL(int profile, const GURL& url) {
|
| return nodes[0];
|
| }
|
|
|
| +int CountAllBookmarks(int profile) {
|
| + return CountNodes(GetBookmarkModel(profile), BookmarkNode::URL);
|
| +}
|
| +
|
| int CountBookmarksWithTitlesMatching(int profile, const std::string& title) {
|
| return CountNodesWithTitlesMatching(GetBookmarkModel(profile),
|
| BookmarkNode::URL,
|
|
|