#include "testing/xfa_test_environment.h"
#include "core/fxcrt/check.h"
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/systemfontinfo_iface.h"
#include "xfa/fgas/font/cfgas_gemodule.h"
namespace {
XFATestEnvironment* g_env = nullptr;
}
XFATestEnvironment::XFATestEnvironment() {
DCHECK(!g_env);
g_env = this;
}
XFATestEnvironment::~XFATestEnvironment() {
DCHECK(g_env);
g_env = nullptr;
}
void XFATestEnvironment::SetUp() {
CFX_GEModule::Get()->GetFontMgr()->GetBuiltinMapper()->SetSystemFontInfo(
CFX_GEModule::Get()->GetPlatform()->CreateDefaultSystemFontInfo());
CFGAS_GEModule::Create();
}
void XFATestEnvironment::TearDown() {
CFGAS_GEModule::Destroy();
}