Add test case for PDF password annotations

Show that these get rendered as '*' in a password field, but
as typed characters in a non-password field.

-- Also show how the result is truncated by the maxlen attribute.
-- Also show center and right justification.

Change-Id: I2c622c0d002087883919dcda3105bec16ca67caa
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/66350
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/resources/pixel/password.evt b/testing/resources/pixel/password.evt
new file mode 100644
index 0000000..3051015
--- /dev/null
+++ b/testing/resources/pixel/password.evt
@@ -0,0 +1,26 @@
+mousemove,102,102
+mousedown,left,102,102
+mouseup,left,102,102
+charcode,116
+charcode,105
+charcode,103
+charcode,101
+charcode,114
+charcode,115
+charcode,115
+charcode,115
+charcode,115
+
+mousemove,102,162
+mousedown,left,102,162
+mouseup,left,102,162
+charcode,116
+charcode,105
+charcode,103
+charcode,101
+charcode,114
+charcode,115
+charcode,115
+charcode,115
+charcode,115
+
diff --git a/testing/resources/pixel/password.in b/testing/resources/pixel/password.in
new file mode 100644
index 0000000..a50f0af
--- /dev/null
+++ b/testing/resources/pixel/password.in
@@ -0,0 +1,54 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+  /AcroForm <<
+    /Fields [
+      4 0 R
+      5 0 R
+    ]
+    /NeedAppearances true
+  >>
+>>
+endobj
+{{object 2 0}} <<
+  /Type /Pages
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /MediaBox [ 0 0 300 200 ]
+  /Annots [
+    4 0 R
+    5 0 R
+  ]
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Annot
+  /Subtype /Widget
+  /FT /Tx
+  /T (Text Box)
+  /Rect [ 100 100 200 130 ]
+  /MaxLen 5
+  /Q 1
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Annot
+  /Subtype /Widget
+  /FT /Tx
+  /Ff 8192
+  /T (Password Box)
+  /Rect [ 100 160 200 190 ]
+  /MaxLen 5
+  /Q 2
+>>
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/password_expected.pdf.0.png b/testing/resources/pixel/password_expected.pdf.0.png
new file mode 100644
index 0000000..caf4f4a
--- /dev/null
+++ b/testing/resources/pixel/password_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/password_expected_mac.pdf.0.png b/testing/resources/pixel/password_expected_mac.pdf.0.png
new file mode 100644
index 0000000..32da8e9
--- /dev/null
+++ b/testing/resources/pixel/password_expected_mac.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/password_expected_win.pdf.0.png b/testing/resources/pixel/password_expected_win.pdf.0.png
new file mode 100644
index 0000000..d6d826c
--- /dev/null
+++ b/testing/resources/pixel/password_expected_win.pdf.0.png
Binary files differ