Index: ui/gfx/font_unittest.cc |
diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc |
index 2fe61939d14bf6e9f7d8e60583a7b38a3e410c40..2fdaab872f4ce758a293e09ba8e1fabd2ee209d3 100644 |
--- a/ui/gfx/font_unittest.cc |
+++ b/ui/gfx/font_unittest.cc |
@@ -5,6 +5,7 @@ |
#include "ui/gfx/font.h" |
#include "base/strings/string16.h" |
+#include "base/strings/string_util.h" |
#include "base/strings/utf_string_conversions.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -63,6 +64,7 @@ TEST_F(FontTest, LoadArial) { |
EXPECT_EQ(cf.GetStyle(), Font::NORMAL); |
EXPECT_EQ(cf.GetFontSize(), 16); |
EXPECT_EQ(cf.GetFontName(), "Arial"); |
+ EXPECT_EQ("arial", StringToLowerASCII(cf.GetActualFontNameForTesting())); |
FreeIfNecessary(native); |
} |
@@ -72,6 +74,7 @@ TEST_F(FontTest, LoadArialBold) { |
NativeFont native = bold.GetNativeFont(); |
EXPECT_TRUE(native); |
EXPECT_EQ(bold.GetStyle(), Font::BOLD); |
+ EXPECT_EQ("arial", StringToLowerASCII(cf.GetActualFontNameForTesting())); |
FreeIfNecessary(native); |
} |
@@ -123,6 +126,22 @@ TEST_F(FontTest, Widths) { |
cf.GetStringWidth(ASCIIToUTF16("ab"))); |
} |
+#if !defined(OS_WIN) |
+// On Windows, Font::GetActualFontNameForTesting() doesn't work well for now. |
+// http://crbug.com/327287 |
+TEST_F(FontTest, GetActualFontNameForTesting) { |
+ Font arial("Arial", 16); |
+ EXPECT_EQ("arial", StringToLowerASCII(arial.GetActualFontNameForTesting())); |
+ Font symbol("Symbol", 16); |
+ EXPECT_EQ("symbol", StringToLowerASCII(symbol.GetActualFontNameForTesting())); |
+ |
+ const char* const invalid_font_name = "no_such_font_name"; |
+ Font fallback_font(invalid_font_name, 16); |
+ EXPECT_NE(invalid_font_name, |
+ StringToLowerASCII(fallback_font.GetActualFontNameForTesting())); |
+} |
+#endif |
+ |
#if defined(OS_WIN) |
TEST_F(FontTest, DeriveFontResizesIfSizeTooSmall) { |
Font cf("Arial", 8); |