| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 def get_test_baselines(test_file, test_config): | 162 def get_test_baselines(test_file, test_config): |
| 163 | 163 |
| 164 # FIXME: This seems like a hack. This only seems used to access the Port.exp
ected_baselines logic. | 164 # FIXME: This seems like a hack. This only seems used to access the Port.exp
ected_baselines logic. |
| 165 # Also, abstract method path_to_apache is not overidden; this will be fixed
if this function is changed | 165 # Also, abstract method path_to_apache is not overidden; this will be fixed
if this function is changed |
| 166 # to not use a sub-class of Port. pylint: disable=abstract-method | 166 # to not use a sub-class of Port. pylint: disable=abstract-method |
| 167 class AllPlatformsPort(Port): | 167 class AllPlatformsPort(Port): |
| 168 | 168 |
| 169 def __init__(self, host): | 169 def __init__(self, host): |
| 170 super(AllPlatformsPort, self).__init__(host, 'mac') | 170 super(AllPlatformsPort, self).__init__(host, 'mac') |
| 171 self._platforms_by_directory = dict([(self._webkit_baseline_path(p),
p) for p in test_config.platforms]) | 171 self._platforms_by_directory = dict([(self._absolute_baseline_path(p
), p) for p in test_config.platforms]) |
| 172 | 172 |
| 173 def baseline_search_path(self): | 173 def baseline_search_path(self): |
| 174 return self._platforms_by_directory.keys() | 174 return self._platforms_by_directory.keys() |
| 175 | 175 |
| 176 def platform_from_directory(self, directory): | 176 def platform_from_directory(self, directory): |
| 177 return self._platforms_by_directory[directory] | 177 return self._platforms_by_directory[directory] |
| 178 | 178 |
| 179 all_platforms_port = AllPlatformsPort(test_config.host) | 179 all_platforms_port = AllPlatformsPort(test_config.host) |
| 180 | 180 |
| 181 all_test_baselines = {} | 181 all_test_baselines = {} |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 elif mode == 'diff-text': | 276 elif mode == 'diff-text': |
| 277 file_name = test_name + '-diff.txt' | 277 file_name = test_name + '-diff.txt' |
| 278 elif mode == 'diff-text-pretty': | 278 elif mode == 'diff-text-pretty': |
| 279 file_name = test_name + '-pretty-diff.html' | 279 file_name = test_name + '-pretty-diff.html' |
| 280 | 280 |
| 281 file_path = os.path.join(self.server.test_config.results_directory, file
_name) | 281 file_path = os.path.join(self.server.test_config.results_directory, file
_name) |
| 282 | 282 |
| 283 # Let results be cached for 60 seconds, so that they can be pre-fetched | 283 # Let results be cached for 60 seconds, so that they can be pre-fetched |
| 284 # by the UI | 284 # by the UI |
| 285 self._serve_file(file_path, cacheable_seconds=60) | 285 self._serve_file(file_path, cacheable_seconds=60) |
| OLD | NEW |