| 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 expected_results = self.remove_non_sanitizer_failures(expected_resul
ts) | 1090 expected_results = self.remove_non_sanitizer_failures(expected_resul
ts) |
| 1091 elif not pixel_tests_are_enabled: | 1091 elif not pixel_tests_are_enabled: |
| 1092 expected_results = self.remove_pixel_failures(expected_results) | 1092 expected_results = self.remove_pixel_failures(expected_results) |
| 1093 return self.result_was_expected(result, expected_results, self.is_rebase
lining(test)) | 1093 return self.result_was_expected(result, expected_results, self.is_rebase
lining(test)) |
| 1094 | 1094 |
| 1095 def is_rebaselining(self, test): | 1095 def is_rebaselining(self, test): |
| 1096 return REBASELINE in self._model.get_expectations(test) | 1096 return REBASELINE in self._model.get_expectations(test) |
| 1097 | 1097 |
| 1098 def _shorten_filename(self, filename): | 1098 def _shorten_filename(self, filename): |
| 1099 finder = WebKitFinder(self._port.host.filesystem) | 1099 finder = WebKitFinder(self._port.host.filesystem) |
| 1100 # TODO(tkent): Can we use path_from_layout_tests() instead? | 1100 if filename.startswith(finder.path_from_chromium_base()): |
| 1101 if filename.startswith(finder.path_from_webkit_base()): | 1101 return self._port.host.filesystem.relpath(filename, finder.path_from
_chromium_base()) |
| 1102 return self._port.host.filesystem.relpath(filename, finder.path_from
_webkit_base()) | |
| 1103 return filename | 1102 return filename |
| 1104 | 1103 |
| 1105 def _report_warnings(self): | 1104 def _report_warnings(self): |
| 1106 warnings = [] | 1105 warnings = [] |
| 1107 for expectation in self._expectations: | 1106 for expectation in self._expectations: |
| 1108 for warning in expectation.warnings: | 1107 for warning in expectation.warnings: |
| 1109 warnings.append('%s:%s %s %s' % ( | 1108 warnings.append('%s:%s %s %s' % ( |
| 1110 self._shorten_filename(expectation.filename), expectation.li
ne_numbers, | 1109 self._shorten_filename(expectation.filename), expectation.li
ne_numbers, |
| 1111 warning, expectation.name if expectation.expectations else e
xpectation.original_string)) | 1110 warning, expectation.name if expectation.expectations else e
xpectation.original_string)) |
| 1112 | 1111 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1213 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
| 1215 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1214 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
| 1216 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1215 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
| 1217 return expectation_line.to_string(test_configuration_converter) | 1216 return expectation_line.to_string(test_configuration_converter) |
| 1218 return expectation_line.original_string | 1217 return expectation_line.original_string |
| 1219 | 1218 |
| 1220 def nones_out(expectation_line): | 1219 def nones_out(expectation_line): |
| 1221 return expectation_line is not None | 1220 return expectation_line is not None |
| 1222 | 1221 |
| 1223 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) | 1222 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) |
| OLD | NEW |