Index: testing/embedder_test.h |
diff --git a/testing/embedder_test.h b/testing/embedder_test.h |
index f490f82536b3e14c079f6254f044024e8761b330..f6842d23c3233701f51d94c4887303ebf0b7709f 100644 |
--- a/testing/embedder_test.h |
+++ b/testing/embedder_test.h |
@@ -12,6 +12,7 @@ |
#include "../public/fpdf_ext.h" |
#include "../public/fpdf_formfill.h" |
#include "../public/fpdfview.h" |
+#include "../third_party/base/nonstd_unique_ptr.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "v8/include/v8.h" |
@@ -60,8 +61,11 @@ class EmbedderTest : public ::testing::Test, |
void SetUp() override; |
void TearDown() override; |
+ // Call before SetUp to pass shared isolate, otherwise PDFium creates one. |
+ void SetExternalIsolate(v8::Isolate* isolate) { external_isolate_ = isolate; } |
+ |
void SetDelegate(Delegate* delegate) { |
- delegate_ = delegate ? delegate : default_delegate_; |
+ delegate_ = delegate ? delegate : default_delegate_.get(); |
} |
FPDF_DOCUMENT document() { return document_; } |
@@ -94,7 +98,7 @@ class EmbedderTest : public ::testing::Test, |
protected: |
Delegate* delegate_; |
- Delegate* default_delegate_; |
+ nonstd::unique_ptr<Delegate> default_delegate_; |
FPDF_DOCUMENT document_; |
FPDF_FORMHANDLE form_handle_; |
FPDF_AVAIL avail_; |
@@ -104,6 +108,7 @@ class EmbedderTest : public ::testing::Test, |
v8::Platform* platform_; |
v8::StartupData natives_; |
v8::StartupData snapshot_; |
+ v8::Isolate* external_isolate_; |
TestLoader* loader_; |
size_t file_length_; |
char* file_contents_; |