| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 from webkitpy.common.system.path import cygpath | 55 from webkitpy.common.system.path import cygpath |
| 56 from webkitpy.common.system.systemhost import SystemHost | 56 from webkitpy.common.system.systemhost import SystemHost |
| 57 from webkitpy.common.webkit_finder import WebKitFinder | 57 from webkitpy.common.webkit_finder import WebKitFinder |
| 58 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx
pectationsFactory | 58 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx
pectationsFactory |
| 59 from webkitpy.layout_tests.models import test_run_results | 59 from webkitpy.layout_tests.models import test_run_results |
| 60 from webkitpy.layout_tests.models.test_configuration import TestConfiguration | 60 from webkitpy.layout_tests.models.test_configuration import TestConfiguration |
| 61 from webkitpy.layout_tests.port import config as port_config | 61 from webkitpy.layout_tests.port import config as port_config |
| 62 from webkitpy.layout_tests.port import driver | 62 from webkitpy.layout_tests.port import driver |
| 63 from webkitpy.layout_tests.port import server_process | 63 from webkitpy.layout_tests.port import server_process |
| 64 from webkitpy.layout_tests.port.factory import PortFactory | 64 from webkitpy.layout_tests.port.factory import PortFactory |
| 65 from webkitpy.layout_tests.servers import apache_http_server | 65 from webkitpy.layout_tests.servers import apache_http |
| 66 from webkitpy.layout_tests.servers import http_server | 66 from webkitpy.layout_tests.servers import lighttpd |
| 67 from webkitpy.layout_tests.servers import websocket_server | 67 from webkitpy.layout_tests.servers import pywebsocket |
| 68 | 68 |
| 69 _log = logging.getLogger(__name__) | 69 _log = logging.getLogger(__name__) |
| 70 | 70 |
| 71 | 71 |
| 72 # FIXME: This class should merge with WebKitPort now that Chromium behaves mostl
y like other webkit ports. | 72 # FIXME: This class should merge with WebKitPort now that Chromium behaves mostl
y like other webkit ports. |
| 73 class Port(object): | 73 class Port(object): |
| 74 """Abstract class for Port-specific hooks for the layout_test package.""" | 74 """Abstract class for Port-specific hooks for the layout_test package.""" |
| 75 | 75 |
| 76 # Subclasses override this. This should indicate the basic implementation | 76 # Subclasses override this. This should indicate the basic implementation |
| 77 # part of the port name, e.g., 'mac', 'win', 'gtk'; there is probably (?) | 77 # part of the port name, e.g., 'mac', 'win', 'gtk'; there is probably (?) |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_servers=None): | 1094 def start_http_server(self, additional_dirs=None, number_of_servers=None): |
| 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_server.LayoutTestApacheHttpd(self, self.results
_directory(), additional_dirs=additional_dirs, number_of_servers=number_of_serve
rs) | 1101 server = apache_http.ApacheHTTP(self, self.results_directory(), addi
tional_dirs=additional_dirs, number_of_servers=number_of_servers) |
| 1102 else: | 1102 else: |
| 1103 server = http_server.Lighttpd(self, self.results_directory(), additi
onal_dirs=additional_dirs, number_of_servers=number_of_servers) | 1103 server = lighttpd.Lighttpd(self, self.results_directory(), additiona
l_dirs=additional_dirs, number_of_servers=number_of_servers) |
| 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 |
| 1114 server = websocket_server.PyWebSocket(self, self.results_directory()) | 1114 server = pywebsocket.PyWebSocket(self, self.results_directory()) |
| 1115 server.start() | 1115 server.start() |
| 1116 self._websocket_server = server | 1116 self._websocket_server = server |
| 1117 | 1117 |
| 1118 def http_server_supports_ipv6(self): | 1118 def http_server_supports_ipv6(self): |
| 1119 # Cygwin is the only platform to still use Apache 1.3, which only suppor
ts IPV4. | 1119 # Cygwin is the only platform to still use Apache 1.3, which only suppor
ts IPV4. |
| 1120 # Once it moves to Apache 2, we can drop this method altogether. | 1120 # Once it moves to Apache 2, we can drop this method altogether. |
| 1121 if self.host.platform.is_cygwin(): | 1121 if self.host.platform.is_cygwin(): |
| 1122 return False | 1122 return False |
| 1123 return True | 1123 return True |
| 1124 | 1124 |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 if name.find('/') != -1: | 1748 if name.find('/') != -1: |
| 1749 _log.error("Virtual test suites names cannot contain /'s: %s" %
name) | 1749 _log.error("Virtual test suites names cannot contain /'s: %s" %
name) |
| 1750 return | 1750 return |
| 1751 self.name = 'virtual/' + name + '/' + base | 1751 self.name = 'virtual/' + name + '/' + base |
| 1752 self.base = base | 1752 self.base = base |
| 1753 self.args = args | 1753 self.args = args |
| 1754 self.tests = tests or set() | 1754 self.tests = tests or set() |
| 1755 | 1755 |
| 1756 def __repr__(self): | 1756 def __repr__(self): |
| 1757 return "VirtualTestSuite('%s', '%s', %s)" % (self.name, self.base, self.
args) | 1757 return "VirtualTestSuite('%s', '%s', %s)" % (self.name, self.base, self.
args) |
| OLD | NEW |