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 logging | 7 import logging |
8 import os | 8 import os |
9 import os.path | 9 import os.path |
10 import random | 10 import random |
(...skipping 377 matching lines...) Loading... |
388 line = logcat.stdout.readline() | 388 line = logcat.stdout.readline() |
389 if not line: | 389 if not line: |
390 break | 390 break |
391 match = re.search(r'Observatory listening on http://127.0.0.1:(\d+)', | 391 match = re.search(r'Observatory listening on http://127.0.0.1:(\d+)', |
392 line) | 392 line) |
393 if match: | 393 if match: |
394 device_port = int(match.group(1)) | 394 device_port = int(match.group(1)) |
395 host_port = self._forward_host_port_to_device(0, device_port) | 395 host_port = self._forward_host_port_to_device(0, device_port) |
396 print ('Dart observatory available at the host at http://127.0.0.1:%d' | 396 print ('Dart observatory available at the host at http://127.0.0.1:%d' |
397 % host_port) | 397 % host_port) |
398 sys.stdout.flush() | |
399 | 398 |
400 logcat_watch_thread = threading.Thread( | 399 logcat_watch_thread = threading.Thread( |
401 target=_forward_observatories_as_needed) | 400 target=_forward_observatories_as_needed) |
402 logcat_watch_thread.daemon = True | 401 logcat_watch_thread.daemon = True |
403 logcat_watch_thread.start() | 402 logcat_watch_thread.start() |
404 | 403 |
405 def forward_flutter_observatory_port(self): | 404 def forward_flutter_observatory_port(self): |
406 """Forwards the fixed port on which Flutter observatory is run.""" | 405 """Forwards the fixed port on which Flutter observatory is run.""" |
407 self._forward_host_port_to_device(_FLUTTER_OBSERVATORY_PORT, | 406 self._forward_host_port_to_device(_FLUTTER_OBSERVATORY_PORT, |
408 _FLUTTER_OBSERVATORY_PORT) | 407 _FLUTTER_OBSERVATORY_PORT) |
(...skipping 41 matching lines...) Loading... |
450 Results.output = rf.read() | 449 Results.output = rf.read() |
451 | 450 |
452 run_thread = threading.Thread(target=do_run) | 451 run_thread = threading.Thread(target=do_run) |
453 run_thread.start() | 452 run_thread.start() |
454 run_thread.join(timeout) | 453 run_thread.join(timeout) |
455 | 454 |
456 if run_thread.is_alive(): | 455 if run_thread.is_alive(): |
457 self.stop_shell() | 456 self.stop_shell() |
458 return None, Results.output, True | 457 return None, Results.output, True |
459 return None, Results.output, False | 458 return None, Results.output, False |
OLD | NEW |