summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/embedder_test.cpp2
-rw-r--r--testing/test_support.cpp11
-rw-r--r--testing/test_support.h3
3 files changed, 9 insertions, 7 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 3d3b2ad844..59190a7751 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -53,7 +53,7 @@ EmbedderTest::EmbedderTest()
InitializeV8ForPDFium(g_exe_path_, std::string(), &natives_, &snapshot_,
&platform_);
#else
- InitializeV8ForPDFium(&platform_);
+ InitializeV8ForPDFium(g_exe_path_, &platform_);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#endif // FPDF_ENABLE_V8
}
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index c50edeba2d..96a18a547a 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -58,8 +58,8 @@ bool GetExternalData(const std::string& exe_path,
}
#endif // V8_USE_EXTERNAL_STARTUP_DATA
-void InitializeV8Common(v8::Platform** platform) {
- v8::V8::InitializeICU();
+void InitializeV8Common(const char* exe_path, v8::Platform** platform) {
+ v8::V8::InitializeICUDefaultLocation(exe_path);
*platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(*platform);
@@ -156,7 +156,7 @@ bool InitializeV8ForPDFium(const std::string& exe_path,
v8::StartupData* natives_blob,
v8::StartupData* snapshot_blob,
v8::Platform** platform) {
- InitializeV8Common(platform);
+ InitializeV8Common(exe_path.c_str(), platform);
if (!GetExternalData(exe_path, bin_dir, "natives_blob.bin", natives_blob))
return false;
if (!GetExternalData(exe_path, bin_dir, "snapshot_blob.bin", snapshot_blob))
@@ -166,8 +166,9 @@ bool InitializeV8ForPDFium(const std::string& exe_path,
return true;
}
#else // V8_USE_EXTERNAL_STARTUP_DATA
-bool InitializeV8ForPDFium(v8::Platform** platform) {
- InitializeV8Common(platform);
+bool InitializeV8ForPDFium(const std::string& exe_path,
+ v8::Platform** platform) {
+ InitializeV8Common(exe_path.c_str(), platform);
return true;
}
#endif // V8_USE_EXTERNAL_STARTUP_DATA
diff --git a/testing/test_support.h b/testing/test_support.h
index fdb24fe61b..4111ca61ed 100644
--- a/testing/test_support.h
+++ b/testing/test_support.h
@@ -83,7 +83,8 @@ bool InitializeV8ForPDFium(const std::string& exe_path,
v8::StartupData* snapshot_blob,
v8::Platform** platform);
#else // V8_USE_EXTERNAL_STARTUP_DATA
-bool InitializeV8ForPDFium(v8::Platform** platform);
+bool InitializeV8ForPDFium(const std::string& exe_path,
+ v8::Platform** platform);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#endif // PDF_ENABLE_V8