diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-05-25 16:12:59 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-25 16:12:59 +0000 |
commit | 4ba76201df61467928bba429ea1d8115e292072e (patch) | |
tree | 3c440b2d0eb09b7a4d3193033bcc96f0a7e20b9d /fxjs/cfxjse_formcalc_context_embeddertest.cpp | |
parent | a2bb072a69b29695242a81e4b75c19c14c39acfb (diff) | |
download | pdfium-4ba76201df61467928bba429ea1d8115e292072e.tar.xz |
[xfa] Add missing xfa.event.cancelAction property
This CL adds the missing cancleAction property from the xfa.event
object.
Bug: 1066
Change-Id: I7d38956e2985c1f6ac0eba6de090874f1f72003c
Reviewed-on: https://pdfium-review.googlesource.com/32950
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_formcalc_context_embeddertest.cpp')
-rw-r--r-- | fxjs/cfxjse_formcalc_context_embeddertest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fxjs/cfxjse_formcalc_context_embeddertest.cpp b/fxjs/cfxjse_formcalc_context_embeddertest.cpp index ba39182364..4b9d93a660 100644 --- a/fxjs/cfxjse_formcalc_context_embeddertest.cpp +++ b/fxjs/cfxjse_formcalc_context_embeddertest.cpp @@ -1554,3 +1554,22 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, EventChangeSelection) { EXPECT_EQ(4, context->GetEventParam()->m_iSelStart); EXPECT_EQ(4, context->GetEventParam()->m_iSelEnd); } + +TEST_F(CFXJSE_FormCalcContextEmbedderTest, XFAEventCancelAction) { + ASSERT_TRUE(OpenDocument("simple_xfa.pdf")); + + CXFA_EventParam params; + params.m_bCancelAction = false; + + CFXJSE_Engine* context = GetScriptContext(); + context->SetEventParam(params); + + EXPECT_TRUE(Execute("xfa.event.cancelAction")); + + CFXJSE_Value* value = GetValue(); + EXPECT_TRUE(value->IsBoolean()); + EXPECT_FALSE(value->ToBoolean()); + + EXPECT_TRUE(Execute("xfa.event.cancelAction = \"true\"")); + EXPECT_TRUE(context->GetEventParam()->m_bCancelAction); +} |