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

Unified Diff: chrome/browser/sync/test/integration/bookmarks_helper.cc

Issue 772513004: Add new E2E sync multi profiles tests. This should not affect any existing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile issues Created 5 years, 11 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/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 e85eea51361c96c1c47b0395a3441a85718086c1..eae9c43b0ae03f5671cd7b2a222cdd30ead9f563 100644
--- a/chrome/browser/sync/test/integration/bookmarks_helper.cc
+++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc
@@ -154,6 +154,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,
@@ -774,6 +788,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,
« no previous file with comments | « chrome/browser/sync/test/integration/bookmarks_helper.h ('k') | chrome/browser/sync/test/integration/p2p_sync_refresher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698