| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 from skypy.find_tests import find_tests | 6 from skypy.find_tests import find_tests |
| 7 from skypy.paths import Paths | 7 from skypy.paths import Paths |
| 8 import argparse | 8 import argparse |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| 11 import requests | 11 import requests |
| 12 import skypy.configuration as configuration | 12 import skypy.configuration as configuration |
| 13 import skypy.skyserver |
| 13 import subprocess | 14 import subprocess |
| 14 | 15 |
| 15 | 16 |
| 16 SUPPORTED_MIME_TYPES = [ | 17 SUPPORTED_MIME_TYPES = [ |
| 17 'text/html', | 18 'text/html', |
| 18 'text/sky', | 19 'text/sky', |
| 19 'text/plain', | 20 'text/plain', |
| 20 ] | 21 ] |
| 21 HTTP_PORT = 9999 | 22 HTTP_PORT = 9999 |
| 22 URL_ROOT = 'http://localhost:%s/' % HTTP_PORT | 23 URL_ROOT = 'http://localhost:%s/' % HTTP_PORT |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 requests.post(DASHBOARD_URL, params={ 'data': json }) | 63 requests.post(DASHBOARD_URL, params={ 'data': json }) |
| 63 | 64 |
| 64 | 65 |
| 65 class PerfHarness(object): | 66 class PerfHarness(object): |
| 66 def __init__(self, args): | 67 def __init__(self, args): |
| 67 self._sky_server = None | 68 self._sky_server = None |
| 68 self.paths = Paths(os.path.join('out', 'Debug')) | 69 self.paths = Paths(os.path.join('out', 'Debug')) |
| 69 self.args = args | 70 self.args = args |
| 70 | 71 |
| 71 def _start_server(self): | 72 def _start_server(self): |
| 72 subprocess.call(os.path.join(self.paths.sky_tools_directory, | 73 # TODO(eseidel): Shouldn't this just use skyserver.py? |
| 73 'download_sky_server')) | |
| 74 return subprocess.Popen([ | 74 return subprocess.Popen([ |
| 75 os.path.join(self.paths.src_root, 'out', 'downloads', 'sky_server'), | 75 SkyServer.sky_server_path(), |
| 76 self.paths.src_root, | 76 self.paths.src_root, |
| 77 str(HTTP_PORT), | 77 str(HTTP_PORT), |
| 78 '-t', self.args.configuration | 78 '-t', self.args.configuration |
| 79 ]) | 79 ]) |
| 80 | 80 |
| 81 def _sky_tester_command(self, url): | 81 def _sky_tester_command(self, url): |
| 82 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer') | 82 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer') |
| 83 for mime_type in SUPPORTED_MIME_TYPES] | 83 for mime_type in SUPPORTED_MIME_TYPES] |
| 84 return [ | 84 return [ |
| 85 self.paths.mojo_shell_path, | 85 self.paths.mojo_shell_path, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 try: | 122 try: |
| 123 harness.main() | 123 harness.main() |
| 124 except (KeyboardInterrupt, SystemExit): | 124 except (KeyboardInterrupt, SystemExit): |
| 125 pass | 125 pass |
| 126 finally: | 126 finally: |
| 127 harness.shutdown() | 127 harness.shutdown() |
| 128 | 128 |
| 129 | 129 |
| 130 if __name__ == '__main__': | 130 if __name__ == '__main__': |
| 131 main() | 131 main() |
| OLD | NEW |