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

Unified Diff: Tools/Scripts/webkitpy/layout_tests/port/base.py

Issue 150573014: Rename various methods in webkitpy.layout_test.Port to be public (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove port.check_httpd stub call from port_testcase Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/layout_tests/port/base.py
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py
index 543b2e307add12ed76e71d8f4679206a32dcde51..deaf3beef9ff9a12fe77d391e90b1a81d9c01cba 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -432,10 +432,10 @@ class Port(object):
return 'wdiff is not installed; please install it to generate word-by-word diffs.'
def check_httpd(self):
- if self._uses_apache():
- httpd_path = self._path_to_apache()
+ if self.uses_apache():
+ httpd_path = self.path_to_apache()
else:
- httpd_path = self._path_to_lighttpd()
+ httpd_path = self.path_to_lighttpd()
try:
server_name = self._filesystem.basename(httpd_path)
@@ -1097,7 +1097,7 @@ class Port(object):
Ports can stub this out if they don't need a web server to be running."""
assert not self._http_server, 'Already running an http server.'
- if self._uses_apache():
+ if self.uses_apache():
server = apache_http_server.LayoutTestApacheHttpd(self, self.results_directory(), additional_dirs=additional_dirs, number_of_servers=number_of_servers)
else:
server = http_server.Lighttpd(self, self.results_directory(), additional_dirs=additional_dirs, number_of_servers=number_of_servers)
@@ -1367,23 +1367,58 @@ class Port(object):
def clobber_old_port_specific_results(self):
pass
- #
- # PROTECTED ROUTINES
- #
- # The routines below should only be called by routines in this class
- # or any of its subclasses.
- #
-
- def _uses_apache(self):
+ def uses_apache(self):
return True
# FIXME: This does not belong on the port object.
@memoized
- def _path_to_apache(self):
+ def path_to_apache(self):
"""Returns the full path to the apache binary.
This is needed only by ports that use the apache_http_server module."""
- raise NotImplementedError('Port._path_to_apache')
+ raise NotImplementedError('Port.path_to_apache')
+
+ def path_to_apache_config_file(self):
+ """Returns the full path to the apache configuration file.
+
+ If the WEBKIT_HTTP_SERVER_CONF_PATH environment variable is set, its
+ contents will be used instead.
+
+ This is needed only by ports that use the apache_http_server module."""
+ config_file_from_env = os.environ.get('WEBKIT_HTTP_SERVER_CONF_PATH')
+ if config_file_from_env:
+ if not self._filesystem.exists(config_file_from_env):
+ raise IOError('%s was not found on the system' % config_file_from_env)
+ return config_file_from_env
+
+ config_file_name = self._apache_config_file_name_for_platform(sys.platform)
+ return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_file_name)
+
+ def path_to_lighttpd(self):
+ """Returns the path to the LigHTTPd binary.
+
+ This is needed only by ports that use the http_server.py module."""
+ raise NotImplementedError('Port._path_to_lighttpd')
+
+ def path_to_lighttpd_modules(self):
+ """Returns the path to the LigHTTPd modules directory.
+
+ This is needed only by ports that use the http_server.py module."""
+ raise NotImplementedError('Port._path_to_lighttpd_modules')
+
+ def path_to_lighttpd_php(self):
+ """Returns the path to the LigHTTPd PHP executable.
+
+ This is needed only by ports that use the http_server.py module."""
+ raise NotImplementedError('Port._path_to_lighttpd_php')
+
+
+ #
+ # PROTECTED ROUTINES
+ #
+ # The routines below should only be called by routines in this class
+ # or any of its subclasses.
+ #
# FIXME: This belongs on some platform abstraction instead of Port.
def _is_redhat_based(self):
@@ -1393,7 +1428,7 @@ class Port(object):
return self._filesystem.exists('/etc/debian_version')
def _apache_version(self):
- config = self._executive.run_command([self._path_to_apache(), '-v'])
+ config = self._executive.run_command([self.path_to_apache(), '-v'])
return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'\1', config)
# We pass sys_platform into this method to make it easy to unit test.
@@ -1408,22 +1443,6 @@ class Port(object):
# All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and prior, which we no longer support).
return "apache2-httpd.conf"
- def _path_to_apache_config_file(self):
- """Returns the full path to the apache configuration file.
-
- If the WEBKIT_HTTP_SERVER_CONF_PATH environment variable is set, its
- contents will be used instead.
-
- This is needed only by ports that use the apache_http_server module."""
- config_file_from_env = os.environ.get('WEBKIT_HTTP_SERVER_CONF_PATH')
- if config_file_from_env:
- if not self._filesystem.exists(config_file_from_env):
- raise IOError('%s was not found on the system' % config_file_from_env)
- return config_file_from_env
-
- config_file_name = self._apache_config_file_name_for_platform(sys.platform)
- return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_file_name)
-
def _path_to_driver(self, configuration=None):
"""Returns the full path to the test driver."""
return self._build_path(self.driver_name())
@@ -1446,24 +1465,6 @@ class Port(object):
This is likely used only by diff_image()"""
return self._build_path('image_diff')
- def _path_to_lighttpd(self):
- """Returns the path to the LigHTTPd binary.
-
- This is needed only by ports that use the http_server.py module."""
- raise NotImplementedError('Port._path_to_lighttpd')
-
- def _path_to_lighttpd_modules(self):
- """Returns the path to the LigHTTPd modules directory.
-
- This is needed only by ports that use the http_server.py module."""
- raise NotImplementedError('Port._path_to_lighttpd_modules')
-
- def _path_to_lighttpd_php(self):
- """Returns the path to the LigHTTPd PHP executable.
-
- This is needed only by ports that use the http_server.py module."""
- raise NotImplementedError('Port._path_to_lighttpd_php')
-
@memoized
def _path_to_wdiff(self):
"""Returns the full path to the wdiff binary, or None if it is not available.
« no previous file with comments | « Tools/Scripts/webkitpy/layout_tests/port/android.py ('k') | Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698