| OLD | NEW |
| 1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 def _add_missing_baselines(self, test_result, driver_output): | 161 def _add_missing_baselines(self, test_result, driver_output): |
| 162 missingImage = test_result.has_failure_matching_types(test_failures.Fail
ureMissingImage, test_failures.FailureMissingImageHash) | 162 missingImage = test_result.has_failure_matching_types(test_failures.Fail
ureMissingImage, test_failures.FailureMissingImageHash) |
| 163 if test_result.has_failure_matching_types(test_failures.FailureMissingRe
sult): | 163 if test_result.has_failure_matching_types(test_failures.FailureMissingRe
sult): |
| 164 self._save_baseline_data(driver_output.text, '.txt', self._location_
for_new_baseline(driver_output.text, '.txt')) | 164 self._save_baseline_data(driver_output.text, '.txt', self._location_
for_new_baseline(driver_output.text, '.txt')) |
| 165 if test_result.has_failure_matching_types(test_failures.FailureMissingAu
dio): | 165 if test_result.has_failure_matching_types(test_failures.FailureMissingAu
dio): |
| 166 self._save_baseline_data(driver_output.audio, '.wav', self._location
_for_new_baseline(driver_output.audio, '.wav')) | 166 self._save_baseline_data(driver_output.audio, '.wav', self._location
_for_new_baseline(driver_output.audio, '.wav')) |
| 167 if missingImage: | 167 if missingImage: |
| 168 self._save_baseline_data(driver_output.image, '.png', self._location
_for_new_baseline(driver_output.image, '.png')) | 168 self._save_baseline_data(driver_output.image, '.png', self._location
_for_new_baseline(driver_output.image, '.png')) |
| 169 | 169 |
| 170 def _location_for_new_baseline(self, data, extension): | 170 def _location_for_new_baseline(self, data, extension): |
| 171 if self._options.add_platform_exceptions: | 171 # TODO(ojan): Remove all of this baseline location stuff now that we |
| 172 return self.VERSION_DIR | 172 # only have one baseline directory. |
| 173 if extension == '.png': | 173 |
| 174 return self.PLATFORM_DIR | 174 # if self._options.add_platform_exceptions: |
| 175 if extension == '.wav': | 175 # return self.VERSION_DIR |
| 176 return self.ALONGSIDE_TEST | 176 # if extension == '.png': |
| 177 if extension == '.txt' and self._render_tree_dump_pattern.match(data): | 177 # return self.PLATFORM_DIR |
| 178 return self.PLATFORM_DIR | 178 # if extension == '.wav': |
| 179 # return self.ALONGSIDE_TEST |
| 180 # if extension == '.txt' and self._render_tree_dump_pattern.match(data): |
| 181 # return self.PLATFORM_DIR |
| 179 return self.ALONGSIDE_TEST | 182 return self.ALONGSIDE_TEST |
| 180 | 183 |
| 181 def _overwrite_baselines(self, driver_output): | 184 def _overwrite_baselines(self, driver_output): |
| 182 location = self.VERSION_DIR if self._options.add_platform_exceptions els
e self.UPDATE | 185 location = self.VERSION_DIR if self._options.add_platform_exceptions els
e self.UPDATE |
| 183 self._save_baseline_data(driver_output.text, '.txt', location) | 186 self._save_baseline_data(driver_output.text, '.txt', location) |
| 184 self._save_baseline_data(driver_output.audio, '.wav', location) | 187 self._save_baseline_data(driver_output.audio, '.wav', location) |
| 185 if self._should_run_pixel_test: | 188 if self._should_run_pixel_test: |
| 186 self._save_baseline_data(driver_output.image, '.png', location) | 189 self._save_baseline_data(driver_output.image, '.png', location) |
| 187 | 190 |
| 188 def _save_baseline_data(self, data, extension, location): | 191 def _save_baseline_data(self, data, extension, location): |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 elif reference_driver_output.image_hash != actual_driver_output.image_ha
sh: | 414 elif reference_driver_output.image_hash != actual_driver_output.image_ha
sh: |
| 412 diff, err_str = self._port.diff_image(reference_driver_output.image,
actual_driver_output.image) | 415 diff, err_str = self._port.diff_image(reference_driver_output.image,
actual_driver_output.image) |
| 413 if diff: | 416 if diff: |
| 414 failures.append(test_failures.FailureReftestMismatch(reference_f
ilename)) | 417 failures.append(test_failures.FailureReftestMismatch(reference_f
ilename)) |
| 415 elif err_str: | 418 elif err_str: |
| 416 _log.error(err_str) | 419 _log.error(err_str) |
| 417 else: | 420 else: |
| 418 _log.warning(" %s -> ref test hashes didn't match but diff pass
ed" % self._test_name) | 421 _log.warning(" %s -> ref test hashes didn't match but diff pass
ed" % self._test_name) |
| 419 | 422 |
| 420 return TestResult(self._test_name, failures, total_test_time, has_stderr
, pid=actual_driver_output.pid) | 423 return TestResult(self._test_name, failures, total_test_time, has_stderr
, pid=actual_driver_output.pid) |
| OLD | NEW |