Flutter Engine
 
Loading...
Searching...
No Matches
txt::testing Namespace Reference

Classes

class  FontCollectionTests
 
class  PlatformMacTests
 

Functions

 TEST_F (FontCollectionTests, SettingUpDefaultFontManagerClearsCache)
 
 TEST_F (PlatformMacTests, RegisterSystemFonts)
 

Function Documentation

◆ TEST_F() [1/2]

txt::testing::TEST_F ( FontCollectionTests  ,
SettingUpDefaultFontManagerClearsCache   
)

Definition at line 21 of file font_collection_tests.cc.

21 {
22 FontCollection font_collection;
23 sk_sp<skia::textlayout::FontCollection> sk_font_collection =
24 font_collection.CreateSktFontCollection();
25 ASSERT_EQ(sk_font_collection->getFallbackManager().get(), nullptr);
26 font_collection.SetupDefaultFontManager(0);
27 sk_font_collection = font_collection.CreateSktFontCollection();
28 ASSERT_NE(sk_font_collection->getFallbackManager().get(), nullptr);
29}
void SetupDefaultFontManager(uint32_t font_initialization_data)

References flutter::FontCollection::SetupDefaultFontManager().

◆ TEST_F() [2/2]

txt::testing::TEST_F ( PlatformMacTests  ,
RegisterSystemFonts   
)

Definition at line 21 of file platform_mac_tests.cc.

21 {
22 DynamicFontManager dynamic_font_manager;
23 RegisterSystemFonts(dynamic_font_manager);
24 ASSERT_EQ(dynamic_font_manager.font_provider().GetFamilyCount(), 1ul);
25 ASSERT_NE(dynamic_font_manager.font_provider().MatchFamily(
26 "CupertinoSystemDisplay"),
27 nullptr);
28 ASSERT_EQ(dynamic_font_manager.font_provider()
29 .MatchFamily("CupertinoSystemDisplay")
30 ->count(),
31 10);
32}
TypefaceFontAssetProvider & font_provider() const
sk_sp< SkFontStyleSet > MatchFamily(const std::string &family_name) override
void RegisterSystemFonts(const DynamicFontManager &dynamic_font_manager)

References txt::DynamicFontManager::font_provider(), txt::TypefaceFontAssetProvider::GetFamilyCount(), txt::TypefaceFontAssetProvider::MatchFamily(), and txt::RegisterSystemFonts().