summaryrefslogtreecommitdiff
path: root/testing/embedder_test.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-07 10:17:53 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-07 10:17:53 -0700
commita72e8e2c4392df725c7e35ed1ae3f891e79e49ec (patch)
tree99eb91f764c428cd34a3b84e8b9e9bfb239d9e5a /testing/embedder_test.h
parentcd56a7d6fb05bd0babf316a84280a26ecc649d45 (diff)
downloadpdfium-a72e8e2c4392df725c7e35ed1ae3f891e79e49ec.tar.xz
Merge to XFA: Pass v8::Isolate to PDFium at init time.
New code changes in JS_Runtime.cpp. (cherry picked from commit 3dedace9623fef6161a8666e53a4ab2b9be61e4c) Original Review URL: https://codereview.chromium.org/1367033002 . Also merge to XFA: Run FXJS_V8 embedder tests against a shared isolate, since the two go together. (cherry picked from commit 4ea721cb7954898a9722c389dae86c62957352d0) Original Review URL: https://codereview.chromium.org/1377293004 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1381633008 .
Diffstat (limited to 'testing/embedder_test.h')
-rw-r--r--testing/embedder_test.h9
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_;