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

Side by Side Diff: Source/platform/fonts/mac/FontFamilyMatcherMacTest.mm

Issue 1292593003: Revert "Revert "Reland 2: mac: Use a placeholder string for the family name of the system font." Br… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « Source/platform/fonts/mac/FontFamilyMatcherMac.mm ('k') | Source/platform/mac/ThemeMac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "config.h"
6 #import "platform/fonts/mac/FontFamilyMatcherMac.h"
7
8 #include <AppKit/AppKit.h>
9 #include <gtest/gtest.h>
10
11 #import "platform/mac/VersionUtilMac.h"
12
13 @interface NSString (YosemiteAdditions)
14 - (BOOL)containsString:(NSString*)string;
15 @end
16
17 namespace blink {
18
19 void TestSystemFontContainsString(FontWeight desiredWeight, NSString* substring)
20 {
21 NSFont* font = MatchNSFontFamily(@"BlinkMacSystemFont", 0, desiredWeight, 11 );
22 EXPECT_TRUE([font.description containsString:substring]);
23 }
24
25 TEST(FontFamilyMatcherMacTest, YosemiteFontWeights)
26 {
27 if (IsOSMavericksOrEarlier())
28 return;
29
30 TestSystemFontContainsString(FontWeight100, @"-UltraLight");
31 TestSystemFontContainsString(FontWeight200, @"-Thin");
32 TestSystemFontContainsString(FontWeight300, @"-Light");
33 TestSystemFontContainsString(FontWeight400, @"-Regular");
34 TestSystemFontContainsString(FontWeight500, @"-Medium");
35 TestSystemFontContainsString(FontWeight600, @"-Bold");
36 TestSystemFontContainsString(FontWeight700, @"-Bold");
37 TestSystemFontContainsString(FontWeight800, @"-Heavy");
38 TestSystemFontContainsString(FontWeight900, @"-Heavy");
39 }
40
41 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/mac/FontFamilyMatcherMac.mm ('k') | Source/platform/mac/ThemeMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698