summaryrefslogtreecommitdiff
path: root/testing/embedder_test.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-30 15:46:36 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-30 15:46:36 -0800
commitc46d0005880b24d38d9e7eab2f446e9724e93537 (patch)
tree731f81c6fcb313a9e3c2b8e0ceaf21f3ce70b6b4 /testing/embedder_test.cpp
parent40e9ff30b7f22b37c071dc9751f489d4cc22b0ee (diff)
downloadpdfium-c46d0005880b24d38d9e7eab2f446e9724e93537.tar.xz
Allow building non-XFA (master) on the XFA branch.
This first pass is GYP-only, will do GN in the next CL. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1480403002 .
Diffstat (limited to 'testing/embedder_test.cpp')
-rw-r--r--testing/embedder_test.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 39f3d50eb7..d3ac09b675 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -77,13 +77,18 @@ void EmbedderTest::SetUp() {
void EmbedderTest::TearDown() {
if (document_) {
FORM_DoDocumentAAction(form_handle_, FPDFDOC_AACTION_WC);
-
+#ifdef PDF_ENABLE_XFA
// Note: The shut down order here is the reverse of the non-XFA branch
// order. Need to work out if this is required, and if it is, the lifetimes
// of objects owned by |doc| that |form| reference.
FPDF_CloseDocument(document_);
FPDFDOC_ExitFormFillEnvironment(form_handle_);
+#else // PDF_ENABLE_XFA
+ FPDFDOC_ExitFormFillEnvironment(form_handle_);
+ FPDF_CloseDocument(document_);
+#endif // PDF_ENABLE_XFA
}
+
FPDFAvail_Destroy(avail_);
FPDF_DestroyLibrary();
@@ -154,11 +159,13 @@ bool EmbedderTest::OpenDocument(const std::string& filename,
}
}
+#ifdef PDF_ENABLE_XFA
int docType = DOCTYPE_PDF;
if (FPDF_HasXFAField(document_, &docType)) {
if (docType != DOCTYPE_PDF)
(void)FPDF_LoadXFA(document_);
}
+#endif // PDF_ENABLE_XFA
(void)FPDF_GetDocPermissions(document_);
@@ -171,9 +178,9 @@ bool EmbedderTest::OpenDocument(const std::string& filename,
memset(formfillinfo, 0, sizeof(FPDF_FORMFILLINFO));
#ifdef PDF_ENABLE_XFA
formfillinfo->version = 2;
-#else
+#else // PDF_ENABLE_XFA
formfillinfo->version = 1;
-#endif
+#endif // PDF_ENABLE_XFA
formfillinfo->FFI_SetTimer = SetTimerTrampoline;
formfillinfo->FFI_KillTimer = KillTimerTrampoline;
formfillinfo->FFI_GetPage = GetPageTrampoline;