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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp

Issue 1615923004: Add FontCache API for retrieving prioritized fallback fonts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp b/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
index c97c74561cf132ac33cc553a3cb8dab64b713050..0de438dc108fb2e151d3977a8e2ad23db94e7e22 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
@@ -35,4 +35,27 @@ TEST(FontCache, getLastResortFallbackFont)
EXPECT_TRUE(fontData);
}
+TEST(FontCache, availablePriorityFallbackFonts)
wkorman 2016/01/25 23:38:16 Tests with invalid and text?
drott 2016/02/02 17:28:28 ...however I did not manage to get them to work re
+{
+ FontCache* fontCache = FontCache::fontCache();
+ ASSERT_TRUE(fontCache);
+
+ EmptyPlatform platform;
+
+ FontDescription fontDescription;
+ fontDescription.setGenericFamily(FontDescription::StandardFamily);
+
+ for (FontFallbackPriority fallbackPriority :
+ { FontFallbackPriority::Symbols,
+ FontFallbackPriority::Math,
+ FontFallbackPriority::EmojiText,
+ FontFallbackPriority::EmojiEmoji }) {
+
+ const Vector<AtomicString> availableFallbackPriorityFonts =
+ fontCache->fontListForFallbackPriority(fontDescription,
+ fallbackPriority);
+ EXPECT_GE(availableFallbackPriorityFonts.size(), 1u);
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698