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): |
| 1096 return os.path.join(self._sky_sdk_path(), 'packages_root') |
| 1097 |
1092 def server_command_line(self): | 1098 def server_command_line(self): |
1093 path = (self._options.path_to_server or | 1099 path = (self._options.path_to_server or |
1094 self.path_from_chromium_base('out', 'downloads', 'sky_server')) | 1100 self.path_from_chromium_base('out', 'downloads', 'sky_server')) |
1095 return [ | 1101 return [ |
1096 path, | 1102 path, |
1097 '-t', self.get_option('configuration'), | 1103 '-t', self.get_option('configuration'), |
1098 self.path_from_chromium_base(), | 1104 self.path_from_chromium_base(), |
1099 '8000', | 1105 '8000', |
| 1106 self._dart_packages_root() |
1100 ] | 1107 ] |
1101 | 1108 |
1102 def start_http_server(self, additional_dirs, number_of_drivers): | 1109 def start_http_server(self, additional_dirs, number_of_drivers): |
1103 """Start a web server. Raise an error if it can't start or is already ru
nning. | 1110 """Start a web server. Raise an error if it can't start or is already ru
nning. |
1104 | 1111 |
1105 Ports can stub this out if they don't need a web server to be running.""
" | 1112 Ports can stub this out if they don't need a web server to be running.""
" |
1106 assert not self._http_server, 'Already running an http server.' | 1113 assert not self._http_server, 'Already running an http server.' |
1107 subprocess.call(self.path_to_script('download_sky_server')) | 1114 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 '--force', |
| 1120 '--dev-environment', |
| 1121 self._sky_sdk_path(), |
| 1122 '--fake-pub-get-into', |
| 1123 self._dart_packages_root() |
| 1124 ]) |
| 1125 |
1108 self._http_server = subprocess.Popen(self.server_command_line()) | 1126 self._http_server = subprocess.Popen(self.server_command_line()) |
1109 | 1127 |
1110 def start_websocket_server(self): | 1128 def start_websocket_server(self): |
1111 """Start a web server. Raise an error if it can't start or is already ru
nning. | 1129 """Start a web server. Raise an error if it can't start or is already ru
nning. |
1112 | 1130 |
1113 Ports can stub this out if they don't need a websocket server to be runn
ing.""" | 1131 Ports can stub this out if they don't need a websocket server to be runn
ing.""" |
1114 assert not self._websocket_server, 'Already running a websocket server.' | 1132 assert not self._websocket_server, 'Already running a websocket server.' |
1115 | 1133 |
1116 server = pywebsocket.PyWebSocket(self, self.results_directory()) | 1134 server = pywebsocket.PyWebSocket(self, self.results_directory()) |
1117 server.start() | 1135 server.start() |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 | 1791 |
1774 class PhysicalTestSuite(object): | 1792 class PhysicalTestSuite(object): |
1775 def __init__(self, base, args): | 1793 def __init__(self, base, args): |
1776 self.name = base | 1794 self.name = base |
1777 self.base = base | 1795 self.base = base |
1778 self.args = args | 1796 self.args = args |
1779 self.tests = set() | 1797 self.tests = set() |
1780 | 1798 |
1781 def __repr__(self): | 1799 def __repr__(self): |
1782 return "PhysicalTestSuite('%s', '%s', %s)" % (self.name, self.base, self
.args) | 1800 return "PhysicalTestSuite('%s', '%s', %s)" % (self.name, self.base, self
.args) |
OLD | NEW |