Get code coverage for CPDFSDK_Widget::Synchronize()
These tests require a mixed XFA form (i.e. no <config> XFA section,
just a <template> section, say) with a PDF widget not overlapped by
an XFA widget, and an XFA widget linked by the same name to the PDF
widget.
Send a click then type into the PDF widget to force it to sync
with the XFA one.
Change-Id: I71c5b346770b7da3045322b6af5765703f188556
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/104512
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/testing/resources/javascript/xfa_specific/mixed_widgets.evt b/testing/resources/javascript/xfa_specific/mixed_widgets.evt
new file mode 100644
index 0000000..f4ee07d
--- /dev/null
+++ b/testing/resources/javascript/xfa_specific/mixed_widgets.evt
@@ -0,0 +1,5 @@
+mousemove,302,302
+mousedown,left,302,302
+mouseup,left,302,302
+charcode,65
+charcode,66
diff --git a/testing/resources/javascript/xfa_specific/mixed_widgets.in b/testing/resources/javascript/xfa_specific/mixed_widgets.in
new file mode 100644
index 0000000..2974112
--- /dev/null
+++ b/testing/resources/javascript/xfa_specific/mixed_widgets.in
@@ -0,0 +1,48 @@
+{{header}}
+{{object 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+ /NeedsRendering true
+ /AcroForm <<
+ /Fields [6 0 R]
+ /XFA 5 0 R
+ >>
+>>
+endobj
+{{object 2 0}} <<
+ /Type /Pages
+ /Count 1
+ /Kids [4 0 R]
+>>
+endobj
+{{object 4 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [0 0 512 512]
+ /Annots [6 0 R]
+>>
+endobj
+{{object 5 0}} <<
+ {{streamlen}}
+>>
+stream
+<xdp xmlns="http://ns.adobe.com/xdp/">
+ <template>
+ <subform x="0pt" y="0pt" w="198pt" h="198pt">
+ <field name="MyBox"/>
+ </subform>
+ </template>
+</xdp>
+endstream
+endobj
+{{object 6 0}} <<
+ /Type /Annot
+ /Subtype /Widget
+ /FT /Tx
+ /Rect [200 200 512 512]
+ /T (MyBox)
+>>
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF