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

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

Issue 155358: More bookmark bar changes.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « chrome/browser/cocoa/bookmark_bar_bridge.mm ('k') | chrome/browser/cocoa/bookmark_bar_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
===================================================================
--- chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm (revision 20588)
+++ chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm (working copy)
@@ -32,10 +32,12 @@
@implementation FakeBookmarkBarController
-- (id)initWithProfile:(Profile*)profile view:(NSView*)view {
+- (id)initWithProfile:(Profile*)profile
+ parentView:(NSView*)parentView
+ webContentView:(NSView*)webContentView {
if ((self = [super initWithProfile:profile
- view:(BookmarkBarView*)view
- webContentView:nil
+ parentView:parentView
+ webContentView:webContentView
delegate:self])) {
callbacks_.reset([[NSMutableArray alloc] init]);
}
@@ -76,6 +78,11 @@
[callbacks_ addObject:[NSNumber numberWithInt:6]];
}
+- (void)nodeRemoved:(BookmarkModel*)model
+ parent:(const BookmarkNode*)oldParent index:(int)index {
+ [callbacks_ addObject:[NSNumber numberWithInt:7]];
+}
+
// Save the request.
- (void)openBookmarkURL:(const GURL&)url
disposition:(WindowOpenDisposition)disposition {
@@ -102,12 +109,16 @@
Profile *profile = browser_test_helper_.profile();
BookmarkModel *model = profile->GetBookmarkModel();
- scoped_nsobject<NSView> view([[NSView alloc]
- initWithFrame:NSMakeRect(0,0,10,10)]);
- [view.get() setHidden:YES];
+ scoped_nsobject<NSView> parentView([[NSView alloc]
+ initWithFrame:NSMakeRect(0,0,100,100)]);
+ scoped_nsobject<NSView> webView([[NSView alloc]
+ initWithFrame:NSMakeRect(0,0,100,100)]);
+
scoped_nsobject<FakeBookmarkBarController>
- controller([[FakeBookmarkBarController alloc] initWithProfile:profile
- view:view.get()]);
+ controller([[FakeBookmarkBarController alloc]
+ initWithProfile:profile
+ parentView:parentView.get()
+ webContentView:webView.get()]);
EXPECT_TRUE(controller.get());
scoped_ptr<BookmarkBarBridge> bridge(new BookmarkBarBridge(controller.get(),
model));
@@ -120,11 +131,12 @@
bridge->BookmarkNodeChanged(NULL, NULL);
bridge->BookmarkNodeFavIconLoaded(NULL, NULL);
bridge->BookmarkNodeChildrenReordered(NULL, NULL);
+ bridge->BookmarkNodeRemoved(NULL, NULL, 0);
- // 7 calls above plus an initial Loaded() in init routine makes 8
- EXPECT_TRUE([controller.get()->callbacks_ count] == 8);
+ // 8 calls above plus an initial Loaded() in init routine makes 9
+ EXPECT_TRUE([controller.get()->callbacks_ count] == 9);
- for (int x = 1; x < 8; x++) {
+ for (int x = 1; x < 9; x++) {
NSNumber *num = [NSNumber numberWithInt:x-1];
EXPECT_TRUE([[controller.get()->callbacks_ objectAtIndex:x] isEqual:num]);
}
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_bridge.mm ('k') | chrome/browser/cocoa/bookmark_bar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698