OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |