| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 @memoized | 74 @memoized |
| 75 def _relative_baseline_search_paths(self, port_name, baseline_name): | 75 def _relative_baseline_search_paths(self, port_name, baseline_name): |
| 76 port = self._port_factory.get(port_name) | 76 port = self._port_factory.get(port_name) |
| 77 relative_paths = [self._filesystem.relpath(path, port.webkit_base()) for
path in self._baseline_search_path(port, baseline_name)] | 77 relative_paths = [self._filesystem.relpath(path, port.webkit_base()) for
path in self._baseline_search_path(port, baseline_name)] |
| 78 return relative_paths + [self._baseline_root(port, baseline_name)] | 78 return relative_paths + [self._baseline_root(port, baseline_name)] |
| 79 | 79 |
| 80 def _join_directory(self, directory, baseline_name): | 80 def _join_directory(self, directory, baseline_name): |
| 81 # This code is complicated because both the directory name and the basel
ine_name have the virtual | 81 # This code is complicated because both the directory name and the basel
ine_name have the virtual |
| 82 # test suite in the name and the virtual baseline name is not a strict s
uperset of the non-virtual name. | 82 # test suite in the name and the virtual baseline name is not a strict s
uperset of the non-virtual name. |
| 83 # For example, virtual/softwarecompositing/foo-expected.png corresponds
to compostiting/foo-expected.png and | 83 # For example, virtual/gpu/fast/canvas/foo-expected.png corresponds to f
ast/canvas/foo-expected.png and |
| 84 # the baseline directories are like platform/mac/virtual/softwarecomposi
ting. So, to get the path | 84 # the baseline directories are like platform/mac/virtual/gpu/fast/canvas
. So, to get the path |
| 85 # to the baseline in the platform directory, we need to append jsut foo-
expected.png to the directory. | 85 # to the baseline in the platform directory, we need to append jsut foo-
expected.png to the directory. |
| 86 virtual_suite = self._port_factory.get().lookup_virtual_suite(baseline_n
ame) | 86 virtual_suite = self._port_factory.get().lookup_virtual_suite(baseline_n
ame) |
| 87 if virtual_suite: | 87 if virtual_suite: |
| 88 baseline_name_without_virtual = baseline_name[len(virtual_suite.name
) + 1:] | 88 baseline_name_without_virtual = baseline_name[len(virtual_suite.name
) + 1:] |
| 89 else: | 89 else: |
| 90 baseline_name_without_virtual = baseline_name | 90 baseline_name_without_virtual = baseline_name |
| 91 return self._filesystem.join(self._scm.checkout_root, directory, baselin
e_name_without_virtual) | 91 return self._filesystem.join(self._scm.checkout_root, directory, baselin
e_name_without_virtual) |
| 92 | 92 |
| 93 def read_results_by_directory(self, baseline_name): | 93 def read_results_by_directory(self, baseline_name): |
| 94 results_by_directory = {} | 94 results_by_directory = {} |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 result = self._optimize_subtree(baseline_name) | 337 result = self._optimize_subtree(baseline_name) |
| 338 non_virtual_baseline_name = self._port_factory.get().lookup_virtual_test
_base(baseline_name) | 338 non_virtual_baseline_name = self._port_factory.get().lookup_virtual_test
_base(baseline_name) |
| 339 if not non_virtual_baseline_name: | 339 if not non_virtual_baseline_name: |
| 340 return result, self._files_to_delete, self._files_to_add | 340 return result, self._files_to_delete, self._files_to_add |
| 341 | 341 |
| 342 self._optimize_virtual_root(baseline_name, non_virtual_baseline_name) | 342 self._optimize_virtual_root(baseline_name, non_virtual_baseline_name) |
| 343 | 343 |
| 344 _log.debug("Optimizing non-virtual fallback path.") | 344 _log.debug("Optimizing non-virtual fallback path.") |
| 345 result |= self._optimize_subtree(non_virtual_baseline_name) | 345 result |= self._optimize_subtree(non_virtual_baseline_name) |
| 346 return result, self._files_to_delete, self._files_to_add | 346 return result, self._files_to_delete, self._files_to_add |
| OLD | NEW |