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

Unified Diff: chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk_unittest.cc

Issue 7012005: Revert "Revert 84829 - Initial implementation of "Synced Bookmarks" folder." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Trying to set .json eol-style Created 9 years, 7 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/ui/gtk/bookmarks/bookmark_editor_gtk_unittest.cc
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk_unittest.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk_unittest.cc
index 318f2467daf3464a2f5b5392e52e5ea8cc7e1747..2efa80abfcf576f98ee19534f12f5928c431038d 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk_unittest.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk_unittest.cc
@@ -71,6 +71,8 @@ class BookmarkEditorGtkTest : public testing::Test {
// oa
// OF1
// of1a
+ // synced node
+ // sa
void AddTestData() {
std::string test_base = base_path();
@@ -89,6 +91,10 @@ class BookmarkEditorGtkTest : public testing::Test {
const BookmarkNode* of1 =
model_->AddFolder(model_->other_node(), 1, ASCIIToUTF16("OF1"));
model_->AddURL(of1, 0, ASCIIToUTF16("of1a"), GURL(test_base + "of1a"));
+
+ // Children of the synced node.
+ model_->AddURL(model_->synced_node(), 0, ASCIIToUTF16("sa"),
+ GURL(test_base + "sa"));
}
};
@@ -98,15 +104,22 @@ TEST_F(BookmarkEditorGtkTest, ModelsMatch) {
BookmarkEditor::EditDetails(),
BookmarkEditor::SHOW_TREE);
- // The root should have two children, one for the bookmark bar node,
- // the other for the 'other bookmarks' folder.
+ // The root should have two or three children, one for the bookmark bar node,
+ // another for the 'other bookmarks' folder, and depending on the visib
GtkTreeModel* store = GTK_TREE_MODEL(editor.tree_store_);
GtkTreeIter toplevel;
ASSERT_TRUE(gtk_tree_model_get_iter_first(store, &toplevel));
GtkTreeIter bookmark_bar_node = toplevel;
ASSERT_TRUE(gtk_tree_model_iter_next(store, &toplevel));
GtkTreeIter other_node = toplevel;
- ASSERT_FALSE(gtk_tree_model_iter_next(store, &toplevel));
+ if (model_->synced_node()->IsVisible()) {
+ // If we have a synced node, then the iterator should find one element after
+ // "other bookmarks"
+ ASSERT_TRUE(gtk_tree_model_iter_next(store, &toplevel));
+ ASSERT_FALSE(gtk_tree_model_iter_next(store, &toplevel));
+ } else {
+ ASSERT_FALSE(gtk_tree_model_iter_next(store, &toplevel));
+ }
// The bookmark bar should have 2 nodes: folder F1 and F2.
GtkTreeIter f1_iter;
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm ('k') | chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698