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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 stdin=self._executive.PIPE, stdout=self._executive.PIPE, stderr=
None) | 1084 stdin=self._executive.PIPE, stdout=self._executive.PIPE, stderr=
None) |
1085 is_ready = self._helper.stdout.readline() | 1085 is_ready = self._helper.stdout.readline() |
1086 if not is_ready.startswith('ready'): | 1086 if not is_ready.startswith('ready'): |
1087 _log.error("layout_test_helper failed to be ready") | 1087 _log.error("layout_test_helper failed to be ready") |
1088 | 1088 |
1089 def requires_http_server(self): | 1089 def requires_http_server(self): |
1090 """Does the port require an HTTP server for running tests? This could | 1090 """Does the port require an HTTP server for running tests? This could |
1091 be the case when the tests aren't run on the host platform.""" | 1091 be the case when the tests aren't run on the host platform.""" |
1092 return False | 1092 return False |
1093 | 1093 |
1094 def start_http_server(self, additional_dirs=None, number_of_drivers=None): | 1094 def start_http_server(self, additional_dirs, number_of_drivers): |
1095 """Start a web server. Raise an error if it can't start or is already ru
nning. | 1095 """Start a web server. Raise an error if it can't start or is already ru
nning. |
1096 | 1096 |
1097 Ports can stub this out if they don't need a web server to be running.""
" | 1097 Ports can stub this out if they don't need a web server to be running.""
" |
1098 assert not self._http_server, 'Already running an http server.' | 1098 assert not self._http_server, 'Already running an http server.' |
1099 | 1099 |
1100 if self.uses_apache(): | 1100 if self.uses_apache(): |
1101 server = apache_http.ApacheHTTP(self, self.results_directory(), addi
tional_dirs=additional_dirs, number_of_servers=(number_of_drivers * 4)) | 1101 server = apache_http.ApacheHTTP(self, self.results_directory(), addi
tional_dirs=additional_dirs, number_of_servers=(number_of_drivers * 4)) |
1102 else: | 1102 else: |
1103 server = lighttpd.Lighttpd(self, self.results_directory(), additiona
l_dirs=additional_dirs) | 1103 server = lighttpd.Lighttpd(self, self.results_directory()) |
1104 | 1104 |
1105 server.start() | 1105 server.start() |
1106 self._http_server = server | 1106 self._http_server = server |
1107 | 1107 |
1108 def start_websocket_server(self): | 1108 def start_websocket_server(self): |
1109 """Start a web server. Raise an error if it can't start or is already ru
nning. | 1109 """Start a web server. Raise an error if it can't start or is already ru
nning. |
1110 | 1110 |
1111 Ports can stub this out if they don't need a websocket server to be runn
ing.""" | 1111 Ports can stub this out if they don't need a websocket server to be runn
ing.""" |
1112 assert not self._websocket_server, 'Already running a websocket server.' | 1112 assert not self._websocket_server, 'Already running a websocket server.' |
1113 | 1113 |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 if name.find('/') != -1: | 1742 if name.find('/') != -1: |
1743 _log.error("Virtual test suites names cannot contain /'s: %s" %
name) | 1743 _log.error("Virtual test suites names cannot contain /'s: %s" %
name) |
1744 return | 1744 return |
1745 self.name = 'virtual/' + name + '/' + base | 1745 self.name = 'virtual/' + name + '/' + base |
1746 self.base = base | 1746 self.base = base |
1747 self.args = args | 1747 self.args = args |
1748 self.tests = tests or set() | 1748 self.tests = tests or set() |
1749 | 1749 |
1750 def __repr__(self): | 1750 def __repr__(self): |
1751 return "VirtualTestSuite('%s', '%s', %s)" % (self.name, self.base, self.
args) | 1751 return "VirtualTestSuite('%s', '%s', %s)" % (self.name, self.base, self.
args) |
OLD | NEW |