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

Side by Side Diff: ui/gfx/platform_font_mac_unittest.mm

Issue 1133713009: Subject .mm files to the header sorting presubmit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase - of course... it would be one of my patches I conflict with :| Created 5 years, 7 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/gfx/ios/NSString+CrStringDrawing_unittest.mm ('k') | ui/native_theme/native_theme_mac.mm » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <Cocoa/Cocoa.h> 5 #include <Cocoa/Cocoa.h>
6 6
7 #include "testing/gtest/include/gtest/gtest.h"
7 #include "ui/gfx/font.h" 8 #include "ui/gfx/font.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 TEST(PlatformFontMacTest, DeriveFont) { 10 TEST(PlatformFontMacTest, DeriveFont) {
11 // Use a base font that support all traits. 11 // Use a base font that support all traits.
12 gfx::Font base_font("Helvetica", 13); 12 gfx::Font base_font("Helvetica", 13);
13 13
14 // Bold 14 // Bold
15 gfx::Font bold_font(base_font.Derive(0, gfx::Font::BOLD)); 15 gfx::Font bold_font(base_font.Derive(0, gfx::Font::BOLD));
16 NSFontTraitMask traits = [[NSFontManager sharedFontManager] 16 NSFontTraitMask traits = [[NSFontManager sharedFontManager]
17 traitsOfFont:bold_font.GetNativeFont()]; 17 traitsOfFont:bold_font.GetNativeFont()];
18 EXPECT_EQ(NSBoldFontMask, traits); 18 EXPECT_EQ(NSBoldFontMask, traits);
(...skipping 28 matching lines...) Expand all
47 EXPECT_EQ(14, italic_font.GetFontSize()); 47 EXPECT_EQ(14, italic_font.GetFontSize());
48 EXPECT_EQ("Helvetica", italic_font.GetFontName()); 48 EXPECT_EQ("Helvetica", italic_font.GetFontName());
49 EXPECT_EQ(gfx::Font::ITALIC, italic_font.GetStyle()); 49 EXPECT_EQ(gfx::Font::ITALIC, italic_font.GetStyle());
50 50
51 gfx::Font bold_italic_font( 51 gfx::Font bold_italic_font(
52 [NSFont fontWithName:@"Helvetica-BoldOblique" size:14]); 52 [NSFont fontWithName:@"Helvetica-BoldOblique" size:14]);
53 EXPECT_EQ(14, bold_italic_font.GetFontSize()); 53 EXPECT_EQ(14, bold_italic_font.GetFontSize());
54 EXPECT_EQ("Helvetica", bold_italic_font.GetFontName()); 54 EXPECT_EQ("Helvetica", bold_italic_font.GetFontName());
55 EXPECT_EQ(gfx::Font::BOLD | gfx::Font::ITALIC, bold_italic_font.GetStyle()); 55 EXPECT_EQ(gfx::Font::BOLD | gfx::Font::ITALIC, bold_italic_font.GetStyle());
56 } 56 }
OLDNEW
« no previous file with comments | « ui/gfx/ios/NSString+CrStringDrawing_unittest.mm ('k') | ui/native_theme/native_theme_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698