summaryrefslogtreecommitdiff
path: root/testing/embedder_test.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-07-13 16:31:34 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-13 21:18:15 +0000
commit56fc9725f05b18573b06d8a422c5d9d6e626219d (patch)
treeda5cf8b3ab3cc4cd6b2394f3f80a46be79a59be3 /testing/embedder_test.h
parent7b8f88a45cf88756c6bed616ca50b404af903c97 (diff)
downloadpdfium-56fc9725f05b18573b06d8a422c5d9d6e626219d.tar.xz
Add Embeddertest for password after savingchromium/3157
This CL allows TestSaved to open password-protected and linearized documents properly. It also adds a test with one such document. BUG= pdfium:787 Change-Id: Ie0da7f290711505fb208794afdc737c36e84dd3c Reviewed-on: https://pdfium-review.googlesource.com/7034 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'testing/embedder_test.h')
-rw-r--r--testing/embedder_test.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/testing/embedder_test.h b/testing/embedder_test.h
index d2fd984a10..878e50bfdd 100644
--- a/testing/embedder_test.h
+++ b/testing/embedder_test.h
@@ -114,6 +114,15 @@ class EmbedderTest : public ::testing::Test,
virtual void UnloadPage(FPDF_PAGE page);
protected:
+ bool OpenDocumentHelper(const char* password,
+ bool must_linearize,
+ FX_FILEAVAIL* file_avail,
+ FX_DOWNLOADHINTS* hints,
+ FPDF_FILEACCESS* file_access,
+ FPDF_DOCUMENT* document,
+ FPDF_AVAIL* avail,
+ FPDF_FORMHANDLE* form_handle);
+
FPDF_FORMHANDLE SetupFormFillEnvironment(FPDF_DOCUMENT doc);
// Return the hash of |bitmap|.
@@ -135,7 +144,10 @@ class EmbedderTest : public ::testing::Test,
unsigned char* buf,
unsigned long size);
- void TestSaved(int width, int height, const char* md5);
+ void TestSaved(int width,
+ int height,
+ const char* md5,
+ const char* password = nullptr);
void CloseSaved();
void TestAndCloseSaved(int width, int height, const char* md5);
@@ -159,6 +171,7 @@ class EmbedderTest : public ::testing::Test,
FPDF_DOCUMENT m_SavedDocument;
FPDF_PAGE m_SavedPage;
FPDF_FORMHANDLE m_SavedForm;
+ FPDF_AVAIL m_SavedAvail;
private:
static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type);