Check EnumFonts() is fine in XFATestEnvironment::SetUp(). One less path for the test harness to silently take and perhaps produce different results. Change-Id: I46e228fbecf981e873a204e45e65d452b707c9ec Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/73312 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/xfa_test_environment.cpp b/testing/xfa_test_environment.cpp index 0fdab8d..b62faeb 100644 --- a/testing/xfa_test_environment.cpp +++ b/testing/xfa_test_environment.cpp
@@ -11,6 +11,7 @@ #include "core/fxge/cfx_gemodule.h" #include "core/fxge/systemfontinfo_iface.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/base/logging.h" #include "xfa/fgas/font/cfgas_fontmgr.h" namespace { @@ -35,9 +36,8 @@ CFX_GEModule::Get()->GetFontMgr()->SetSystemFontInfo( CFX_GEModule::Get()->GetPlatform()->CreateDefaultSystemFontInfo()); - auto font_mgr = std::make_unique<CFGAS_FontMgr>(); - if (font_mgr->EnumFonts()) - font_mgr_ = std::move(font_mgr); + font_mgr_ = std::make_unique<CFGAS_FontMgr>(); + CHECK(font_mgr_->EnumFonts()); } void XFATestEnvironment::TearDown() {