Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
xfa_test_environment.cpp
Go to the documentation of this file.
1
// Copyright 2019 The PDFium Authors
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
"testing/xfa_test_environment.h"
6
7
#
include
"core/fxge/cfx_fontmgr.h"
8
#
include
"core/fxge/cfx_gemodule.h"
9
#
include
"core/fxge/systemfontinfo_iface.h"
10
#
include
"third_party/base/check.h"
11
#
include
"xfa/fgas/font/cfgas_gemodule.h"
12
13
namespace
{
14
15
XFATestEnvironment
* g_env =
nullptr
;
16
17
}
// namespace
18
19
XFATestEnvironment
::
XFATestEnvironment
() {
20
DCHECK(!g_env);
21
g_env =
this
;
22
}
23
24
XFATestEnvironment
::~
XFATestEnvironment
() {
25
DCHECK(g_env);
26
g_env =
nullptr
;
27
}
28
29
void
XFATestEnvironment
::
SetUp
() {
30
CFX_GEModule
::
Get
(
)
->
GetFontMgr
(
)
->
GetBuiltinMapper
(
)
->SetSystemFontInfo(
31
CFX_GEModule
::
Get
(
)
->
GetPlatform
(
)
->CreateDefaultSystemFontInfo());
32
33
// The font loading that takes place in CFGAS_GEModule::Create() is slow,
34
// but we do it only once per binary execution, not once per test.
35
CFGAS_GEModule
::
Create
(
)
;
36
}
37
38
void
XFATestEnvironment
::
TearDown
() {
39
CFGAS_GEModule
::
Destroy
(
)
;
40
}
CFGAS_GEModule
Definition
cfgas_gemodule.h:12
CFGAS_GEModule::Destroy
static void Destroy()
Definition
cfgas_gemodule.cpp:24
CFGAS_GEModule::Create
static void Create()
Definition
cfgas_gemodule.cpp:17
CFX_FontMgr::GetBuiltinMapper
CFX_FontMapper * GetBuiltinMapper() const
Definition
cfx_fontmgr.h:71
CFX_GEModule
Definition
cfx_gemodule.h:25
CFX_GEModule::GetPlatform
PlatformIface * GetPlatform() const
Definition
cfx_gemodule.h:46
CFX_GEModule::Get
static CFX_GEModule * Get()
Definition
cfx_gemodule.cpp:45
CFX_GEModule::GetFontMgr
CFX_FontMgr * GetFontMgr() const
Definition
cfx_gemodule.h:45
XFATestEnvironment
Definition
xfa_test_environment.h:14
XFATestEnvironment::SetUp
void SetUp() override
Definition
xfa_test_environment.cpp:29
XFATestEnvironment::XFATestEnvironment
XFATestEnvironment()
Definition
xfa_test_environment.cpp:19
XFATestEnvironment::TearDown
void TearDown() override
Definition
xfa_test_environment.cpp:38
XFATestEnvironment::~XFATestEnvironment
~XFATestEnvironment()
Definition
xfa_test_environment.cpp:24
qtwebengine
src
3rdparty
chromium
third_party
pdfium
testing
xfa_test_environment.cpp
Generated on Thu Nov 14 2024 01:03:52 for Qt by
1.12.0