diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-10-03 18:41:03 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-03 18:41:03 +0000 |
commit | 9ef93d0f3f417c09d2c24e9cceaf600eeb8ff44a (patch) | |
tree | ad388c4c2da58f3b454cdb179f1cfa8da31d7b30 /fpdfsdk/fpdf_formfill_embeddertest.cpp | |
parent | ce8fa87cb384ffc3309313332fc46638aeb74351 (diff) | |
download | pdfium-9ef93d0f3f417c09d2c24e9cceaf600eeb8ff44a.tar.xz |
Reland "Make potentially dangerous Actions require a user click."
This is a reland of 9d784c291714b703b16185e69860a3797de85b6c
https://chromium-review.googlesource.com/c/chromium/src/+/1244367
was submitted changing the test that broke with this CL to not depend
on PDF OpenActions anymore.
Original change's description:
> Make potentially dangerous Actions require a user click.
>
> URI and SubmitForm actions are only handled if the event was
> ButtonUp or ButtonDown.
>
> Bug: 851821
> Change-Id: If6eb0ff44f6d62ac6df50b552c0bdc582885ab5d
> Reviewed-on: https://pdfium-review.googlesource.com/42731
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Bug: 851821
Change-Id: Iaf9c399059590f0f1a050ac450e08ee60a8d5a38
Reviewed-on: https://pdfium-review.googlesource.com/43410
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_formfill_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/fpdf_formfill_embeddertest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_formfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp index 8ff3a84291..3e53753b48 100644 --- a/fpdfsdk/fpdf_formfill_embeddertest.cpp +++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp @@ -379,6 +379,25 @@ TEST_F(FPDFFormFillEmbeddertest, BUG_514690) { UnloadPage(page); } +class DoURIActionBlockedDelegate final : public EmbedderTest::Delegate { + public: + void DoURIAction(FPDF_BYTESTRING uri) override { + FAIL() << "Navigated to " << uri; + } +}; + +TEST_F(FPDFFormFillEmbeddertest, BUG_851821) { + DoURIActionBlockedDelegate delegate; + SetDelegate(&delegate); + + EXPECT_TRUE(OpenDocument("redirect.pdf")); + FPDF_PAGE page = LoadPage(0); + EXPECT_TRUE(page); + DoOpenActions(); + + UnloadPage(page); +} + #ifdef PDF_ENABLE_V8 TEST_F(FPDFFormFillEmbeddertest, DisableJavaScript) { // Test that timers and intervals can't fire without JS. |