summaryrefslogtreecommitdiff
path: root/testing/resources
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-05-31 19:26:52 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-31 19:26:52 +0000
commit1118a66bfe024e137324075ac4d9433b9425e373 (patch)
tree54b52b97df28789dd22c1619ef96d67d8ac0d77f /testing/resources
parent9bff799490de4ac9da53d708f547d106f28d5c72 (diff)
downloadpdfium-chromium/3447.tar.xz
Make XFA pixel tests more stablechromium/3447
When generating PDFs using the fixup script and a .in, specify them to to use Ahem.ttf as the text font. Ahem is a font designed to reduce flakiness in pixel tests due to font rendering differences between platforms. Specifically the glyphs in the font are standard size black boxes, so though the specific text content cannot be easily compared, things like layout and high level changes to the content can still be tested. Testing things like specific text changes should be done via an embedder test, where the strings in the elements can be extracted and inspected. The font itself is is CID type 2 font, which is relatively complex to correctly embed in a PDF due to subsetting and other features. Instead of embedding it in the generated PDFs, which was originally attempted, it is being supplied to pdfium_test via the --font-dir flag. This flag overrides where the binary looks for system fonts. This works correctly on Mac and Linux, but not on Windows, which is why that platform remains suppressed. BUG=pdfium:1008,pdfium:1020 Change-Id: I00811536de98f736fc599d96b397194ccf8db0cd Reviewed-on: https://pdfium-review.googlesource.com/27790 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'testing/resources')
-rw-r--r--testing/resources/fonts/Ahem.ttfbin0 -> 21768 bytes
-rw-r--r--testing/resources/pixel/xfa_specific/use_ahem/xfa_example.in (renamed from testing/resources/pixel/xfa_specific/xfa_example.in)3
-rw-r--r--testing/resources/pixel/xfa_specific/use_ahem/xfa_example_expected.pdf.0.png (renamed from testing/resources/pixel/xfa_specific/xfa_example_expected_mac.pdf.0.png)bin4806 -> 3700 bytes
-rw-r--r--testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield.evt (renamed from testing/resources/pixel/xfa_specific/xfa_textfield.evt)2
-rw-r--r--testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield.in (renamed from testing/resources/pixel/xfa_specific/xfa_textfield.in)26
-rw-r--r--testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield_expected.pdf.0.png (renamed from testing/resources/pixel/xfa_specific/xfa_textfield_expected_mac.pdf.0.png)bin4496 -> 3919 bytes
-rw-r--r--testing/resources/pixel/xfa_specific/xfa_example_expected.pdf.0.pngbin5073 -> 0 bytes
-rw-r--r--testing/resources/pixel/xfa_specific/xfa_example_expected_win.pdf.0.pngbin4806 -> 0 bytes
-rw-r--r--testing/resources/pixel/xfa_specific/xfa_textfield_expected.pdf.0.pngbin4510 -> 0 bytes
-rw-r--r--testing/resources/pixel/xfa_specific/xfa_textfield_expected_win.pdf.0.pngbin4496 -> 0 bytes
10 files changed, 24 insertions, 7 deletions
diff --git a/testing/resources/fonts/Ahem.ttf b/testing/resources/fonts/Ahem.ttf
new file mode 100644
index 0000000000..4d4785a412
--- /dev/null
+++ b/testing/resources/fonts/Ahem.ttf
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_example.in b/testing/resources/pixel/xfa_specific/use_ahem/xfa_example.in
index d8be96f305..0e9ac151d5 100644
--- a/testing/resources/pixel/xfa_specific/xfa_example.in
+++ b/testing/resources/pixel/xfa_specific/use_ahem/xfa_example.in
@@ -1,6 +1,5 @@
{{header}}
-%% Original object ID: 24 0
{{object 1 0}}
<<
/AcroForm 2 0 R
@@ -15,7 +14,6 @@
>>
endobj
-%% Original object ID: 32 0
{{object 2 0}}
<<
/XFA [
@@ -51,6 +49,7 @@ stream
</pageSet>
<subform w="576pt" h="756pt" name="Page1">
<draw name="HelloWorld" y="0.5in" x="0.5in" w="5in" h="2in">
+ <font typeface="Ahem" size="20pt"/>
<value>
<text>Hello, world.</text>
</value>
diff --git a/testing/resources/pixel/xfa_specific/xfa_example_expected_mac.pdf.0.png b/testing/resources/pixel/xfa_specific/use_ahem/xfa_example_expected.pdf.0.png
index 9a682f7186..e1e62cce18 100644
--- a/testing/resources/pixel/xfa_specific/xfa_example_expected_mac.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/use_ahem/xfa_example_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_textfield.evt b/testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield.evt
index 3d110568ec..1279468006 100644
--- a/testing/resources/pixel/xfa_specific/xfa_textfield.evt
+++ b/testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield.evt
@@ -1,4 +1,3 @@
-mousemove,20,20
mousedown,left,20,20
charcode,72
charcode,101
@@ -6,3 +5,4 @@ charcode,108
charcode,108
charcode,111
charcode,33
+mousedown,left,20,60
diff --git a/testing/resources/pixel/xfa_specific/xfa_textfield.in b/testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield.in
index bdd685009f..218dbcec96 100644
--- a/testing/resources/pixel/xfa_specific/xfa_textfield.in
+++ b/testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield.in
@@ -50,12 +50,30 @@ stream
</pageArea>
</pageSet>
<subform w="576pt" h="756pt" name="Page1">
- <field name="TextField1" y="0pt" x="0pt" w="425pt" h="20pt">
+ <field name="TextField1" y="0pt" x="0pt" w="200pt" h="32pt">
+ <font typeface="Ahem" size="20pt"/>
<ui>
- <textEdit>
- <font typeface="Helvetica" size="16pt"/>
- </textEdit>
+ <textEdit/>
</ui>
+ <para vAlign="middle"/>
+ </field>
+ <field name="Button1" y="42pt" x="0pt" w="100pt" h="32pt">
+ <ui>
+ <button highlight="inverted"/>
+ </ui>
+ <font typeface="Ahem" size="20pt"/>
+ <caption>
+ <value>
+ <text>Dummy</text>
+ </value>
+ <para vAlign="middle" hAlign="center"/>
+ </caption>
+ <border hand="right">
+ <edge stroke="raised"/>
+ <fill>
+ <color value="212,208,200"/>
+ </fill>
+ </border>
</field>
</subform>
</subform>
diff --git a/testing/resources/pixel/xfa_specific/xfa_textfield_expected_mac.pdf.0.png b/testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield_expected.pdf.0.png
index c4d4ce5a22..4d9a934c11 100644
--- a/testing/resources/pixel/xfa_specific/xfa_textfield_expected_mac.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/use_ahem/xfa_textfield_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_example_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_example_expected.pdf.0.png
deleted file mode 100644
index 81c317a1e7..0000000000
--- a/testing/resources/pixel/xfa_specific/xfa_example_expected.pdf.0.png
+++ /dev/null
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_example_expected_win.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_example_expected_win.pdf.0.png
deleted file mode 100644
index 9a682f7186..0000000000
--- a/testing/resources/pixel/xfa_specific/xfa_example_expected_win.pdf.0.png
+++ /dev/null
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_textfield_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_textfield_expected.pdf.0.png
deleted file mode 100644
index e5ad5012cd..0000000000
--- a/testing/resources/pixel/xfa_specific/xfa_textfield_expected.pdf.0.png
+++ /dev/null
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_textfield_expected_win.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_textfield_expected_win.pdf.0.png
deleted file mode 100644
index c4d4ce5a22..0000000000
--- a/testing/resources/pixel/xfa_specific/xfa_textfield_expected_win.pdf.0.png
+++ /dev/null
Binary files differ