OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The PDFium Authors. All rights reserved. | 2 # Copyright 2016 The PDFium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import optparse | 6 import optparse |
7 import os | 7 import os |
8 import re | 8 import re |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 cmd_to_run = common.DrMemoryWrapper(self.drmem_wrapper, input_root) | 84 cmd_to_run = common.DrMemoryWrapper(self.drmem_wrapper, input_root) |
85 cmd_to_run.extend([self.pdfium_test_path, pdf_path]) | 85 cmd_to_run.extend([self.pdfium_test_path, pdf_path]) |
86 subprocess.check_call(cmd_to_run, stdout=outfile) | 86 subprocess.check_call(cmd_to_run, stdout=outfile) |
87 | 87 |
88 cmd = [sys.executable, self.text_diff_path, expected_txt_path, txt_path] | 88 cmd = [sys.executable, self.text_diff_path, expected_txt_path, txt_path] |
89 return common.RunCommand(cmd) | 89 return common.RunCommand(cmd) |
90 | 90 |
91 | 91 |
92 def TestPixel(self, input_root, pdf_path): | 92 def TestPixel(self, input_root, pdf_path): |
93 cmd_to_run = common.DrMemoryWrapper(self.drmem_wrapper, input_root) | 93 cmd_to_run = common.DrMemoryWrapper(self.drmem_wrapper, input_root) |
94 cmd_to_run.extend([self.pdfium_test_path, '--png', pdf_path]) | 94 cmd_to_run.extend([self.pdfium_test_path, '--send-events', '--png', |
| 95 pdf_path]) |
95 return common.RunCommand(cmd_to_run) | 96 return common.RunCommand(cmd_to_run) |
96 | 97 |
97 | 98 |
98 def HandleResult(self, input_filename, input_path, result): | 99 def HandleResult(self, input_filename, input_path, result): |
99 if self.test_suppressor.IsResultSuppressed(input_filename): | 100 if self.test_suppressor.IsResultSuppressed(input_filename): |
100 if result: | 101 if result: |
101 self.surprises.append(input_path) | 102 self.surprises.append(input_path) |
102 else: | 103 else: |
103 if not result: | 104 if not result: |
104 self.failures.append(input_path) | 105 self.failures.append(input_path) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 print surprise; | 178 print surprise; |
178 | 179 |
179 if self.failures: | 180 if self.failures: |
180 self.failures.sort() | 181 self.failures.sort() |
181 print '\n\nSummary of Failures:' | 182 print '\n\nSummary of Failures:' |
182 for failure in self.failures: | 183 for failure in self.failures: |
183 print failure | 184 print failure |
184 return 1 | 185 return 1 |
185 | 186 |
186 return 0 | 187 return 0 |
OLD | NEW |