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

Side by Side Diff: ui/base/cocoa/menu_controller_unittest.mm

Issue 1689623004: Start removing enum ui::ResourceBundle::FontStyle, fix MacViews font sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix transcription error Created 4 years, 10 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
« no previous file with comments | « ui/base/cocoa/controls/blue_label_button.mm ('k') | ui/base/default_style.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 base::scoped_nsobject<MenuController> menu( 264 base::scoped_nsobject<MenuController> menu(
265 [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); 265 [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]);
266 EXPECT_EQ([[menu menu] numberOfItems], 3); 266 EXPECT_EQ([[menu menu] numberOfItems], 3);
267 267
268 Validate(menu.get(), [menu menu]); 268 Validate(menu.get(), [menu menu]);
269 } 269 }
270 270
271 // Tests that items which have a font set actually use that font. 271 // Tests that items which have a font set actually use that font.
272 TEST_F(MenuControllerTest, LabelFontList) { 272 TEST_F(MenuControllerTest, LabelFontList) {
273 Delegate delegate; 273 Delegate delegate;
274 const gfx::FontList& bold = ResourceBundle::GetSharedInstance().GetFontList( 274 const gfx::FontList& bold =
275 ResourceBundle::BoldFont); 275 ResourceBundle::GetSharedInstance().GetFontListWithDelta(0,
276 gfx::Font::BOLD);
276 FontListMenuModel model(&delegate, &bold, 0); 277 FontListMenuModel model(&delegate, &bold, 0);
277 model.AddItem(1, ASCIIToUTF16("one")); 278 model.AddItem(1, ASCIIToUTF16("one"));
278 model.AddItem(2, ASCIIToUTF16("two")); 279 model.AddItem(2, ASCIIToUTF16("two"));
279 280
280 base::scoped_nsobject<MenuController> menu( 281 base::scoped_nsobject<MenuController> menu(
281 [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); 282 [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]);
282 EXPECT_EQ([[menu menu] numberOfItems], 2); 283 EXPECT_EQ([[menu menu] numberOfItems], 2);
283 284
284 Validate(menu.get(), [menu menu]); 285 Validate(menu.get(), [menu menu]);
285 286
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // Pump the task that notifies the delegate. 392 // Pump the task that notifies the delegate.
392 message_loop.RunUntilIdle(); 393 message_loop.RunUntilIdle();
393 394
394 // Expect that the delegate got notified properly. 395 // Expect that the delegate got notified properly.
395 EXPECT_TRUE(delegate.did_close_); 396 EXPECT_TRUE(delegate.did_close_);
396 } 397 }
397 398
398 } // namespace 399 } // namespace
399 400
400 } // namespace ui 401 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cocoa/controls/blue_label_button.mm ('k') | ui/base/default_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698