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

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: Documenting public method 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..5c8c5079bb75128320e8a7dd042fb4f9a3759faf 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
@@ -35,4 +35,53 @@ TEST(FontCache, getLastResortFallbackFont)
EXPECT_TRUE(fontData);
}
+class FontCacheAvailabilityTest : public ::testing::Test {
+protected:
+ void SetUp() override
+ {
+ m_fontCache = FontCache::fontCache();
+ ASSERT_TRUE(m_fontCache);
+ m_fontDescription.setGenericFamily(FontDescription::StandardFamily);
+ }
+
+ void TearDown() override
+ {
+ EXPECT_TRUE(m_availableFonts);
+ EXPECT_GE(m_availableFonts->size(), 1u);
+ }
+
+ FontCache* m_fontCache;
+ EmptyPlatform m_emptyPlatform;
+ FontDescription m_fontDescription;
+ const Vector<AtomicString>* m_availableFonts;
+};
+
+TEST_F(FontCacheAvailabilityTest, availableSymbolsFonts)
+{
+ m_availableFonts = m_fontCache->fontListForFallbackPriority(
+ m_fontDescription,
+ FontFallbackPriority::Symbols);
+}
+
+TEST_F(FontCacheAvailabilityTest, availableMathFonts)
+{
+ m_availableFonts = m_fontCache->fontListForFallbackPriority(
+ m_fontDescription,
+ FontFallbackPriority::Math);
+}
+
+TEST_F(FontCacheAvailabilityTest, availableEmojiTextFonts)
+{
+ m_availableFonts = m_fontCache->fontListForFallbackPriority(
+ m_fontDescription,
+ FontFallbackPriority::EmojiText);
+}
+
+TEST_F(FontCacheAvailabilityTest, availableEmojiEmojiFonts)
+{
+ m_availableFonts = m_fontCache->fontListForFallbackPriority(
+ m_fontDescription,
+ FontFallbackPriority::EmojiEmoji);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontCache.cpp ('k') | third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698