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

Unified Diff: components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc

Issue 682933002: Reduce frequency of requesting bookmark clusters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « components/enhanced_bookmarks/enhanced_bookmark_model_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
diff --git a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
index f1b8994e0b5c19c8389c9180166976a484b662fa..0d12de17f0f5d9c5f0f07f47ec56d84cf42f886e 100644
--- a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
+++ b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
@@ -35,10 +35,12 @@ class EnhancedBookmarkModelTest
shutting_down_calls_(0),
added_calls_(0),
removed_calls_(0),
+ changed_calls_(0),
all_user_nodes_removed_calls_(0),
remote_id_changed_calls_(0),
last_added_(NULL),
last_removed_(NULL),
+ last_changed_(NULL),
last_remote_id_node_(NULL) {}
~EnhancedBookmarkModelTest() override {}
@@ -118,6 +120,10 @@ class EnhancedBookmarkModelTest
removed_calls_++;
last_removed_ = node;
}
+ void EnhancedBookmarkNodeChanged(const BookmarkNode* node) override {
+ changed_calls_++;
+ last_changed_ = node;
+ }
void EnhancedBookmarkAllUserNodesRemoved() override {
all_user_nodes_removed_calls_++;
}
@@ -135,12 +141,14 @@ class EnhancedBookmarkModelTest
int shutting_down_calls_;
int added_calls_;
int removed_calls_;
+ int changed_calls_;
int all_user_nodes_removed_calls_;
int remote_id_changed_calls_;
// Observer parameter cache:
const BookmarkNode* last_added_;
const BookmarkNode* last_removed_;
+ const BookmarkNode* last_changed_;
const BookmarkNode* last_remote_id_node_;
std::string last_old_remote_id_;
std::string last_remote_id_;
@@ -592,6 +600,15 @@ TEST_F(EnhancedBookmarkModelTest, ObserverNodeRemovedEvent) {
EXPECT_EQ(folder, last_removed_);
}
+TEST_F(EnhancedBookmarkModelTest, ObserverNodeChangedEvent) {
+ const BookmarkNode* node = AddBookmark();
+
+ EXPECT_EQ(0, changed_calls_);
+ bookmark_model_->SetTitle(node, base::ASCIIToUTF16("New Title"));
+ EXPECT_EQ(1, changed_calls_);
+ EXPECT_EQ(node, last_changed_);
+}
+
TEST_F(EnhancedBookmarkModelTest, ObserverAllUserNodesRemovedEvent) {
AddBookmark();
AddFolder();
« no previous file with comments | « components/enhanced_bookmarks/enhanced_bookmark_model_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698