OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import atexit | 5 import atexit |
6 import hashlib | 6 import hashlib |
7 import json | 7 import json |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import os.path | 10 import os.path |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 print ("Dart observatory available at the host at http://127.0.0.1:%d" | 368 print ("Dart observatory available at the host at http://127.0.0.1:%d" |
369 % host_port) | 369 % host_port) |
370 | 370 |
371 logcat_watch_thread = threading.Thread( | 371 logcat_watch_thread = threading.Thread( |
372 target=_forward_observatories_as_needed) | 372 target=_forward_observatories_as_needed) |
373 logcat_watch_thread.start() | 373 logcat_watch_thread.start() |
374 | 374 |
375 @overrides(Shell) | 375 @overrides(Shell) |
376 def serve_local_directory(self, local_dir_path, port=0): | 376 def serve_local_directory(self, local_dir_path, port=0): |
377 assert local_dir_path | 377 assert local_dir_path |
378 mappings = [('', local_dir_path)] | 378 mappings = [('', [local_dir_path])] |
379 server_address = start_http_server(mappings, host_port=port) | 379 server_address = start_http_server(mappings, host_port=port) |
380 | 380 |
381 return 'http://127.0.0.1:%d/' % self._forward_device_port_to_host( | 381 return 'http://127.0.0.1:%d/' % self._forward_device_port_to_host( |
382 port, server_address[1]) | 382 port, server_address[1]) |
383 | 383 |
384 @overrides(Shell) | 384 @overrides(Shell) |
385 def serve_local_directories(self, mappings, port=0): | 385 def serve_local_directories(self, mappings, port=0): |
386 assert mappings | 386 assert mappings |
387 server_address = start_http_server(mappings, host_port=port) | 387 server_address = start_http_server(mappings, host_port=port) |
388 | 388 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 Results.output = rf.read() | 421 Results.output = rf.read() |
422 | 422 |
423 run_thread = threading.Thread(target=do_run) | 423 run_thread = threading.Thread(target=do_run) |
424 run_thread.start() | 424 run_thread.start() |
425 run_thread.join(timeout) | 425 run_thread.join(timeout) |
426 | 426 |
427 if run_thread.is_alive(): | 427 if run_thread.is_alive(): |
428 self.stop_shell() | 428 self.stop_shell() |
429 return None, Results.output, True | 429 return None, Results.output, True |
430 return None, Results.output, False | 430 return None, Results.output, False |
OLD | NEW |