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

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

Issue 11411346: Bookmark: change Move() with no effect to keep the folder timestamp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_model_unittest.cc
diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc
index 0bbdc7063191c866aacee8384906c3ba5beedfae..6a17ef301fcde39b81cd1d0d05a746a7fe506b3a 100644
--- a/chrome/browser/bookmarks/bookmark_model_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc
@@ -516,6 +516,22 @@ TEST_F(BookmarkModelTest, Move) {
EXPECT_EQ(0, root->child_count());
}
+TEST_F(BookmarkModelTest, NonMovingMoveCall) {
+ const BookmarkNode* root = model_.bookmark_bar_node();
+ const string16 title(ASCIIToUTF16("foo"));
+ const GURL url("http://foo.com");
+ const base::Time old_date(base::Time::Now() - base::TimeDelta::FromDays(1));
+
+ const BookmarkNode* node = model_.AddURL(root, 0, title, url);
+ model_.SetDateFolderModified(root, old_date);
+
+ // Since |node| is already at the index 0 of |root|, this is no-op.
+ model_.Move(node, root, 0);
+
+ // Check that the modification date is kept untouched.
+ EXPECT_EQ(old_date, root->date_folder_modified());
+}
+
TEST_F(BookmarkModelTest, Copy) {
const BookmarkNode* root = model_.bookmark_bar_node();
static const std::string model_string("a 1:[ b c ] d 2:[ e f g ] h ");
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698