Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py

Issue 2831883002: webkitpy: Reduce usage of path_from_webkit_base(). (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 self._http_server = None 172 self._http_server = None
173 self._websocket_server = None 173 self._websocket_server = None
174 self._wpt_server = None 174 self._wpt_server = None
175 self._image_differ = None 175 self._image_differ = None
176 self.server_process_constructor = server_process.ServerProcess # This c an be overridden for testing. 176 self.server_process_constructor = server_process.ServerProcess # This c an be overridden for testing.
177 self._http_lock = None # FIXME: Why does this live on the port object? 177 self._http_lock = None # FIXME: Why does this live on the port object?
178 self._dump_reader = None 178 self._dump_reader = None
179 179
180 # FIXME: prettypatch.py knows this path; it should not be copied here. 180 # FIXME: prettypatch.py knows this path; it should not be copied here.
181 self._pretty_patch_path = self.path_from_webkit_base('Tools', 'Scripts', 'webkitruby', 'PrettyPatch', 'prettify.rb') 181 self._pretty_patch_path = self._webkit_finder.path_from_tools_scripts('w ebkitruby', 'PrettyPatch', 'prettify.rb')
182 self._pretty_patch_available = None 182 self._pretty_patch_available = None
183 183
184 if not hasattr(options, 'configuration') or not options.configuration: 184 if not hasattr(options, 'configuration') or not options.configuration:
185 self.set_option_default('configuration', self.default_configuration( )) 185 self.set_option_default('configuration', self.default_configuration( ))
186 if not hasattr(options, 'target') or not options.target: 186 if not hasattr(options, 'target') or not options.target:
187 self.set_option_default('target', self._options.configuration) 187 self.set_option_default('target', self._options.configuration)
188 self._test_configuration = None 188 self._test_configuration = None
189 self._reftest_list = {} 189 self._reftest_list = {}
190 self._results_directory = None 190 self._results_directory = None
191 self._virtual_test_suites = None 191 self._virtual_test_suites = None
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 862
863 Args: 863 Args:
864 baseline_path: the actual path to use for baseline, not the path to 864 baseline_path: the actual path to use for baseline, not the path to
865 the test. This function is used to update either generic or 865 the test. This function is used to update either generic or
866 platform-specific baselines, but we can't infer which here. 866 platform-specific baselines, but we can't infer which here.
867 data: contents of the baseline. 867 data: contents of the baseline.
868 """ 868 """
869 self._filesystem.write_binary_file(baseline_path, data) 869 self._filesystem.write_binary_file(baseline_path, data)
870 870
871 # TODO(qyearsley): Update callers to create a finder and call it instead 871 # TODO(qyearsley): Update callers to create a finder and call it instead
872 # of these next five routines (which should be protected). 872 # of these next three routines (which should be protected).
873 def webkit_base(self): 873 def webkit_base(self):
874 return self._webkit_finder.webkit_base() 874 return self._webkit_finder.webkit_base()
875 875
876 def path_from_webkit_base(self, *comps):
877 return self._webkit_finder.path_from_webkit_base(*comps)
878
879 def path_from_chromium_base(self, *comps): 876 def path_from_chromium_base(self, *comps):
880 return self._webkit_finder.path_from_chromium_base(*comps) 877 return self._webkit_finder.path_from_chromium_base(*comps)
881 878
882 def path_to_script(self, script_name): 879 def path_to_script(self, script_name):
883 return self._webkit_finder.path_to_script(script_name) 880 return self._webkit_finder.path_to_script(script_name)
884 881
885 def layout_tests_dir(self): 882 def layout_tests_dir(self):
886 custom_layout_tests_dir = self.get_option('layout_tests_directory') 883 custom_layout_tests_dir = self.get_option('layout_tests_directory')
887 if custom_layout_tests_dir: 884 if custom_layout_tests_dir:
888 return custom_layout_tests_dir 885 return custom_layout_tests_dir
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 def bot_test_times_path(self): 1019 def bot_test_times_path(self):
1023 return self._build_path('webkit_test_times', 'bot_times_ms.json') 1020 return self._build_path('webkit_test_times', 'bot_times_ms.json')
1024 1021
1025 def perf_results_directory(self): 1022 def perf_results_directory(self):
1026 return self._build_path() 1023 return self._build_path()
1027 1024
1028 def inspector_build_directory(self): 1025 def inspector_build_directory(self):
1029 return self._build_path('resources', 'inspector') 1026 return self._build_path('resources', 'inspector')
1030 1027
1031 def apache_config_directory(self): 1028 def apache_config_directory(self):
1032 return self.path_from_webkit_base('Tools', 'Scripts', 'apache_config') 1029 return self._webkit_finder.path_from_tools_scripts('apache_config')
1033 1030
1034 def default_results_directory(self): 1031 def default_results_directory(self):
1035 """Returns the absolute path to the default place to store the test resu lts.""" 1032 """Returns the absolute path to the default place to store the test resu lts."""
1036 return self._build_path('layout-test-results') 1033 return self._build_path('layout-test-results')
1037 1034
1038 def setup_test_run(self): 1035 def setup_test_run(self):
1039 """Performs port-specific work at the beginning of a test run.""" 1036 """Performs port-specific work at the beginning of a test run."""
1040 # Delete the disk cache if any to ensure a clean test run. 1037 # Delete the disk cache if any to ensure a clean test run.
1041 dump_render_tree_binary_path = self._path_to_driver() 1038 dump_render_tree_binary_path = self._path_to_driver()
1042 cachedir = self._filesystem.dirname(dump_render_tree_binary_path) 1039 cachedir = self._filesystem.dirname(dump_render_tree_binary_path)
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 1619
1623 def __init__(self, base, args, reference_args=None): 1620 def __init__(self, base, args, reference_args=None):
1624 self.name = base 1621 self.name = base
1625 self.base = base 1622 self.base = base
1626 self.args = args 1623 self.args = args
1627 self.reference_args = args if reference_args is None else reference_args 1624 self.reference_args = args if reference_args is None else reference_args
1628 self.tests = set() 1625 self.tests = set()
1629 1626
1630 def __repr__(self): 1627 def __repr__(self):
1631 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1628 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698