diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-08-28 10:11:24 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-28 15:07:01 +0000 |
commit | 574d4408a5174bb410cf4ec3db24283671bcce79 (patch) | |
tree | 907e53814373e98780de4eabeb55ca48f8669a29 /xfa/fgas/layout/cfx_rtfbreak_unittest.cpp | |
parent | 133617c2d2b941e239e9234b1a4e9dc7476a2fa5 (diff) | |
download | pdfium-574d4408a5174bb410cf4ec3db24283671bcce79.tar.xz |
Add a global font loader in XFA tests
This CL creates a global font loader for use in XFA tests. This is
needed because the CFGAS_FontMangaer takes a linearly increasing amount
of time to load fonts each time it's loaded. This can get excessively
slow for test suites which run a lot of tests.
Change-Id: Ie389844b56598ce414f4f761654fa4ed465955fd
Reviewed-on: https://pdfium-review.googlesource.com/12090
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/cfx_rtfbreak_unittest.cpp')
-rw-r--r-- | xfa/fgas/layout/cfx_rtfbreak_unittest.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp b/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp index cef215fe2a..8997edc083 100644 --- a/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp +++ b/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp @@ -18,17 +18,8 @@ class CFX_RTFBreakTest : public testing::Test { public: void SetUp() override { - CFX_GEModule::Get()->GetFontMgr()->SetSystemFontInfo( - IFX_SystemFontInfo::CreateDefault(nullptr)); - -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - font_mgr_ = CFGAS_FontMgr::Create(FX_GetDefFontEnumerator()); -#else - font_source_ = pdfium::MakeUnique<CFX_FontSourceEnum_File>(); - font_mgr_ = CFGAS_FontMgr::Create(font_source_.get()); -#endif - - font_ = CFGAS_GEFont::LoadFont(L"Arial Black", 0, 0, font_mgr_.get()); + font_ = + CFGAS_GEFont::LoadFont(L"Arial Black", 0, 0, GetGlobalFontManager()); ASSERT(font_.Get() != nullptr); } @@ -39,12 +30,7 @@ class CFX_RTFBreakTest : public testing::Test { } private: - std::unique_ptr<CFGAS_FontMgr> font_mgr_; CFX_RetainPtr<CFGAS_GEFont> font_; - -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ - std::unique_ptr<CFX_FontSourceEnum_File> font_source_; -#endif }; // As soon as you get one of the control characters the break is complete |