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

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

Issue 2504753003: Bookmarks bar, tooltip should be seen only for folders with big names on macOS. (Closed)
Patch Set: Add unittest Created 4 years, 1 month 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/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
index e6502d098289a9cc0903c797264a451fee4a79d9..0e88aabe4238ed7ca2aee48131560f37d5ad9a04 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
@@ -1615,6 +1615,35 @@ - (void)setDragDataNode:(const BookmarkNode*)node {
EXPECT_CGFLOAT_EQ([targetButton bottom].y - yBottomOffset, pos);
}
+TEST_F(BookmarkBarFolderControllerMenuTest, FolderTooltips) {
+ BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
+ const BookmarkNode* otherBookmarks = model->other_node();
+ model->AddFolder(otherBookmarks, otherBookmarks->child_count(),
+ ASCIIToUTF16("short_name"));
+ model->AddFolder(
+ otherBookmarks, otherBookmarks->child_count(),
+ ASCIIToUTF16("reallyReallyLongBookmarkNamereallyReallyLongBookmarkNamerea"
+ "llyReallyLongBookmarkNamereallyReallyLongBookmarkName"));
+ BookmarkButton* otherButton = [bar_ otherBookmarksButton];
+ ASSERT_TRUE(otherButton);
+
+ [[otherButton target] openBookmarkFolderFromButton:otherButton];
+ BookmarkBarFolderController* folder = [bar_ folderController];
+ EXPECT_TRUE(folder);
+
+ NSArray* buttons = [folder buttons];
+ EXPECT_EQ(2U, [buttons count]);
+
+ for (BookmarkButton* btn in buttons) {
+ if ([[btn cell] cellSize].width >
+ bookmarks::kBookmarkMenuButtonMaximumWidth) {
+ EXPECT_TRUE([btn toolTip]);
+ } else {
+ EXPECT_FALSE([btn toolTip]);
+ }
+ }
+}
+
@interface BookmarkBarControllerNoDelete : BookmarkBarController
- (IBAction)deleteBookmark:(id)sender;
@end
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698