Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Unified Diff: ppapi/tests/test_pdf.cc

Issue 718453003: Initialize V8 in PDFium from external files (plugin process only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix API Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/tests/test_pdf.h ('k') | ppapi/thunk/ppb_pdf_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_pdf.cc
diff --git a/ppapi/tests/test_pdf.cc b/ppapi/tests/test_pdf.cc
index cd083852df7d72140570d92d14cf5dc5e7d34da4..11a35b173a1ef36dd62963b2662580b551cd0d7f 100644
--- a/ppapi/tests/test_pdf.cc
+++ b/ppapi/tests/test_pdf.cc
@@ -11,6 +11,10 @@
#include "ppapi/cpp/var.h"
#include "ppapi/tests/testing_instance.h"
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+#include "gin/public/isolate_holder.h"
+#endif
+
REGISTER_TEST_CASE(PDF);
TestPDF::TestPDF(TestingInstance* instance)
@@ -20,6 +24,7 @@ TestPDF::TestPDF(TestingInstance* instance)
void TestPDF::RunTests(const std::string& filter) {
RUN_TEST(GetLocalizedString, filter);
RUN_TEST(GetResourceImage, filter);
+ RUN_TEST(GetV8ExternalSnapshotData, filter);
}
std::string TestPDF::TestGetLocalizedString() {
@@ -44,3 +49,28 @@ std::string TestPDF::TestGetResourceImage() {
}
PASS();
}
+
+std::string TestPDF::TestGetV8ExternalSnapshotData() {
+ const char* natives_data;
+ const char* snapshot_data;
+ int natives_size;
+ int snapshot_size;
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ bool loaded_ok = gin::IsolateHolder::LoadV8Snapshot();
+ ASSERT_TRUE(loaded_ok);
+ pp::PDF::GetV8ExternalSnapshotData(instance_, &natives_data, &natives_size,
+ &snapshot_data, &snapshot_size);
+ ASSERT_NE(natives_data, (char*) (NULL));
+ ASSERT_NE(natives_size, 0);
+ ASSERT_NE(snapshot_data, (char*) (NULL));
+ ASSERT_NE(snapshot_size, 0);
+#else
+ pp::PDF::GetV8ExternalSnapshotData(instance_, &natives_data, &natives_size,
+ &snapshot_data, &snapshot_size);
+ ASSERT_EQ(natives_data, (char*) (NULL));
+ ASSERT_EQ(natives_size, 0);
+ ASSERT_EQ(snapshot_data, (char*) (NULL));
+ ASSERT_EQ(snapshot_size, 0);
+#endif
+ PASS();
+}
« no previous file with comments | « ppapi/tests/test_pdf.h ('k') | ppapi/thunk/ppb_pdf_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698