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

Unified Diff: testing/embedder_test.h

Issue 1377293004: Run FXJS_V8 embedder tests against a shared isolate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase past massive rename Created 5 years, 2 months 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
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_;

Powered by Google App Engine
This is Rietveld 408576698