summaryrefslogtreecommitdiff
path: root/testing/embedder_test_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'testing/embedder_test_main.cpp')
-rw-r--r--testing/embedder_test_main.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/testing/embedder_test_main.cpp b/testing/embedder_test_main.cpp
index ade6118e64..03c192b08a 100644
--- a/testing/embedder_test_main.cpp
+++ b/testing/embedder_test_main.cpp
@@ -34,16 +34,16 @@ class Environment : public testing::Environment {
#ifdef PDF_ENABLE_V8
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
if (g_v8_natives && g_v8_snapshot) {
- InitializeV8ForPDFium(g_exe_path, std::string(), nullptr, nullptr,
- &platform_);
+ platform_ =
+ InitializeV8ForPDFium(g_exe_path, std::string(), nullptr, nullptr);
} else {
g_v8_natives = new v8::StartupData;
g_v8_snapshot = new v8::StartupData;
- InitializeV8ForPDFium(g_exe_path, std::string(), g_v8_natives,
- g_v8_snapshot, &platform_);
+ platform_ = InitializeV8ForPDFium(g_exe_path, std::string(), g_v8_natives,
+ g_v8_snapshot);
}
#else
- InitializeV8ForPDFium(g_exe_path, &platform_);
+ platform_ = InitializeV8ForPDFium(g_exe_path);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#endif // FPDF_ENABLE_V8
}
@@ -51,13 +51,12 @@ class Environment : public testing::Environment {
void TearDown() override {
#ifdef PDF_ENABLE_V8
v8::V8::ShutdownPlatform();
- delete platform_;
#endif // PDF_ENABLE_V8
}
private:
#ifdef PDF_ENABLE_V8
- v8::Platform* platform_;
+ std::unique_ptr<v8::Platform> platform_;
#endif // PDF_ENABLE_V8
};