-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathexternal_engine_embedder_test.cpp
More file actions
37 lines (28 loc) · 1.03 KB
/
external_engine_embedder_test.cpp
File metadata and controls
37 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2020 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "testing/external_engine_embedder_test.h"
#include <memory>
#include "fxjs/cfxjs_engine.h"
#include "testing/v8_test_environment.h"
#include "v8/include/v8-context.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-local-handle.h"
ExternalEngineEmbedderTest::ExternalEngineEmbedderTest() = default;
ExternalEngineEmbedderTest::~ExternalEngineEmbedderTest() = default;
void ExternalEngineEmbedderTest::SetUp() {
EmbedderTest::SetUp();
v8::Isolate::Scope isolate_scope(isolate());
v8::HandleScope handle_scope(isolate());
CFXJS_PerIsolateData::SetUp(isolate());
engine_ = std::make_unique<CFXJS_Engine>(isolate());
engine_->InitializeEngine();
}
void ExternalEngineEmbedderTest::TearDown() {
engine_->ReleaseEngine();
engine_.reset();
JSEmbedderTest::TearDown();
}
v8::Local<v8::Context> ExternalEngineEmbedderTest::GetV8Context() {
return engine_->GetV8Context();
}