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

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

Issue 1709004: size --> cellSize adjustment (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 8 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 | « chrome/browser/cocoa/bookmark_button_cell.mm ('k') | chrome/chrome_dll.gypi » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/scoped_nsobject.h" 5 #include "base/scoped_nsobject.h"
6 #import "chrome/browser/cocoa/bookmark_button_cell.h" 6 #import "chrome/browser/cocoa/bookmark_button_cell.h"
7 #import "chrome/browser/cocoa/bookmark_menu.h" 7 #import "chrome/browser/cocoa/bookmark_menu.h"
8 #include "chrome/browser/cocoa/browser_test_helper.h" 8 #include "chrome/browser/cocoa/browser_test_helper.h"
9 #import "chrome/browser/cocoa/cocoa_test_helper.h" 9 #import "chrome/browser/cocoa/cocoa_test_helper.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 EXPECT_EQ(button.get()->exits_, 3); 114 EXPECT_EQ(button.get()->exits_, 3);
115 } 115 }
116 116
117 // Confirms a cell created in a nib is initialized properly 117 // Confirms a cell created in a nib is initialized properly
118 TEST_F(BookmarkButtonCellTest, Awake) { 118 TEST_F(BookmarkButtonCellTest, Awake) {
119 scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc] init]); 119 scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc] init]);
120 [cell awakeFromNib]; 120 [cell awakeFromNib];
121 EXPECT_EQ(NSLeftTextAlignment, [cell alignment]); 121 EXPECT_EQ(NSLeftTextAlignment, [cell alignment]);
122 } 122 }
123 123
124 // Subfolder arrow details.
125 TEST_F(BookmarkButtonCellTest, FolderArrow) {
126 BookmarkModel* model = helper_.profile()->GetBookmarkModel();
127 const BookmarkNode* bar = model->GetBookmarkBarNode();
128 const BookmarkNode* node = model->AddURL(bar, bar->GetChildCount(), L"title",
129 GURL("http://www.google.com"));
130 scoped_nsobject<BookmarkButtonCell> cell(
131 [[BookmarkButtonCell alloc] initForNode:node
132 contextMenu:nil
133 cellText:@"small"
134 cellImage:nil]);
135 EXPECT_TRUE(cell.get());
136
137 NSSize size = [cell cellSize];
138 // sanity check
139 EXPECT_GE(size.width, 2);
140 EXPECT_GE(size.height, 2);
141
142 // Once we turn on arrow drawing make sure there is now room for it.
143 [cell setDrawFolderArrow:YES];
144 NSSize arrowSize = [cell cellSize];
145 EXPECT_GT(arrowSize.width, size.width);
146 }
147
124 } // namespace 148 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_button_cell.mm ('k') | chrome/chrome_dll.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698