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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm

Issue 2793363002: [Mac] Remove no-op method in bookmark bar controller (Closed)
Patch Set: Revert changes changes required by new bookmark bar init until that lands Created 3 years, 8 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/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm
index 44ac79c1ac67dd4991d9c0782dc2a4d9404b6b22..a391f56907fad5b86cda92d170e44248289ec3ff 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm
@@ -51,39 +51,35 @@ typedef std::pair<GURL,WindowOpenDisposition> OpenInfo;
[callbacks_ addObject:[NSNumber numberWithInt:0]];
}
-- (void)beingDeleted:(BookmarkModel*)model {
- [callbacks_ addObject:[NSNumber numberWithInt:1]];
-}
-
- (void)nodeMoved:(BookmarkModel*)model
oldParent:(const BookmarkNode*)oldParent oldIndex:(int)oldIndex
newParent:(const BookmarkNode*)newParent newIndex:(int)newIndex {
- [callbacks_ addObject:[NSNumber numberWithInt:2]];
+ [callbacks_ addObject:[NSNumber numberWithInt:1]];
Elly Fong-Jones 2017/04/04 19:07:33 are these intended to mean something? should they
lgrey 2017/04/04 19:42:21 Per offline discussion, switched to storing/compar
}
- (void)nodeAdded:(BookmarkModel*)model
parent:(const BookmarkNode*)oldParent index:(int)index {
- [callbacks_ addObject:[NSNumber numberWithInt:3]];
+ [callbacks_ addObject:[NSNumber numberWithInt:2]];
}
- (void)nodeChanged:(BookmarkModel*)model
node:(const BookmarkNode*)node {
- [callbacks_ addObject:[NSNumber numberWithInt:4]];
+ [callbacks_ addObject:[NSNumber numberWithInt:3]];
}
- (void)nodeFaviconLoaded:(BookmarkModel*)model
node:(const BookmarkNode*)node {
- [callbacks_ addObject:[NSNumber numberWithInt:5]];
+ [callbacks_ addObject:[NSNumber numberWithInt:4]];
}
- (void)nodeChildrenReordered:(BookmarkModel*)model
node:(const BookmarkNode*)node {
- [callbacks_ addObject:[NSNumber numberWithInt:6]];
+ [callbacks_ addObject:[NSNumber numberWithInt:5]];
}
- (void)nodeRemoved:(BookmarkModel*)model
parent:(const BookmarkNode*)oldParent index:(int)index {
- [callbacks_ addObject:[NSNumber numberWithInt:7]];
+ [callbacks_ addObject:[NSNumber numberWithInt:6]];
}
// Save the request.
@@ -117,19 +113,18 @@ TEST_F(BookmarkBarBridgeTest, TestRedirect) {
EXPECT_TRUE(bridge.get());
bridge->BookmarkModelLoaded(NULL, false);
- bridge->BookmarkModelBeingDeleted(NULL);
+ // |BookmarkModelBeingDeleted| is a no-op.
bridge->BookmarkNodeMoved(NULL, NULL, 0, NULL, 0);
bridge->BookmarkNodeAdded(NULL, NULL, 0);
bridge->BookmarkNodeChanged(NULL, NULL);
bridge->BookmarkNodeFaviconChanged(NULL, NULL);
bridge->BookmarkNodeChildrenReordered(NULL, NULL);
bridge->BookmarkNodeRemoved(NULL, NULL, 0, NULL, std::set<GURL>());
+ // 7 calls above plus an initial Loaded() in init routine makes 8
+ EXPECT_TRUE([controller.get()->callbacks_ count] == 8);
Elly Fong-Jones 2017/04/04 19:07:33 EXPECT_EQ() surely?
lgrey 2017/04/04 19:42:21 Done.
- // 8 calls above plus an initial Loaded() in init routine makes 9
- EXPECT_TRUE([controller.get()->callbacks_ count] == 9);
-
- for (int x = 1; x < 9; x++) {
- NSNumber* num = [NSNumber numberWithInt:x-1];
+ for (int x = 1; x < 8; x++) {
+ NSNumber* num = [NSNumber numberWithInt:x - 1];
EXPECT_NSEQ(num, [controller.get()->callbacks_ objectAtIndex:x]);
}
}
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698