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

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

Issue 1299713004: Reland #2: Add a short term solution to fix OSX 10.11 system font rendering problems. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase against top of tree. 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/VersionUtilMac.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 2015 The Chromium Authors. All rights reserved. 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 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 "config.h" 5 #import "config.h"
6 #import "platform/fonts/mac/FontFamilyMatcherMac.h" 6 #import "platform/fonts/mac/FontFamilyMatcherMac.h"
7 7
8 #include <AppKit/AppKit.h> 8 #include <AppKit/AppKit.h>
9 #include <gtest/gtest.h> 9 #include <gtest/gtest.h>
10 10
11 #import "platform/mac/VersionUtilMac.h" 11 #import "platform/mac/VersionUtilMac.h"
12 12
13 @interface NSString (YosemiteAdditions) 13 @interface NSString (YosemiteAdditions)
14 - (BOOL)containsString:(NSString*)string; 14 - (BOOL)containsString:(NSString*)string;
15 @end 15 @end
16 16
17 namespace blink { 17 namespace blink {
18 18
19 void TestSystemFontContainsString(FontWeight desiredWeight, NSString* substring) 19 void TestSystemFontContainsString(FontWeight desiredWeight, NSString* substring)
20 { 20 {
21 NSFont* font = MatchNSFontFamily(@"BlinkMacSystemFont", 0, desiredWeight, 11 ); 21 NSFont* font = MatchNSFontFamily(@"BlinkMacSystemFont", 0, desiredWeight, 11 );
22 EXPECT_TRUE([font.description containsString:substring]); 22 EXPECT_TRUE([font.description containsString:substring]);
23 } 23 }
24 24
25 TEST(FontFamilyMatcherMacTest, YosemiteFontWeights) 25 TEST(FontFamilyMatcherMacTest, YosemiteFontWeights)
26 { 26 {
27 if (IsOSMavericksOrEarlier()) 27 if (!IsOSYosemite())
28 return; 28 return;
29 29
30 TestSystemFontContainsString(FontWeight100, @"-UltraLight"); 30 TestSystemFontContainsString(FontWeight100, @"-UltraLight");
31 TestSystemFontContainsString(FontWeight200, @"-Thin"); 31 TestSystemFontContainsString(FontWeight200, @"-Thin");
32 TestSystemFontContainsString(FontWeight300, @"-Light"); 32 TestSystemFontContainsString(FontWeight300, @"-Light");
33 TestSystemFontContainsString(FontWeight400, @"-Regular"); 33 TestSystemFontContainsString(FontWeight400, @"-Regular");
34 TestSystemFontContainsString(FontWeight500, @"-Medium"); 34 TestSystemFontContainsString(FontWeight500, @"-Medium");
35 TestSystemFontContainsString(FontWeight600, @"-Bold"); 35 TestSystemFontContainsString(FontWeight600, @"-Bold");
36 TestSystemFontContainsString(FontWeight700, @"-Bold"); 36 TestSystemFontContainsString(FontWeight700, @"-Bold");
37 TestSystemFontContainsString(FontWeight800, @"-Heavy"); 37 TestSystemFontContainsString(FontWeight800, @"-Heavy");
38 TestSystemFontContainsString(FontWeight900, @"-Heavy"); 38 TestSystemFontContainsString(FontWeight900, @"-Heavy");
39 } 39 }
40 40
41 } // namespace blink 41 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/mac/FontFamilyMatcherMac.mm ('k') | Source/platform/mac/VersionUtilMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698