diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-22 20:20:57 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-22 20:20:57 +0000 |
commit | d3a34fe4665eed1ff09a5d06e565ffefb9a26134 (patch) | |
tree | 5e7b86471e2e74179860882d2c89b438caf6cb20 /fpdfsdk | |
parent | 1d78f4dd34637bf9a16411f64816ef87cb128165 (diff) | |
download | pdfium-d3a34fe4665eed1ff09a5d06e565ffefb9a26134.tar.xz |
Add FPDFFormFillEmbeddertest.DocumentAActions.
Provides coverage for CJS_EventContext::OnDoc_* methods.
Change-Id: I65dff8fe5af4a9c11ac8fffabe209ad497586b1c
Reviewed-on: https://pdfium-review.googlesource.com/c/44392
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_formfill_embeddertest.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/fpdfsdk/fpdf_formfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp index 99d30f3cc3..f5b39ae4b1 100644 --- a/fpdfsdk/fpdf_formfill_embeddertest.cpp +++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp @@ -435,6 +435,30 @@ TEST_F(FPDFFormFillEmbeddertest, DisableJavaScript) { UnloadPage(page); } +TEST_F(FPDFFormFillEmbeddertest, DocumentAActions) { + EmbedderTestTimerHandlingDelegate delegate; + SetDelegate(&delegate); + + EXPECT_TRUE(OpenDocument("document_aactions.pdf")); + FPDF_PAGE page = LoadPage(0); + EXPECT_TRUE(page); + + const auto& alerts = delegate.GetAlerts(); + EXPECT_EQ(0U, alerts.size()); + + FORM_DoDocumentAAction(form_handle(), FPDFDOC_AACTION_WS); + FORM_DoDocumentAAction(form_handle(), FPDFDOC_AACTION_DS); + FORM_DoDocumentAAction(form_handle(), FPDFDOC_AACTION_WP); + FORM_DoDocumentAAction(form_handle(), FPDFDOC_AACTION_DP); + UnloadPage(page); + + ASSERT_EQ(4U, alerts.size()); + EXPECT_STREQ(L"Will Save", alerts[0].message.c_str()); + EXPECT_STREQ(L"Did Save", alerts[1].message.c_str()); + EXPECT_STREQ(L"Will Print", alerts[2].message.c_str()); + EXPECT_STREQ(L"Did Print", alerts[3].message.c_str()); +} + TEST_F(FPDFFormFillEmbeddertest, BUG_551248) { // Test that timers fire once and intervals fire repeatedly. EmbedderTestTimerHandlingDelegate delegate; @@ -594,7 +618,6 @@ TEST_F(FPDFFormFillEmbeddertest, BUG_765384) { FORM_OnLButtonUp(form_handle(), page, 0, 140, 590); UnloadPage(page); } - #endif // PDF_ENABLE_V8 TEST_F(FPDFFormFillEmbeddertest, FormText) { |