summaryrefslogtreecommitdiff
path: root/testing/tools/fixup_pdf_template.py
AgeCommit message (Collapse)Author
2018-05-31Make XFA pixel tests more stablechromium/3447Ryan Harrison
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>
2018-05-15Use {{trailer}} macro in testing/resources/javascript/*.inTom Sepez
Also format the trailer in a cleaner multi-line format. Change-Id: If145834b56f8678f97247b346cc0cfd4d367c501 Reviewed-on: https://pdfium-review.googlesource.com/32571 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-02-23Setup testing XFA using .in fileschromium/3355chromium/3354Ryan Harrison
This adds a number of {{}} style tags to the .in format that allow the fix-up script to inject XFA related boilerplate into the PDF, instead of having the .in file replicate this. A simple example XFA .in file, called xfa_example.in has been added as a template for future files to follow. Finally a run_xfa_tests.py has been added for executing all of the tests in testing/resources/xfa, which from what I can tell are not executed any other way. All of the existing PDFs in that directory are currently suppressed. BUG=pdfium:1008 Change-Id: Ie055b6640969ce8291b4c96b401ebf6887dfa0c0 Reviewed-on: https://pdfium-review.googlesource.com/27631 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-02-13Teach fixup_pdf_template.py to automatically calculate stream length.Lei Zhang
BUG=pdfium:1008 Change-Id: I5136d57bd401d44b56ac19e5cfb52702afa32200 Reviewed-on: https://pdfium-review.googlesource.com/26651 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-02-13Fix nits in Python code.Lei Zhang
Change-Id: I01956bff9e7250c9df84afe6b6de96ab4e9b4851 Reviewed-on: https://pdfium-review.googlesource.com/26650 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-06-26Fix the Size trailer entry in hand written PDFs.Lei Zhang
Change-Id: Ib84cc570c2ffaf9fdd49d32bc12c7e6197e130c1 Reviewed-on: https://pdfium-review.googlesource.com/6850 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2015-09-03Merge to XFA: Change fixup_pdf_template.py to open files in binary mode.Lei Zhang
Fix for the pixel test failure on Windows from commit 870b5b6793fa. Seems to work for me on Windows. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1312493006 . (cherry picked from commit 7c9e4529f63cc2ba47dd9585058c8ee8e546bc1a) Review URL: https://codereview.chromium.org/1319183004 .
2015-02-13Merge to XFA: Run javascript/pixel tests via automated script.Tom Sepez
This pulls in: 7435e8e Run pixel tests via automated script. 83c87e5 run_javascript_tests.py: Be more flexible about directory layout. 5898509 Test top-level Document JS properties. 9f93baf Create run_javascript_tests.py TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/923293002
2015-02-05Merge to XFA: Fix segv in CPDF_DataAvail::CheckRoot()Tom Sepez
Original Review URL: https://codereview.chromium.org/895933003 BUG=454695 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/901013003
2015-01-22Merge to XFA: Add embeddertests.Tom Sepez
This brings in: 83f96a0 Add API tests: NamedDestsByName, DestGetPageIndex. 9dcd7b8 Add tests for GetNamedDests() API. TBR=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/849693007