From aeadad1dfb7e4d3582d63dacd2ecbed71a5dd4ec Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 18 Jul 2017 16:43:41 -0400 Subject: Make progressive renderer default for pdfium_test. When Chrome renders PDF pages it uses the progressive renderer. The one shot renderer is used to render print preview pages. This CL changes pdfium_test to use the progressive renderer by default to better match Chrome. This also adds a --render-oneshot flag which will use the non-progressive renderer. Bug: chromium:736695 Change-Id: If79333ae10a0ed1c9bce1290caad8d531e6709aa Reviewed-on: https://pdfium-review.googlesource.com/8130 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- testing/tools/run_corpus_tests.py | 1 + testing/tools/test_runner.py | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'testing/tools') diff --git a/testing/tools/run_corpus_tests.py b/testing/tools/run_corpus_tests.py index 5932685f32..1175de497c 100755 --- a/testing/tools/run_corpus_tests.py +++ b/testing/tools/run_corpus_tests.py @@ -10,6 +10,7 @@ import test_runner def main(): runner = test_runner.TestRunner('corpus') runner.SetEnforceExpectedImages(True) + runner.SetOneShotRenderer(True) return runner.Run() if __name__ == '__main__': diff --git a/testing/tools/test_runner.py b/testing/tools/test_runner.py index 8f0670d33b..9524b7459b 100644 --- a/testing/tools/test_runner.py +++ b/testing/tools/test_runner.py @@ -40,6 +40,7 @@ class TestRunner: def __init__(self, dirname): self.test_dir = dirname self.enforce_expected_images = False + self.oneshot_renderer = False # GenerateAndTest returns a tuple where # success is a boolean indicating whether the tests passed comparison @@ -125,6 +126,8 @@ class TestRunner: cmd_to_run = [self.pdfium_test_path, '--send-events', '--png'] if self.gold_results: cmd_to_run.append('--md5') + if self.oneshot_renderer: + cmd_to_run.append('--render-oneshot') cmd_to_run.append(pdf_path) return common.RunCommandExtractHashedFiles(cmd_to_run) @@ -302,3 +305,7 @@ class TestRunner: def SetEnforceExpectedImages(self, new_value): """Set whether to enforce that each test case provide an expected image.""" self.enforce_expected_images = new_value + + def SetOneShotRenderer(self, new_value): + """Set whether to use the oneshot renderer. """ + self.oneshot_renderer = new_value -- cgit v1.2.3