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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm

Issue 23522055: [Mac] Show context menu on empty BMB item. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 ASCIIToUTF16("supertitle"), 912 ASCIIToUTF16("supertitle"),
913 GURL("http://superfriends.hall-of-justice.edu")); 913 GURL("http://superfriends.hall-of-justice.edu"));
914 const BookmarkNode* node = parent->GetChild(0); 914 const BookmarkNode* node = parent->GetChild(0);
915 915
916 NSCell* cell = [bar_ cellForBookmarkNode:node]; 916 NSCell* cell = [bar_ cellForBookmarkNode:node];
917 EXPECT_TRUE(cell); 917 EXPECT_TRUE(cell);
918 EXPECT_NSEQ(@"supertitle", [cell title]); 918 EXPECT_NSEQ(@"supertitle", [cell title]);
919 EXPECT_EQ(node, [[cell representedObject] pointerValue]); 919 EXPECT_EQ(node, [[cell representedObject] pointerValue]);
920 EXPECT_TRUE([cell menu]); 920 EXPECT_TRUE([cell menu]);
921 921
922 // Empty cells have no menu. 922 // Empty cells still have a menu.
923 cell = [bar_ cellForBookmarkNode:nil]; 923 cell = [bar_ cellForBookmarkNode:nil];
924 EXPECT_FALSE([cell menu]); 924 EXPECT_TRUE([cell menu]);
925 // Even empty cells have a title (of "(empty)") 925 // Even empty cells have a title (of "(empty)")
926 EXPECT_TRUE([cell title]); 926 EXPECT_TRUE([cell title]);
927 927
928 // cell is autoreleased; no need to release here 928 // cell is autoreleased; no need to release here
929 } 929 }
930 930
931 // Test drawing, mostly to ensure nothing leaks or crashes. 931 // Test drawing, mostly to ensure nothing leaks or crashes.
932 TEST_F(BookmarkBarControllerTest, Display) { 932 TEST_F(BookmarkBarControllerTest, Display) {
933 [[bar_ view] display]; 933 [[bar_ view] display];
934 } 934 }
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 "2f3b ] 4b "); 2074 "2f3b ] 4b ");
2075 actual = BookmarkModelTestUtils::ModelStringFromNode(root); 2075 actual = BookmarkModelTestUtils::ModelStringFromNode(root);
2076 EXPECT_EQ(expected, actual); 2076 EXPECT_EQ(expected, actual);
2077 2077
2078 // Verify that the other bookmark folder can't be deleted. 2078 // Verify that the other bookmark folder can't be deleted.
2079 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; 2079 BookmarkButton *otherButton = [bar_ otherBookmarksButton];
2080 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); 2080 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]);
2081 } 2081 }
2082 2082
2083 } // namespace 2083 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698