summaryrefslogtreecommitdiff
path: root/testing/embedder_test.h
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-06-06 19:17:34 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-06 19:17:34 +0000
commit7c2e8a32c34e0a258963daf6483d5af1695a3dba (patch)
tree7f916521fb3e2f9d7e7b8d3c5b1989d82ff3c453 /testing/embedder_test.h
parentb8a2978cbff28424cb6364092236072dba8073d7 (diff)
downloadpdfium-7c2e8a32c34e0a258963daf6483d5af1695a3dba.tar.xz
Embedder tests can write saved PDFs to a file for debugging.
Before calling a method that use EmbedderTest as FPDF_FILEWRITE (usually calling FPDF_SaveAsCopy()), call: OpenPDFFileForWrite("Filename.pdf"); After the write, close the stream with: ClosePDFFileForWrite(); Change-Id: Id1e7f778a9ff2b2b5bf976d49b485d5cb15f94bd Reviewed-on: https://pdfium-review.googlesource.com/34150 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'testing/embedder_test.h')
-rw-r--r--testing/embedder_test.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/testing/embedder_test.h b/testing/embedder_test.h
index 8156dd2353..e8f76c058f 100644
--- a/testing/embedder_test.h
+++ b/testing/embedder_test.h
@@ -5,6 +5,7 @@
#ifndef TESTING_EMBEDDER_TEST_H_
#define TESTING_EMBEDDER_TEST_H_
+#include <fstream>
#include <map>
#include <memory>
#include <string>
@@ -204,6 +205,9 @@ class EmbedderTest : public ::testing::Test,
void SetWholeFileAvailable();
+ void OpenPDFFileForWrite(const char* filename);
+ void ClosePDFFileForWrite();
+
std::unique_ptr<Delegate> default_delegate_;
Delegate* delegate_;
@@ -256,6 +260,7 @@ class EmbedderTest : public ::testing::Test,
int GetPageNumberForSavedPage(FPDF_PAGE page) const;
std::string data_string_;
+ std::ofstream filestream_;
};
#endif // TESTING_EMBEDDER_TEST_H_