Flutter Engine
The Flutter Engine
Classes | Functions
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 33 of file font_collection_tests.cc.

33 {
34 FontCollection font_collection;
36 font_collection.CreateSktFontCollection();
37 ASSERT_EQ(sk_font_collection->getFallbackManager().get(), nullptr);
38 font_collection.SetupDefaultFontManager(0);
39 sk_font_collection = font_collection.CreateSktFontCollection();
40 ASSERT_NE(sk_font_collection->getFallbackManager().get(), nullptr);
41}
void SetupDefaultFontManager(uint32_t font_initialization_data)
T * get() const
Definition: SkRefCnt.h:303
sk_sp< SkFontMgr > getFallbackManager() const

◆ 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}
virtual int count()=0
TypefaceFontAssetProvider & font_provider() const
sk_sp< SkFontStyleSet > MatchFamily(const std::string &family_name) override
void RegisterSystemFonts(const DynamicFontManager &dynamic_font_manager)
Definition: platform_mac.mm:83