Add XFA event pseudomodel test.
Change-Id: I004f0345b27322ef90951177b2d7274c05d64ead
Reviewed-on: https://pdfium-review.googlesource.com/c/49851
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/resources/javascript/xfa_specific/xfa_event_pseudomodel.in b/testing/resources/javascript/xfa_specific/xfa_event_pseudomodel.in
new file mode 100644
index 0000000..c687496
--- /dev/null
+++ b/testing/resources/javascript/xfa_specific/xfa_event_pseudomodel.in
@@ -0,0 +1,54 @@
+{{header}}
+{{include ../../xfa_catalog_1_0.fragment}}
+{{include ../../xfa_object_2_0.fragment}}
+{{include ../../xfa_preamble_3_0.fragment}}
+{{include ../../xfa_config_4_0.fragment}}
+{{object 5 0}} <<
+>>
+stream
+<template>
+ <subform layout="tb" name="my_doc">
+ <pageSet id="page" relation="orderedOccurrence">
+ <occur initial="1" max="1" min="1"/>
+ <pageArea id="Page1" name="Page1">
+ <occur max="1" min="1"/>
+ <contentArea h="100mm" w="200mm" x="0.25in" y="0.25in"/>
+ </pageArea>
+ <pageArea id="Page2" name="Page2">
+ <occur max="1" min="1"/>
+ <contentArea h="100mm" w="200mm" x="0.25in" y="0.25in"/>
+ </pageArea>
+ </pageSet>
+ <event activity="docReady" ref="$host">
+ <script contentType="application/x-javascript">
+ {{include ../property_test_helpers.js}}
+ testRWProperty(xfa.event, "cancelAction", false, true);
+ testRWProperty(xfa.event, "change", "", "new foo");
+ testRIProperty(xfa.event, "commitKey", 0);
+ testRIProperty(xfa.event, "fullText", "");
+ testRIProperty(xfa.event, "keyDown", false);
+ testRIProperty(xfa.event, "modifier", false);
+ testRIProperty(xfa.event, "newContentType", "");
+ testRIProperty(xfa.event, "newText", "new foo"); // From above.
+ testRIProperty(xfa.event, "prevContentType", "");
+ testRIProperty(xfa.event, "prevText", "");
+ testRIProperty(xfa.event, "reenter", "");
+ testRIProperty(xfa.event, "selEnd", 0);
+ testRIProperty(xfa.event, "selStart", 0);
+ testRIProperty(xfa.event, "shift", false);
+ testRIProperty(xfa.event, "soapFaultCode", "");
+ testRIProperty(xfa.event, "soapFaultString", "");
+ testRIProperty(xfa.event, "target", undefined);
+ </script>
+ </event>
+ </subform>
+</template>
+endstream
+endobj
+{{include ../../xfa_locale_6_0.fragment}}
+{{include ../../xfa_postamble_7_0.fragment}}
+{{include ../../xfa_pages_8_0.fragment}}
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/javascript/xfa_specific/xfa_event_pseudomodel_expected.txt b/testing/resources/javascript/xfa_specific/xfa_event_pseudomodel_expected.txt
new file mode 100644
index 0000000..c41c8a8
--- /dev/null
+++ b/testing/resources/javascript/xfa_specific/xfa_event_pseudomodel_expected.txt
@@ -0,0 +1,34 @@
+Alert: PASS: cancelAction = false
+Alert: PASS: cancelAction = true
+Alert: PASS: change =
+Alert: PASS: change = new foo
+Alert: PASS: commitKey = 0
+Alert: PASS: commitKey = 0
+Alert: PASS: fullText =
+Alert: PASS: fullText =
+Alert: PASS: keyDown = false
+Alert: PASS: keyDown = false
+Alert: PASS: modifier = false
+Alert: PASS: modifier = false
+Alert: PASS: newContentType =
+Alert: PASS: newContentType =
+Alert: PASS: newText = new foo
+Alert: PASS: newText = new foo
+Alert: PASS: prevContentType =
+Alert: PASS: prevContentType =
+Alert: PASS: prevText =
+Alert: PASS: prevText =
+Alert: PASS: reenter = false
+Alert: PASS: reenter = false
+Alert: PASS: selEnd = 0
+Alert: PASS: selEnd = 0
+Alert: PASS: selStart = 0
+Alert: PASS: selStart = 0
+Alert: PASS: shift = false
+Alert: PASS: shift = false
+Alert: PASS: soapFaultCode =
+Alert: PASS: soapFaultCode =
+Alert: PASS: soapFaultString =
+Alert: PASS: soapFaultString =
+Alert: PASS: target = undefined
+Alert: PASS: target = undefined