Flutter Engine
The Flutter Engine
platform_mac_tests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "gtest/gtest.h"
6
7#include <sstream>
8
9#include "txt/platform_mac.h"
10
11namespace txt {
12namespace testing {
13
14class PlatformMacTests : public ::testing::Test {
15 public:
17
18 void SetUp() override {}
19};
20
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}
33
34} // namespace testing
35} // namespace txt
virtual int count()=0
TypefaceFontAssetProvider & font_provider() const
sk_sp< SkFontStyleSet > MatchFamily(const std::string &family_name) override
TEST_F(FontCollectionTests, SettingUpDefaultFontManagerClearsCache)
void RegisterSystemFonts(const DynamicFontManager &dynamic_font_manager)
Definition: platform_mac.mm:83