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

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

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 6 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/app_list/views/search_result_view.cc ('k') | ui/base/resource/resource_bundle.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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 274 const gfx::FontList& bold =
275 ResourceBundle::GetSharedInstance().GetFontListWithDelta(0, 275 ResourceBundle::GetSharedInstance().GetFontListWithDelta(
276 gfx::Font::BOLD); 276 0, gfx::Font::NORMAL, gfx::Font::Weight::BOLD);
277 FontListMenuModel model(&delegate, &bold, 0); 277 FontListMenuModel model(&delegate, &bold, 0);
278 model.AddItem(1, ASCIIToUTF16("one")); 278 model.AddItem(1, ASCIIToUTF16("one"));
279 model.AddItem(2, ASCIIToUTF16("two")); 279 model.AddItem(2, ASCIIToUTF16("two"));
280 280
281 base::scoped_nsobject<MenuController> menu( 281 base::scoped_nsobject<MenuController> menu(
282 [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); 282 [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]);
283 EXPECT_EQ([[menu menu] numberOfItems], 2); 283 EXPECT_EQ([[menu menu] numberOfItems], 2);
284 284
285 Validate(menu.get(), [menu menu]); 285 Validate(menu.get(), [menu menu]);
286 286
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // Pump the task that notifies the delegate. 392 // Pump the task that notifies the delegate.
393 message_loop.RunUntilIdle(); 393 message_loop.RunUntilIdle();
394 394
395 // Expect that the delegate got notified properly. 395 // Expect that the delegate got notified properly.
396 EXPECT_TRUE(delegate.did_close_); 396 EXPECT_TRUE(delegate.did_close_);
397 } 397 }
398 398
399 } // namespace 399 } // namespace
400 400
401 } // namespace ui 401 } // namespace ui
OLDNEW
« no previous file with comments | « ui/app_list/views/search_result_view.cc ('k') | ui/base/resource/resource_bundle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698