OLD | NEW |
(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 |
OLD | NEW |