Move XFA pixel tests under pixel/ This removes the need for them to have their own runner. Due to other upstream changes some of the expectation files needed to be updated. The suppressions have been updated to make sure the tests do not run for non-XFA builds. Having these tests run on the bots surfaced an MSAN issue in the XFA code, which is fixed in this CL. BUG=pdfium:1020,pdfium:1008 Change-Id: I44e2fa1cba2d07f30f56f5792749acbe1ebf4b62 Reviewed-on: https://pdfium-review.googlesource.com/27710 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS index ce852fd..2572203 100644 --- a/testing/SUPPRESSIONS +++ b/testing/SUPPRESSIONS
@@ -322,13 +322,12 @@ bug_492.in * nov8 * # -# XFA Tests -# +# xfa_specific + # TODO(rharrison): Create expectations for existing files. barcode_test.pdf * * * dynamic_list_box_allow_multiple_selection.pdf * * * dynamic_password_field_background_fill.pdf * * * -email_recommended.pdf * * * resolve_nodes.pdf * * * standard_symbols.pdf * * * xfa_node_caption.pdf * * *
diff --git a/testing/resources/xfa/barcode_test.pdf b/testing/resources/pixel/xfa_specific/barcode_test.pdf similarity index 100% rename from testing/resources/xfa/barcode_test.pdf rename to testing/resources/pixel/xfa_specific/barcode_test.pdf Binary files differ
diff --git a/testing/resources/xfa/dynamic_list_box_allow_multiple_selection.pdf b/testing/resources/pixel/xfa_specific/dynamic_list_box_allow_multiple_selection.pdf similarity index 100% rename from testing/resources/xfa/dynamic_list_box_allow_multiple_selection.pdf rename to testing/resources/pixel/xfa_specific/dynamic_list_box_allow_multiple_selection.pdf Binary files differ
diff --git a/testing/resources/xfa/dynamic_password_field_background_fill.pdf b/testing/resources/pixel/xfa_specific/dynamic_password_field_background_fill.pdf similarity index 100% rename from testing/resources/xfa/dynamic_password_field_background_fill.pdf rename to testing/resources/pixel/xfa_specific/dynamic_password_field_background_fill.pdf Binary files differ
diff --git a/testing/resources/xfa/dynamic_table_color_and_width.pdf b/testing/resources/pixel/xfa_specific/dynamic_table_color_and_width.pdf similarity index 100% rename from testing/resources/xfa/dynamic_table_color_and_width.pdf rename to testing/resources/pixel/xfa_specific/dynamic_table_color_and_width.pdf Binary files differ
diff --git a/testing/resources/xfa/dynamic_table_color_and_width_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/dynamic_table_color_and_width_expected.pdf.0.png similarity index 100% rename from testing/resources/xfa/dynamic_table_color_and_width_expected.pdf.0.png rename to testing/resources/pixel/xfa_specific/dynamic_table_color_and_width_expected.pdf.0.png Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/dynamic_table_color_and_width_expected_win.pdf.0.png b/testing/resources/pixel/xfa_specific/dynamic_table_color_and_width_expected_win.pdf.0.png new file mode 100644 index 0000000..fc31cfa --- /dev/null +++ b/testing/resources/pixel/xfa_specific/dynamic_table_color_and_width_expected_win.pdf.0.png Binary files differ
diff --git a/testing/resources/xfa/resolve_nodes.pdf b/testing/resources/pixel/xfa_specific/resolve_nodes.pdf similarity index 100% rename from testing/resources/xfa/resolve_nodes.pdf rename to testing/resources/pixel/xfa_specific/resolve_nodes.pdf Binary files differ
diff --git a/testing/resources/xfa/standard_symbols.pdf b/testing/resources/pixel/xfa_specific/standard_symbols.pdf similarity index 100% rename from testing/resources/xfa/standard_symbols.pdf rename to testing/resources/pixel/xfa_specific/standard_symbols.pdf Binary files differ
diff --git a/testing/resources/xfa/static_list_box_caption.pdf b/testing/resources/pixel/xfa_specific/static_list_box_caption.pdf similarity index 100% rename from testing/resources/xfa/static_list_box_caption.pdf rename to testing/resources/pixel/xfa_specific/static_list_box_caption.pdf Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/static_list_box_caption_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/static_list_box_caption_expected.pdf.0.png new file mode 100644 index 0000000..45a8983 --- /dev/null +++ b/testing/resources/pixel/xfa_specific/static_list_box_caption_expected.pdf.0.png Binary files differ
diff --git a/testing/resources/xfa/static_list_box_caption_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/static_list_box_caption_expected_mac.pdf.0.png similarity index 100% rename from testing/resources/xfa/static_list_box_caption_expected.pdf.0.png rename to testing/resources/pixel/xfa_specific/static_list_box_caption_expected_mac.pdf.0.png Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/static_list_box_caption_expected_win.pdf.0.png b/testing/resources/pixel/xfa_specific/static_list_box_caption_expected_win.pdf.0.png new file mode 100644 index 0000000..71edafd --- /dev/null +++ b/testing/resources/pixel/xfa_specific/static_list_box_caption_expected_win.pdf.0.png Binary files differ
diff --git a/testing/resources/xfa/static_password_field_rotate.pdf b/testing/resources/pixel/xfa_specific/static_password_field_rotate.pdf similarity index 100% rename from testing/resources/xfa/static_password_field_rotate.pdf rename to testing/resources/pixel/xfa_specific/static_password_field_rotate.pdf Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected.pdf.0.png new file mode 100644 index 0000000..d49fc36 --- /dev/null +++ b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected.pdf.0.png Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected.pdf.1.png b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected.pdf.1.png new file mode 100644 index 0000000..3e60b4d --- /dev/null +++ b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected.pdf.1.png Binary files differ
diff --git a/testing/resources/xfa/static_password_field_rotate_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_mac.pdf.0.png similarity index 100% rename from testing/resources/xfa/static_password_field_rotate_expected.pdf.0.png rename to testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_mac.pdf.0.png Binary files differ
diff --git a/testing/resources/xfa/static_password_field_rotate_expected.pdf.1.png b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_mac.pdf.1.png similarity index 100% rename from testing/resources/xfa/static_password_field_rotate_expected.pdf.1.png rename to testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_mac.pdf.1.png Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_win.pdf.0.png b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_win.pdf.0.png new file mode 100644 index 0000000..9530509 --- /dev/null +++ b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_win.pdf.0.png Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_win.pdf.1.png b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_win.pdf.1.png new file mode 100644 index 0000000..3e60b4d --- /dev/null +++ b/testing/resources/pixel/xfa_specific/static_password_field_rotate_expected_win.pdf.1.png Binary files differ
diff --git a/testing/resources/xfa/xfa_example.in b/testing/resources/pixel/xfa_specific/xfa_example.in similarity index 100% rename from testing/resources/xfa/xfa_example.in rename to testing/resources/pixel/xfa_specific/xfa_example.in
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 new file mode 100644 index 0000000..81c317a --- /dev/null +++ b/testing/resources/pixel/xfa_specific/xfa_example_expected.pdf.0.png Binary files differ
diff --git a/testing/resources/xfa/xfa_example_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_example_expected_mac.pdf.0.png similarity index 100% rename from testing/resources/xfa/xfa_example_expected.pdf.0.png rename to testing/resources/pixel/xfa_specific/xfa_example_expected_mac.pdf.0.png Binary files differ
diff --git a/testing/resources/xfa/xfa_example_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_example_expected_win.pdf.0.png similarity index 100% copy from testing/resources/xfa/xfa_example_expected.pdf.0.png copy to testing/resources/pixel/xfa_specific/xfa_example_expected_win.pdf.0.png Binary files differ
diff --git a/testing/resources/xfa/xfa_node_caption.pdf b/testing/resources/pixel/xfa_specific/xfa_node_caption.pdf similarity index 100% rename from testing/resources/xfa/xfa_node_caption.pdf rename to testing/resources/pixel/xfa_specific/xfa_node_caption.pdf Binary files differ
diff --git a/testing/tools/run_xfa_tests.py b/testing/tools/run_xfa_tests.py deleted file mode 100755 index 6647cfd..0000000 --- a/testing/tools/run_xfa_tests.py +++ /dev/null
@@ -1,16 +0,0 @@ -#!/usr/bin/env python -# Copyright 2018 The PDFium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import sys - -import test_runner - -def main(): - runner = test_runner.TestRunner('xfa') - runner.SetEnforceExpectedImages(True) - return runner.Run() - -if __name__ == '__main__': - sys.exit(main())
diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp index bcadbea..a957147 100644 --- a/xfa/fxfa/cxfa_textparser.cpp +++ b/xfa/fxfa/cxfa_textparser.cpp
@@ -434,9 +434,11 @@ void CXFA_TextParser::GetLinethrough(CXFA_TextProvider* pTextProvider, CFX_CSSComputedStyle* pStyle, int32_t& iLinethrough) const { + iLinethrough = 0; if (pStyle) { uint32_t dwDecoration = pStyle->GetTextDecoration(); - iLinethrough = (dwDecoration & CFX_CSSTEXTDECORATION_LineThrough) ? 1 : 0; + if (dwDecoration & CFX_CSSTEXTDECORATION_LineThrough) + iLinethrough = 1; return; }