summaryrefslogtreecommitdiff
path: root/testing/js_embedder_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'testing/js_embedder_test.cpp')
-rw-r--r--testing/js_embedder_test.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/testing/js_embedder_test.cpp b/testing/js_embedder_test.cpp
index 1ca957b44f..9821a21166 100644
--- a/testing/js_embedder_test.cpp
+++ b/testing/js_embedder_test.cpp
@@ -15,15 +15,15 @@ JSEmbedderTest::~JSEmbedderTest() {}
void JSEmbedderTest::SetUp() {
v8::Isolate::CreateParams params;
params.array_buffer_allocator = m_pArrayBufferAllocator.get();
- m_pIsolate = v8::Isolate::New(params);
+ m_pIsolate.reset(v8::Isolate::New(params));
- EmbedderTest::SetExternalIsolate(m_pIsolate);
+ EmbedderTest::SetExternalIsolate(isolate());
EmbedderTest::SetUp();
- v8::Isolate::Scope isolate_scope(m_pIsolate);
- v8::HandleScope handle_scope(m_pIsolate);
- FXJS_PerIsolateData::SetUp(m_pIsolate);
- m_Engine = pdfium::MakeUnique<CFXJS_Engine>(m_pIsolate);
+ v8::Isolate::Scope isolate_scope(isolate());
+ v8::HandleScope handle_scope(isolate());
+ FXJS_PerIsolateData::SetUp(isolate());
+ m_Engine = pdfium::MakeUnique<CFXJS_Engine>(isolate());
m_Engine->InitializeEngine();
}
@@ -31,12 +31,7 @@ void JSEmbedderTest::TearDown() {
m_Engine->ReleaseEngine();
m_Engine.reset();
EmbedderTest::TearDown();
- m_pIsolate->Dispose();
- m_pIsolate = nullptr;
-}
-
-v8::Isolate* JSEmbedderTest::isolate() {
- return m_pIsolate;
+ m_pIsolate.reset();
}
v8::Local<v8::Context> JSEmbedderTest::GetV8Context() {