summaryrefslogtreecommitdiff
path: root/testing/embedder_test.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-05-18 14:11:29 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-18 18:24:51 +0000
commit14aacd5825bcbeca10326f52612bbc2fdb298485 (patch)
tree7b6c2a43e6bddb6b13e938299d5c6ac7a81b4b46 /testing/embedder_test.cpp
parentf0a404d41fcc72f59b528002ef9b2d6011992bc8 (diff)
downloadpdfium-14aacd5825bcbeca10326f52612bbc2fdb298485.tar.xz
Adding fm2js embedder tests
This Cl adds the basis of the test framework to execute the javascript produced by CXFA_FM2JSContext and verify the results are correct. Change-Id: Ie46625b7e27ca0808e9cc41fdc00b7c0a212837d Reviewed-on: https://pdfium-review.googlesource.com/5651 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing/embedder_test.cpp')
-rw-r--r--testing/embedder_test.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 1baeb57206..bf00c11607 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -179,6 +179,8 @@ bool EmbedderTest::OpenDocument(const std::string& filename,
}
}
+ SetupFormFillEnvironment();
+
#ifdef PDF_ENABLE_XFA
int docType = DOCTYPE_PDF;
if (FPDF_HasXFAField(document_, &docType)) {
@@ -188,7 +190,6 @@ bool EmbedderTest::OpenDocument(const std::string& filename,
#endif // PDF_ENABLE_XFA
(void)FPDF_GetDocPermissions(document_);
- SetupFormFillEnvironment();
return true;
}
@@ -197,6 +198,7 @@ void EmbedderTest::SetupFormFillEnvironment() {
memset(platform, 0, sizeof(IPDF_JSPLATFORM));
platform->version = 2;
platform->app_alert = AlertTrampoline;
+ platform->m_isolate = external_isolate_;
FPDF_FORMFILLINFO* formfillinfo = static_cast<FPDF_FORMFILLINFO*>(this);
memset(formfillinfo, 0, sizeof(FPDF_FORMFILLINFO));