diff options
Diffstat (limited to 'testing/embedder_test.h')
-rw-r--r-- | testing/embedder_test.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/testing/embedder_test.h b/testing/embedder_test.h index f490f82536..f6842d23c3 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_; |