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

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

Issue 2454323004: Make layout test harness extensible with custom layout tests directory (Closed)
Patch Set: move apache config to Tools/Scripts Created 4 years, 1 month 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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 def path_from_webkit_base(self, *comps): 910 def path_from_webkit_base(self, *comps):
911 return self._webkit_finder.path_from_webkit_base(*comps) 911 return self._webkit_finder.path_from_webkit_base(*comps)
912 912
913 def path_from_chromium_base(self, *comps): 913 def path_from_chromium_base(self, *comps):
914 return self._webkit_finder.path_from_chromium_base(*comps) 914 return self._webkit_finder.path_from_chromium_base(*comps)
915 915
916 def path_to_script(self, script_name): 916 def path_to_script(self, script_name):
917 return self._webkit_finder.path_to_script(script_name) 917 return self._webkit_finder.path_to_script(script_name)
918 918
919 def layout_tests_dir(self): 919 def layout_tests_dir(self):
920 custom_layout_tests_dir = self.get_option('layout_tests_directory')
921 if custom_layout_tests_dir:
922 return custom_layout_tests_dir
Dirk Pranke 2016/10/31 23:14:50 You can change this to def layout_tests_dir(self
chenwilliam 2016/11/01 18:28:35 I tried it, but it doesn't seem to work because op
920 return self._webkit_finder.layout_tests_dir() 923 return self._webkit_finder.layout_tests_dir()
921 924
922 def perf_tests_dir(self): 925 def perf_tests_dir(self):
923 return self._webkit_finder.perf_tests_dir() 926 return self._webkit_finder.perf_tests_dir()
924 927
925 def skipped_layout_tests(self, test_list): 928 def skipped_layout_tests(self, test_list):
926 """Returns tests skipped outside of the TestExpectations files.""" 929 """Returns tests skipped outside of the TestExpectations files."""
927 return set(self._skipped_tests_for_unsupported_features(test_list)) 930 return set(self._skipped_tests_for_unsupported_features(test_list))
928 931
929 def skips_test(self, test, generic_expectations, full_expectations): 932 def skips_test(self, test, generic_expectations, full_expectations):
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 1048
1046 def perf_results_directory(self): 1049 def perf_results_directory(self):
1047 return self._build_path() 1050 return self._build_path()
1048 1051
1049 def inspector_build_directory(self): 1052 def inspector_build_directory(self):
1050 return self._build_path('resources', 'inspector') 1053 return self._build_path('resources', 'inspector')
1051 1054
1052 def inspector_debug_directory(self): 1055 def inspector_debug_directory(self):
1053 return self.path_from_webkit_base('Source', 'devtools', 'front_end') 1056 return self.path_from_webkit_base('Source', 'devtools', 'front_end')
1054 1057
1058 def apache_config_directory(self):
1059 return self.path_from_webkit_base('Tools', 'Scripts', 'apache_config')
1060
1055 def default_results_directory(self): 1061 def default_results_directory(self):
1056 """Absolute path to the default place to store the test results.""" 1062 """Absolute path to the default place to store the test results."""
1057 return self._build_path('layout-test-results') 1063 return self._build_path('layout-test-results')
1058 1064
1059 def setup_test_run(self): 1065 def setup_test_run(self):
1060 """Perform port-specific work at the beginning of a test run.""" 1066 """Perform port-specific work at the beginning of a test run."""
1061 # Delete the disk cache if any to ensure a clean test run. 1067 # Delete the disk cache if any to ensure a clean test run.
1062 dump_render_tree_binary_path = self._path_to_driver() 1068 dump_render_tree_binary_path = self._path_to_driver()
1063 cachedir = self._filesystem.dirname(dump_render_tree_binary_path) 1069 cachedir = self._filesystem.dirname(dump_render_tree_binary_path)
1064 cachedir = self._filesystem.join(cachedir, "cache") 1070 cachedir = self._filesystem.join(cachedir, "cache")
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 1503
1498 This is needed only by ports that use the apache_http_server module. 1504 This is needed only by ports that use the apache_http_server module.
1499 """ 1505 """
1500 config_file_from_env = self.host.environ.get('WEBKIT_HTTP_SERVER_CONF_PA TH') 1506 config_file_from_env = self.host.environ.get('WEBKIT_HTTP_SERVER_CONF_PA TH')
1501 if config_file_from_env: 1507 if config_file_from_env:
1502 if not self._filesystem.exists(config_file_from_env): 1508 if not self._filesystem.exists(config_file_from_env):
1503 raise IOError('%s was not found on the system' % config_file_fro m_env) 1509 raise IOError('%s was not found on the system' % config_file_fro m_env)
1504 return config_file_from_env 1510 return config_file_from_env
1505 1511
1506 config_file_name = self._apache_config_file_name_for_platform() 1512 config_file_name = self._apache_config_file_name_for_platform()
1507 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', co nfig_file_name) 1513 return self._filesystem.join(self.apache_config_directory(), config_file _name)
1508 1514
1509 # 1515 #
1510 # PROTECTED ROUTINES 1516 # PROTECTED ROUTINES
1511 # 1517 #
1512 # The routines below should only be called by routines in this class 1518 # The routines below should only be called by routines in this class
1513 # or any of its subclasses. 1519 # or any of its subclasses.
1514 # 1520 #
1515 1521
1516 def _apache_version(self): 1522 def _apache_version(self):
1517 config = self._executive.run_command([self.path_to_apache(), '-v']) 1523 config = self._executive.run_command([self.path_to_apache(), '-v'])
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 1850
1845 def __init__(self, base, args, reference_args=None): 1851 def __init__(self, base, args, reference_args=None):
1846 self.name = base 1852 self.name = base
1847 self.base = base 1853 self.base = base
1848 self.args = args 1854 self.args = args
1849 self.reference_args = args if reference_args is None else reference_args 1855 self.reference_args = args if reference_args is None else reference_args
1850 self.tests = set() 1856 self.tests = set()
1851 1857
1852 def __repr__(self): 1858 def __repr__(self):
1853 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1859 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