| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 filesystem.maybe_make_directory(filesystem.dirname(target_baseline)) | 242 filesystem.maybe_make_directory(filesystem.dirname(target_baseline)) |
| 243 filesystem.write_binary_file(target_baseline, data) | 243 filesystem.write_binary_file(target_baseline, data) |
| 244 | 244 |
| 245 def _rebaseline_test(self, builder_name, test_name, suffix, results_url): | 245 def _rebaseline_test(self, builder_name, test_name, suffix, results_url): |
| 246 baseline_directory = self._baseline_directory(builder_name) | 246 baseline_directory = self._baseline_directory(builder_name) |
| 247 | 247 |
| 248 source_baseline = "%s/%s" % (results_url, self._file_name_for_actual_res
ult(test_name, suffix)) | 248 source_baseline = "%s/%s" % (results_url, self._file_name_for_actual_res
ult(test_name, suffix)) |
| 249 target_baseline = self._tool.filesystem.join(baseline_directory, self._f
ile_name_for_expected_result(test_name, suffix)) | 249 target_baseline = self._tool.filesystem.join(baseline_directory, self._f
ile_name_for_expected_result(test_name, suffix)) |
| 250 | 250 |
| 251 _log.debug("Retrieving source %s for target %s.", source_baseline, targe
t_baseline) | 251 _log.debug("Retrieving source %s for target %s.", source_baseline, targe
t_baseline) |
| 252 self._save_baseline(self._tool.web.get_binary(source_baseline, convert_4
04_to_None=True), | 252 self._save_baseline(self._tool.web.get_binary(source_baseline, return_no
ne_on_404=True), |
| 253 target_baseline) | 253 target_baseline) |
| 254 | 254 |
| 255 def _rebaseline_test_and_update_expectations(self, options): | 255 def _rebaseline_test_and_update_expectations(self, options): |
| 256 self._baseline_suffix_list = options.suffixes.split(',') | 256 self._baseline_suffix_list = options.suffixes.split(',') |
| 257 | 257 |
| 258 port = self._tool.port_factory.get_from_builder_name(options.builder) | 258 port = self._tool.port_factory.get_from_builder_name(options.builder) |
| 259 if port.reference_files(options.test): | 259 if port.reference_files(options.test): |
| 260 if 'png' in self._baseline_suffix_list: | 260 if 'png' in self._baseline_suffix_list: |
| 261 _log.warning("Cannot rebaseline image result for reftest: %s", o
ptions.test) | 261 _log.warning("Cannot rebaseline image result for reftest: %s", o
ptions.test) |
| 262 return | 262 return |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 for test in args: | 717 for test in args: |
| 718 if test not in test_prefix_list: | 718 if test not in test_prefix_list: |
| 719 test_prefix_list[test] = {} | 719 test_prefix_list[test] = {} |
| 720 build = Build(builder) | 720 build = Build(builder) |
| 721 test_prefix_list[test][build] = suffixes_to_update | 721 test_prefix_list[test][build] = suffixes_to_update |
| 722 | 722 |
| 723 if options.verbose: | 723 if options.verbose: |
| 724 _log.debug("rebaseline-json: " + str(test_prefix_list)) | 724 _log.debug("rebaseline-json: " + str(test_prefix_list)) |
| 725 | 725 |
| 726 self.rebaseline(options, test_prefix_list) | 726 self.rebaseline(options, test_prefix_list) |
| OLD | NEW |