| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 if sanitizer_is_enabled: | 1084 if sanitizer_is_enabled: |
| 1085 expected_results = self.remove_non_sanitizer_failures(expected_resul
ts) | 1085 expected_results = self.remove_non_sanitizer_failures(expected_resul
ts) |
| 1086 elif not pixel_tests_are_enabled: | 1086 elif not pixel_tests_are_enabled: |
| 1087 expected_results = self.remove_pixel_failures(expected_results) | 1087 expected_results = self.remove_pixel_failures(expected_results) |
| 1088 return self.result_was_expected(result, expected_results, self.is_rebase
lining(test)) | 1088 return self.result_was_expected(result, expected_results, self.is_rebase
lining(test)) |
| 1089 | 1089 |
| 1090 def is_rebaselining(self, test): | 1090 def is_rebaselining(self, test): |
| 1091 return REBASELINE in self._model.get_expectations(test) | 1091 return REBASELINE in self._model.get_expectations(test) |
| 1092 | 1092 |
| 1093 def _shorten_filename(self, filename): | 1093 def _shorten_filename(self, filename): |
| 1094 if filename.startswith(self._port.path_from_webkit_base()): | 1094 if filename.startswith(self._port.path_from_blink_base()): |
| 1095 return self._port.host.filesystem.relpath(filename, self._port.path_
from_webkit_base()) | 1095 return self._port.host.filesystem.relpath(filename, self._port.path_
from_blink_base()) |
| 1096 return filename | 1096 return filename |
| 1097 | 1097 |
| 1098 def _report_warnings(self): | 1098 def _report_warnings(self): |
| 1099 warnings = [] | 1099 warnings = [] |
| 1100 for expectation in self._expectations: | 1100 for expectation in self._expectations: |
| 1101 for warning in expectation.warnings: | 1101 for warning in expectation.warnings: |
| 1102 warnings.append('%s:%s %s %s' % ( | 1102 warnings.append('%s:%s %s %s' % ( |
| 1103 self._shorten_filename(expectation.filename), expectation.li
ne_numbers, | 1103 self._shorten_filename(expectation.filename), expectation.li
ne_numbers, |
| 1104 warning, expectation.name if expectation.expectations else e
xpectation.original_string)) | 1104 warning, expectation.name if expectation.expectations else e
xpectation.original_string)) |
| 1105 | 1105 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1202 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
| 1203 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1203 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
| 1204 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1204 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
| 1205 return expectation_line.to_string(test_configuration_converter) | 1205 return expectation_line.to_string(test_configuration_converter) |
| 1206 return expectation_line.original_string | 1206 return expectation_line.original_string |
| 1207 | 1207 |
| 1208 def nones_out(expectation_line): | 1208 def nones_out(expectation_line): |
| 1209 return expectation_line is not None | 1209 return expectation_line is not None |
| 1210 | 1210 |
| 1211 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) | 1211 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) |
| OLD | NEW |