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

Unified Diff: testing/embedder_test.cpp

Issue 1480403002: Allow building non-XFA (master) on the XFA branch. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: warning Created 5 years, 1 month 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
« no previous file with comments | « samples/samples.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/embedder_test.cpp
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 39f3d50eb7cf26fbe46ae7804b2086cbe5667997..d3ac09b675de237635787d5fa8ed34a7e27aeee5 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;
« no previous file with comments | « samples/samples.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698