summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffapp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/cxfa_ffapp.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffapp.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp
index 4cb9deb466..cdbc6461b5 100644
--- a/xfa/fxfa/cxfa_ffapp.cpp
+++ b/xfa/fxfa/cxfa_ffapp.cpp
@@ -22,6 +22,17 @@
#include "xfa/fxfa/cxfa_fwladapterwidgetmgr.h"
#include "xfa/fxfa/cxfa_fwltheme.h"
+namespace {
+
+static bool kSkipFontLoadForTesting = false;
+
+} // namespace
+
+// static
+void CXFA_FFApp::SkipFontLoadForTesting(bool skip) {
+ kSkipFontLoadForTesting = skip;
+}
+
CXFA_FFApp::CXFA_FFApp(IXFA_AppProvider* pProvider) : m_pProvider(pProvider) {
// Ensure fully initialized before making an app based on |this|.
m_pFWLApp = pdfium::MakeUnique<CFWL_App>(this);
@@ -56,8 +67,10 @@ CXFA_FontMgr* CXFA_FFApp::GetXFAFontMgr() const {
CFGAS_FontMgr* CXFA_FFApp::GetFDEFontMgr() {
if (!m_pFDEFontMgr) {
m_pFDEFontMgr = pdfium::MakeUnique<CFGAS_FontMgr>();
- if (!m_pFDEFontMgr->EnumFonts())
- m_pFDEFontMgr = nullptr;
+ if (!kSkipFontLoadForTesting) {
+ if (!m_pFDEFontMgr->EnumFonts())
+ m_pFDEFontMgr = nullptr;
+ }
}
return m_pFDEFontMgr.get();
}