Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
v8_test_environment.h
Go to the documentation of this file.
1
// Copyright 2020 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
#
ifndef
TESTING_V8_TEST_ENVIRONMENT_H_
6
#
define
TESTING_V8_TEST_ENVIRONMENT_H_
7
8
#
ifndef
PDF_ENABLE_V8
9
#
error
"V8 must be enabled"
10
#
endif
// PDF_ENABLE_V8
11
12
#
include
<
memory
>
13
14
#
include
"fxjs/cfx_v8.h"
15
#
include
"fxjs/cfx_v8_array_buffer_allocator.h"
16
#
include
"testing/gtest/include/gtest/gtest.h"
17
18
namespace
v8
{
19
class
Isolate;
20
class
Platform;
21
class
StartupData;
22
}
// namespace v8
23
24
class
TestLoader
;
25
26
class
V8TestEnvironment
:
public
testing
::
Environment
{
27
public
:
28
explicit
V8TestEnvironment
(
const
char
* exe_path);
29
~
V8TestEnvironment
()
override
;
30
31
// Note: GetInstance() does not create one if it does not exist,
32
// so the main program must explicitly add this enviroment.
33
static
V8TestEnvironment
*
GetInstance
();
34
static
void
PumpPlatformMessageLoop
(
v8
::Isolate* pIsolate);
35
36
// testing::Environment:
37
void
SetUp
()
override
;
38
void
TearDown
()
override
;
39
40
v8
::Platform*
platform
()
const
{
return
platform_.get(); }
41
v8
::Isolate*
isolate
()
const
{
return
isolate_.get(); }
42
43
private
:
44
const
char
*
const
exe_path_;
45
std::unique_ptr<v8::StartupData> startup_data_;
46
std::unique_ptr<v8::Platform> platform_;
47
std::unique_ptr<CFX_V8ArrayBufferAllocator> array_buffer_allocator_;
48
std
::unique_ptr<
v8
::Isolate,
CFX_V8IsolateDeleter
> isolate_;
49
};
50
51
#
endif
// TESTING_V8_TEST_ENVIRONMENT_H_
FXGCUnitTest
Definition
fxgc_unittest.h:11
FXGCUnitTest::heap
cppgc::Heap * heap() const
Definition
fxgc_unittest.h:20
FXGCUnitTest::Pump
void Pump()
Definition
fxgc_unittest.cpp:36
FXGCUnitTest::SetUp
void SetUp() override
Definition
fxgc_unittest.cpp:16
FXGCUnitTest::ForceGCAndPump
void ForceGCAndPump()
Definition
fxgc_unittest.cpp:31
FXGCUnitTest::TearDown
void TearDown() override
Definition
fxgc_unittest.cpp:24
FXGCUnitTest::~FXGCUnitTest
~FXGCUnitTest() override
FXGCUnitTest::FXGCUnitTest
FXGCUnitTest()
GCedTreeNodeMixinUnitTest
Definition
gced_tree_node_mixin_unittest.cpp:37
GCedTreeNodeMixinUnitTest::GCedTreeNodeMixinUnitTest
GCedTreeNodeMixinUnitTest()=default
GCedTreeNodeMixinUnitTest::AddClutterToBack
void AddClutterToBack(ObservableGCedTreeNodeMixinForTest *parent)
Definition
gced_tree_node_mixin_unittest.cpp:64
GCedTreeNodeMixinUnitTest::TearDown
void TearDown() override
Definition
gced_tree_node_mixin_unittest.cpp:43
GCedTreeNodeMixinUnitTest::~GCedTreeNodeMixinUnitTest
~GCedTreeNodeMixinUnitTest() override=default
GCedTreeNodeMixinUnitTest::root
ObservableGCedTreeNodeMixinForTest * root() const
Definition
gced_tree_node_mixin_unittest.cpp:48
GCedTreeNodeMixinUnitTest::CreateNode
ObservableGCedTreeNodeMixinForTest * CreateNode()
Definition
gced_tree_node_mixin_unittest.cpp:51
GCedTreeNodeMixinUnitTest::CreateRoot
void CreateRoot()
Definition
gced_tree_node_mixin_unittest.cpp:49
GCedTreeNodeMixinUnitTest::AddClutterToFront
void AddClutterToFront(ObservableGCedTreeNodeMixinForTest *parent)
Definition
gced_tree_node_mixin_unittest.cpp:56
TestLoader
Definition
test_loader.h:13
V8TestEnvironment
Definition
v8_test_environment.h:26
V8TestEnvironment::platform
v8::Platform * platform() const
Definition
v8_test_environment.h:40
V8TestEnvironment::isolate
v8::Isolate * isolate() const
Definition
v8_test_environment.h:41
V8TestEnvironment::V8TestEnvironment
V8TestEnvironment(const char *exe_path)
Definition
v8_test_environment.cpp:24
V8TestEnvironment::~V8TestEnvironment
~V8TestEnvironment() override
Definition
v8_test_environment.cpp:31
V8TestEnvironment::SetUp
void SetUp() override
Definition
v8_test_environment.cpp:54
V8TestEnvironment::PumpPlatformMessageLoop
static void PumpPlatformMessageLoop(v8::Isolate *pIsolate)
Definition
v8_test_environment.cpp:48
V8TestEnvironment::TearDown
void TearDown() override
Definition
v8_test_environment.cpp:73
V8TestEnvironment::GetInstance
static V8TestEnvironment * GetInstance()
Definition
v8_test_environment.cpp:43
fxcrt::Observable
Definition
observed_ptr.h:17
TEST_F
TEST_F(GCedTreeNodeMixinUnitTest, OneRefence)
Definition
gced_tree_node_mixin_unittest.cpp:76
CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
Definition
heap.h:32
FXGCScopedHeap
std::unique_ptr< cppgc::Heap, FXGCHeapDeleter > FXGCScopedHeap
Definition
heap.h:25
cppgc
Definition
heap.h:12
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
v8
Definition
fxv8_unittest.h:15
CFX_V8IsolateDeleter
Definition
cfx_v8.h:70
qtwebengine
src
3rdparty
chromium
third_party
pdfium
testing
v8_test_environment.h
Generated on
for Qt by
1.18.0