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

Unified Diff: chrome/browser/cocoa/bookmark_button_cell_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_button_cell.mm ('k') | chrome/browser/cocoa/gradient_button_cell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_button_cell_unittest.mm
===================================================================
--- chrome/browser/cocoa/bookmark_button_cell_unittest.mm (revision 20588)
+++ chrome/browser/cocoa/bookmark_button_cell_unittest.mm (working copy)
@@ -30,5 +30,26 @@
EXPECT_TRUE(size.width < 200 && size.height < 200);
}
+// Make sure a cell's menu has the cell itself as the delegate. This
+// is our convention for reusing the context menu across all bookmarks
+// while being unambiguous when used.
+TEST_F(BookmarkButtonCellTest, MenuDelegate) {
+ scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc]
+ initTextCell:@"Testing"]);
+ EXPECT_FALSE([cell.get() menu]);
+ scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@"foo"]);
+ [cell setMenu:menu.get()];
+ EXPECT_TRUE([cell.get() menu]);
+ EXPECT_EQ([[cell.get() menu] delegate], cell.get());
+ [cell setMenu:nil];
+}
+
+// Make sure the default from the base class is overridden
+TEST_F(BookmarkButtonCellTest, MouseEnterStuff) {
+ scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc]
+ initTextCell:@"Testing"]);
+ EXPECT_TRUE([cell.get() showsBorderOnlyWhileMouseInside]);
+}
+
} // namespace
« no previous file with comments | « chrome/browser/cocoa/bookmark_button_cell.mm ('k') | chrome/browser/cocoa/gradient_button_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698