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

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

Issue 8141003: [Mac] Restore the old bookmark menus now that the experiment is over. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/memory/scoped_nsobject.h" 5 #include "base/memory/scoped_nsobject.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/bookmarks/bookmark_model.h" 7 #include "chrome/browser/bookmarks/bookmark_model.h"
8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" 8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h"
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h" 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h"
10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 EXPECT_EQ(button.get()->exits_, 3); 145 EXPECT_EQ(button.get()->exits_, 3);
146 } 146 }
147 147
148 // Confirms a cell created in a nib is initialized properly 148 // Confirms a cell created in a nib is initialized properly
149 TEST_F(BookmarkButtonCellTest, Awake) { 149 TEST_F(BookmarkButtonCellTest, Awake) {
150 scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc] init]); 150 scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc] init]);
151 [cell awakeFromNib]; 151 [cell awakeFromNib];
152 EXPECT_EQ(NSLeftTextAlignment, [cell alignment]); 152 EXPECT_EQ(NSLeftTextAlignment, [cell alignment]);
153 } 153 }
154 154
155 // Subfolder arrow details.
156 TEST_F(BookmarkButtonCellTest, FolderArrow) {
157 BookmarkModel* model = profile()->GetBookmarkModel();
158 const BookmarkNode* bar = model->bookmark_bar_node();
159 const BookmarkNode* node = model->AddURL(bar, bar->child_count(),
160 ASCIIToUTF16("title"),
161 GURL("http://www.google.com"));
162 scoped_nsobject<BookmarkButtonCell> cell(
163 [[BookmarkButtonCell alloc] initForNode:node
164 contextMenu:nil
165 cellText:@"small"
166 cellImage:nil]);
167 EXPECT_TRUE(cell.get());
168
169 NSSize size = [cell cellSize];
170 // sanity check
171 EXPECT_GE(size.width, 2);
172 EXPECT_GE(size.height, 2);
173
174 // Once we turn on arrow drawing make sure there is now room for it.
175 [cell setDrawFolderArrow:YES];
176 NSSize arrowSize = [cell cellSize];
177 EXPECT_GT(arrowSize.width, size.width);
178 }
179
155 } // namespace 180 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698