summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_formcalc_context_embeddertest.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-05-25 16:01:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-25 16:01:49 +0000
commitda060ba107fba8ef679393b5622b6de2f4790379 (patch)
tree3c0c04c5374529dc3009813a4e07ee9f3e718aa8 /fxjs/cfxjse_formcalc_context_embeddertest.cpp
parent0913752e0d218208aadc80690a39f523e5cc21cc (diff)
downloadpdfium-da060ba107fba8ef679393b5622b6de2f4790379.tar.xz
[xfa] Restrict the editable xfa.change properties
According to the XFA Spec only the cancelAction, selStart, selEnd and change properties of xfa.event are editable. This CL adds checking to early out if attempting to set any of the other properties. Bug: 1066 Change-Id: Ie6129e1f65de7584f0b5f3072a1acf6e25d44a2c Reviewed-on: https://pdfium-review.googlesource.com/32932 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.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/fxjs/cfxjse_formcalc_context_embeddertest.cpp b/fxjs/cfxjse_formcalc_context_embeddertest.cpp
index a32f988d06..8d1bb36b3d 100644
--- a/fxjs/cfxjse_formcalc_context_embeddertest.cpp
+++ b/fxjs/cfxjse_formcalc_context_embeddertest.cpp
@@ -1486,3 +1486,17 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, SetXFAEventChange) {
EXPECT_TRUE(Execute(test));
EXPECT_EQ(L"changed", context->GetEventParam()->m_wsChange);
}
+
+TEST_F(CFXJSE_FormCalcContextEmbedderTest, SetXFAEventFullTextFails) {
+ ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
+
+ CXFA_EventParam params;
+ params.m_wsFullText = L"Original Full Text";
+
+ CFXJSE_Engine* context = GetScriptContext();
+ context->SetEventParam(params);
+
+ const char test[] = {"xfa.event.fullText = \"Changed Full Text\""};
+ EXPECT_TRUE(Execute(test));
+ EXPECT_EQ(L"Original Full Text", context->GetEventParam()->m_wsFullText);
+}