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

Unified Diff: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp

Issue 2288383002: Disable CJK specific generic font families for monospace on Android (Closed)
Patch Set: drott review, updated comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp
index 37c9e89075b19ee7efee48545ae59d809a8579f4..616e5a96fddc8984a8e92b95249f0874f33fa3ab 100644
--- a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp
@@ -26,4 +26,27 @@ TEST(FontCacheAndroid, fallbackFontForCharacter)
EXPECT_TRUE(fontData);
}
+TEST(FontCacheAndroid, genericFamilyNameForScript)
+{
+ FontDescription english;
+ english.setLocale(LayoutLocale::get("en"));
+ FontDescription chinese;
+ chinese.setLocale(LayoutLocale::get("zh"));
+
+ if (FontFamilyNames::webkit_standard.isEmpty())
+ FontFamilyNames::init();
+
+ // For non-CJK, getGenericFamilyNameForScript should return the given familyName.
+ EXPECT_EQ(FontFamilyNames::webkit_standard, FontCache::getGenericFamilyNameForScript(
+ FontFamilyNames::webkit_standard, english));
+ EXPECT_EQ(FontFamilyNames::webkit_monospace, FontCache::getGenericFamilyNameForScript(
+ FontFamilyNames::webkit_monospace, english));
+
+ // For CJK, getGenericFamilyNameForScript should return CJK fonts except monospace.
+ EXPECT_NE(FontFamilyNames::webkit_standard, FontCache::getGenericFamilyNameForScript(
+ FontFamilyNames::webkit_standard, chinese));
+ EXPECT_EQ(FontFamilyNames::webkit_monospace, FontCache::getGenericFamilyNameForScript(
+ FontFamilyNames::webkit_monospace, chinese));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698