Index: testing/embedder_test.h |
diff --git a/testing/embedder_test.h b/testing/embedder_test.h |
index f490f82536b3e14c079f6254f044024e8761b330..86951e03a02a408c8ec1dfdc1439fdd7020fbada 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" |
@@ -28,6 +29,9 @@ class EmbedderTest : public ::testing::Test, |
public: |
virtual ~Delegate() {} |
+ // Override to return a shared isolate, otherwise PDFium creates one. |
+ virtual v8::Isolate* GetSharedIsolate() const { return nullptr; } |
+ |
// Equivalent to UNSUPPORT_INFO::FSDK_UnSupport_Handler(). |
virtual void UnsupportedHandler(int type) {} |
@@ -61,7 +65,7 @@ class EmbedderTest : public ::testing::Test, |
void TearDown() override; |
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_; |