diff options
author | Lei Zhang <thestig@chromium.org> | 2017-12-20 19:40:50 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-20 19:40:50 +0000 |
commit | 208eecfa7850ced5c0d776b9e5df5b104428608f (patch) | |
tree | 7c5b94d642c37670ef3419ae922339c54d1742c5 /core/fpdfapi | |
parent | e75538b44dc0afd1951a29d4574a8bdb11ca336f (diff) | |
download | pdfium-208eecfa7850ced5c0d776b9e5df5b104428608f.tar.xz |
Avoid default arguments in EmbedderTest::OpenDocument().chromium/3300
Default arguments are banned on virtual functions. Remove default
arguments and rename OpenDocument() to OpenDocumentWithOptions(). Add
wrappers for OpenDocumentWithOptions() to call it with sensible options.
Change-Id: I4955d88cf77a7eab1771692ea3d6a18260b52900
Reviewed-on: https://pdfium-review.googlesource.com/21891
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/parser/cpdf_parser_embeddertest.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp b/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp index 6aa3e2785a..4109715a9c 100644 --- a/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp @@ -59,7 +59,7 @@ TEST_F(CPDFParserEmbeddertest, Bug_757705) { } TEST_F(CPDFParserEmbeddertest, LoadMainCrossRefTable) { - EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", nullptr, true)); + EXPECT_TRUE(OpenDocumentLinearized("feature_linearized_loading.pdf")); // To check that main cross ref table is loaded correctly,will be enough to // check that the second page was correctly loaded. Because it is contains // crossrefs for second page. diff --git a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp index 834ed8c48d..a1d5fda510 100644 --- a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp @@ -19,7 +19,7 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, Unencrypted) { } TEST_F(CPDFSecurityHandlerEmbeddertest, UnencryptedWithPassword) { - ASSERT_TRUE(OpenDocument("about_blank.pdf", "foobar")); + ASSERT_TRUE(OpenDocumentWithPassword("about_blank.pdf", "foobar")); EXPECT_EQ(0xFFFFFFFF, FPDF_GetDocPermissions(document())); } @@ -28,16 +28,16 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, NoPassword) { } TEST_F(CPDFSecurityHandlerEmbeddertest, BadPassword) { - EXPECT_FALSE(OpenDocument("encrypted.pdf", "tiger")); + EXPECT_FALSE(OpenDocumentWithPassword("encrypted.pdf", "tiger")); } TEST_F(CPDFSecurityHandlerEmbeddertest, UserPassword) { - ASSERT_TRUE(OpenDocument("encrypted.pdf", "1234")); + ASSERT_TRUE(OpenDocumentWithPassword("encrypted.pdf", "1234")); EXPECT_EQ(0xFFFFF2C0, FPDF_GetDocPermissions(document())); } TEST_F(CPDFSecurityHandlerEmbeddertest, OwnerPassword) { - ASSERT_TRUE(OpenDocument("encrypted.pdf", "5678")); + ASSERT_TRUE(OpenDocumentWithPassword("encrypted.pdf", "5678")); EXPECT_EQ(0xFFFFFFFC, FPDF_GetDocPermissions(document())); } @@ -50,7 +50,7 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, PasswordAfterGenerateSave) { const char md5[] = "a5dde3c6c37b8716b9b369a03752a728"; #endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ { - ASSERT_TRUE(OpenDocument("encrypted.pdf", "5678", true)); + ASSERT_TRUE(OpenDocumentWithOptions("encrypted.pdf", "5678", true)); FPDF_PAGE page = LoadPage(0); ASSERT_TRUE(page); FPDF_PAGEOBJECT red_rect = FPDFPageObj_CreateNewRect(10, 10, 20, 20); @@ -95,15 +95,15 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, NoPasswordVersion5) { } TEST_F(CPDFSecurityHandlerEmbeddertest, BadPasswordVersion5) { - ASSERT_FALSE(OpenDocument("bug_644.pdf", "tiger")); + ASSERT_FALSE(OpenDocumentWithPassword("bug_644.pdf", "tiger")); } TEST_F(CPDFSecurityHandlerEmbeddertest, OwnerPasswordVersion5) { - ASSERT_TRUE(OpenDocument("bug_644.pdf", "a")); + ASSERT_TRUE(OpenDocumentWithPassword("bug_644.pdf", "a")); EXPECT_EQ(0xFFFFFFFC, FPDF_GetDocPermissions(document())); } TEST_F(CPDFSecurityHandlerEmbeddertest, UserPasswordVersion5) { - ASSERT_TRUE(OpenDocument("bug_644.pdf", "b")); + ASSERT_TRUE(OpenDocumentWithPassword("bug_644.pdf", "b")); EXPECT_EQ(0xFFFFFFFC, FPDF_GetDocPermissions(document())); } |