summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-23 15:06:59 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-23 15:06:59 -0700
commit27ddf161579f79510b361d0016ccc7f0cdffdc6d (patch)
treebc5a13661d288faeccc8471275059a9d5e8795bc /testing
parent490d6128e6faef423fa6f965f792513e138bc04a (diff)
downloadpdfium-27ddf161579f79510b361d0016ccc7f0cdffdc6d.tar.xz
Distinguish between user and owner passwords.
BUG=pdfium:496 Review-Url: https://codereview.chromium.org/2005653002
Diffstat (limited to 'testing')
-rw-r--r--testing/embedder_test.cpp3
-rw-r--r--testing/embedder_test.h1
-rw-r--r--testing/resources/encrypted.pdfbin0 -> 10564 bytes
3 files changed, 3 insertions, 1 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 38a3dcdeca..033313dbe2 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -111,6 +111,7 @@ bool EmbedderTest::CreateEmptyDocument() {
}
bool EmbedderTest::OpenDocument(const std::string& filename,
+ const char* password,
bool must_linearize) {
std::string file_path;
if (!PathService::GetTestFilePath(filename, &file_path))
@@ -133,7 +134,7 @@ bool EmbedderTest::OpenDocument(const std::string& filename,
avail_ = FPDFAvail_Create(&file_avail_, &file_access_);
if (FPDFAvail_IsLinearized(avail_) == PDF_LINEARIZED) {
- document_ = FPDFAvail_GetDocument(avail_, nullptr);
+ document_ = FPDFAvail_GetDocument(avail_, password);
if (!document_) {
return false;
}
diff --git a/testing/embedder_test.h b/testing/embedder_test.h
index a21a55de2c..a176d944c0 100644
--- a/testing/embedder_test.h
+++ b/testing/embedder_test.h
@@ -88,6 +88,7 @@ class EmbedderTest : public ::testing::Test,
// The filename is relative to the test data directory where we store all the
// test files.
virtual bool OpenDocument(const std::string& filename,
+ const char* password = nullptr,
bool must_linearize = false);
// Perform JavaScript actions that are to run at document open time.
diff --git a/testing/resources/encrypted.pdf b/testing/resources/encrypted.pdf
new file mode 100644
index 0000000000..b489d56ff2
--- /dev/null
+++ b/testing/resources/encrypted.pdf
Binary files differ