Flip the shut down order in tests.
authorLei Zhang <thestig@chromium.org>
Thu, 16 Jul 2015 00:10:52 +0000 (17:10 -0700)
committerLei Zhang <thestig@chromium.org>
Thu, 16 Jul 2015 00:10:52 +0000 (17:10 -0700)
This matches the Chromium PDF plugin changes in
https://codereview.chromium.org/1230313006/

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1237233006 .

samples/pdfium_test.cc
testing/embedder_test.cpp

index 7e9ca68..0d76b63 100644 (file)
@@ -550,8 +550,8 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len,
   }
 
   FORM_DoDocumentAAction(form, FPDFDOC_AACTION_WC);
-  FPDF_CloseDocument(doc);
   FPDFDOC_ExitFormFillEnvironment(form);
+  FPDF_CloseDocument(doc);
   FPDFAvail_Destroy(pdf_avail);
 
   fprintf(stderr, "Rendered %d pages.\n", rendered_pages);
index 02d0fae..447b4d1 100644 (file)
@@ -170,8 +170,8 @@ void EmbedderTest::SetUp() {
 void EmbedderTest::TearDown() {
   if (document_) {
     FORM_DoDocumentAAction(form_handle_, FPDFDOC_AACTION_WC);
-    FPDF_CloseDocument(document_);
     FPDFDOC_ExitFormFillEnvironment(form_handle_);
+    FPDF_CloseDocument(document_);
   }
   FPDFAvail_Destroy(avail_);
   FPDF_DestroyLibrary();