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

Unified Diff: chrome/browser/bookmarks/bookmark_table_model_unittest.cc

Issue 27262: Wires up sorting of bookmarks to the 'organize menu' in the bookmark... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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/bookmarks/bookmark_table_model_unittest.cc
===================================================================
--- chrome/browser/bookmarks/bookmark_table_model_unittest.cc (revision 10579)
+++ chrome/browser/bookmarks/bookmark_table_model_unittest.cc (working copy)
@@ -143,6 +143,23 @@
VerifyAndClearOberserverCounts(0, 0, 0, 0);
}
+// Verifies sort sends out notification and results in a sort.
+TEST_F(BookmarkTableModelTest, SortFolder) {
+ BookmarkNode* other = bookmark_model()->other_node();
+ SetModel(BookmarkTableModel::CreateBookmarkTableModelForFolder(
+ bookmark_model(), other));
+ ASSERT_EQ(3, model_->RowCount());
+ bookmark_model()->SortChildren(other);
+
+ // Sorting should trigger change notification.
+ VerifyAndClearOberserverCounts(1, 0, 0, 0);
+
+ // Make sure things reordered.
+ EXPECT_TRUE(other->GetChild(0) == model_->GetNodeForRow(0));
+ EXPECT_TRUE(other->GetChild(1) == model_->GetNodeForRow(1));
+ EXPECT_TRUE(other->GetChild(2) == model_->GetNodeForRow(2));
+}
+
// Verifies removing an item from folder model generates the correct event.
TEST_F(BookmarkTableModelTest, RemoveFromFolder) {
BookmarkNode* other = bookmark_model()->other_node();

Powered by Google App Engine
This is Rietveld 408576698