diff options
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | testing/embedder_test.cpp | 12 | ||||
-rw-r--r-- | testing/js_embedder_test.cpp | 15 |
3 files changed, 15 insertions, 14 deletions
@@ -15,7 +15,7 @@ vars = { 'pdfium_tests_revision': '6c769320872e6ca82da4adaec1a497237f71b543', 'skia_revision': '6f47dbaff54a7705ef3e98f1f65c765e56fd9bd0', 'trace_event_revision': 'd83d44b13d07c2fd0a40101a7deef9b93b841732', - 'v8_revision': '5cd0d8f27e3f740179a8a3de7b9d2c0cfae7afb9', + 'v8_revision': '055bfa771a7bd763305d3bafd43e39459abc95a4', } deps = { diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index 033313dbe2..3d3b2ad844 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -58,7 +58,12 @@ EmbedderTest::EmbedderTest() #endif // FPDF_ENABLE_V8 } -EmbedderTest::~EmbedderTest() {} +EmbedderTest::~EmbedderTest() { +#ifdef PDF_ENABLE_V8 + v8::V8::ShutdownPlatform(); + delete platform_; +#endif // PDF_ENABLE_V8 +} void EmbedderTest::SetUp() { FPDF_LIBRARY_CONFIG config; @@ -93,11 +98,6 @@ void EmbedderTest::TearDown() { FPDFAvail_Destroy(avail_); FPDF_DestroyLibrary(); -#ifdef PDF_ENABLE_V8 - v8::V8::ShutdownPlatform(); - delete platform_; -#endif // PDF_ENABLE_V8 - delete loader_; } diff --git a/testing/js_embedder_test.cpp b/testing/js_embedder_test.cpp index ffa647d073..4815cd54a3 100644 --- a/testing/js_embedder_test.cpp +++ b/testing/js_embedder_test.cpp @@ -5,17 +5,16 @@ #include "testing/js_embedder_test.h" JSEmbedderTest::JSEmbedderTest() - : m_pArrayBufferAllocator(new FXJS_ArrayBufferAllocator) { + : m_pArrayBufferAllocator(new FXJS_ArrayBufferAllocator), + m_pIsolate(nullptr) {} + +JSEmbedderTest::~JSEmbedderTest() {} + +void JSEmbedderTest::SetUp() { v8::Isolate::CreateParams params; params.array_buffer_allocator = m_pArrayBufferAllocator.get(); m_pIsolate = v8::Isolate::New(params); -} -JSEmbedderTest::~JSEmbedderTest() { - m_pIsolate->Dispose(); -} - -void JSEmbedderTest::SetUp() { EmbedderTest::SetExternalIsolate(m_pIsolate); EmbedderTest::SetUp(); @@ -34,6 +33,8 @@ void JSEmbedderTest::TearDown() { m_pPersistentContext.Reset(); FXJS_Release(); EmbedderTest::TearDown(); + m_pIsolate->Dispose(); + m_pIsolate = nullptr; } v8::Isolate* JSEmbedderTest::isolate() { |