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 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 stdin=self._executive.PIPE, stdout=self._executive.PIPE, stderr=
None) | 1082 stdin=self._executive.PIPE, stdout=self._executive.PIPE, stderr=
None) |
1083 is_ready = self._helper.stdout.readline() | 1083 is_ready = self._helper.stdout.readline() |
1084 if not is_ready.startswith('ready'): | 1084 if not is_ready.startswith('ready'): |
1085 _log.error("layout_test_helper failed to be ready") | 1085 _log.error("layout_test_helper failed to be ready") |
1086 | 1086 |
1087 def requires_http_server(self): | 1087 def requires_http_server(self): |
1088 """Does the port require an HTTP server for running tests? This could | 1088 """Does the port require an HTTP server for running tests? This could |
1089 be the case when the tests aren't run on the host platform.""" | 1089 be the case when the tests aren't run on the host platform.""" |
1090 return True | 1090 return True |
1091 | 1091 |
1092 def _sky_sdk_path(self): | |
1093 return self._build_path('gen/sky_sdk') | |
1094 | |
1095 def _dart_packages_root(self): | 1092 def _dart_packages_root(self): |
1096 return os.path.join(self._sky_sdk_path(), 'packages_root') | 1093 return self._build_path('gen/dart-pkg/packages') |
1097 | 1094 |
1098 def server_command_line(self): | 1095 def server_command_line(self): |
1099 path = (self._options.path_to_server or | 1096 path = (self._options.path_to_server or |
1100 self.path_from_chromium_base('out', 'downloads', 'sky_server')) | 1097 self.path_from_chromium_base('out', 'downloads', 'sky_server')) |
1101 return [ | 1098 return [ |
1102 path, | 1099 path, |
1103 '-t', self.get_option('configuration'), | 1100 '-t', self.get_option('configuration'), |
1104 self.path_from_chromium_base(), | 1101 self.path_from_chromium_base(), |
1105 '8000', | 1102 '8000', |
1106 self._dart_packages_root() | 1103 self._dart_packages_root() |
1107 ] | 1104 ] |
1108 | 1105 |
1109 def start_http_server(self, additional_dirs, number_of_drivers): | 1106 def start_http_server(self, additional_dirs, number_of_drivers): |
1110 """Start a web server. Raise an error if it can't start or is already ru
nning. | 1107 """Start a web server. Raise an error if it can't start or is already ru
nning. |
1111 | 1108 |
1112 Ports can stub this out if they don't need a web server to be running.""
" | 1109 Ports can stub this out if they don't need a web server to be running.""
" |
1113 assert not self._http_server, 'Already running an http server.' | 1110 assert not self._http_server, 'Already running an http server.' |
1114 subprocess.call(self.path_to_script('download_sky_server')) | 1111 subprocess.call(self.path_to_script('download_sky_server')) |
1115 print # Make blank line before calling deploy_sdk. | |
1116 subprocess.call([ | |
1117 self.path_to_script('deploy_sdk.py'), | |
1118 '--build-dir', self._build_path(), | |
1119 '--non-interactive', | |
1120 '--dev-environment', | |
1121 self._sky_sdk_path(), | |
1122 '--fake-pub-get-into', | |
1123 self._dart_packages_root() | |
1124 ]) | |
1125 | |
1126 self._http_server = subprocess.Popen(self.server_command_line()) | 1112 self._http_server = subprocess.Popen(self.server_command_line()) |
1127 | 1113 |
1128 def start_websocket_server(self): | 1114 def start_websocket_server(self): |
1129 """Start a web server. Raise an error if it can't start or is already ru
nning. | 1115 """Start a web server. Raise an error if it can't start or is already ru
nning. |
1130 | 1116 |
1131 Ports can stub this out if they don't need a websocket server to be runn
ing.""" | 1117 Ports can stub this out if they don't need a websocket server to be runn
ing.""" |
1132 assert not self._websocket_server, 'Already running a websocket server.' | 1118 assert not self._websocket_server, 'Already running a websocket server.' |
1133 | 1119 |
1134 server = pywebsocket.PyWebSocket(self, self.results_directory()) | 1120 server = pywebsocket.PyWebSocket(self, self.results_directory()) |
1135 server.start() | 1121 server.start() |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 | 1777 |
1792 class PhysicalTestSuite(object): | 1778 class PhysicalTestSuite(object): |
1793 def __init__(self, base, args): | 1779 def __init__(self, base, args): |
1794 self.name = base | 1780 self.name = base |
1795 self.base = base | 1781 self.base = base |
1796 self.args = args | 1782 self.args = args |
1797 self.tests = set() | 1783 self.tests = set() |
1798 | 1784 |
1799 def __repr__(self): | 1785 def __repr__(self): |
1800 return "PhysicalTestSuite('%s', '%s', %s)" % (self.name, self.base, self
.args) | 1786 return "PhysicalTestSuite('%s', '%s', %s)" % (self.name, self.base, self
.args) |
OLD | NEW |