Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: mojo/devtools/common/devtoolslib/android_shell.py

Issue 1861223002: devtools: flush stdout after printing android observatory address. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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...) Expand 10 before | Expand all | Expand 10 after
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()
398 399
399 logcat_watch_thread = threading.Thread( 400 logcat_watch_thread = threading.Thread(
400 target=_forward_observatories_as_needed) 401 target=_forward_observatories_as_needed)
401 logcat_watch_thread.daemon = True 402 logcat_watch_thread.daemon = True
402 logcat_watch_thread.start() 403 logcat_watch_thread.start()
403 404
404 def forward_flutter_observatory_port(self): 405 def forward_flutter_observatory_port(self):
405 """Forwards the fixed port on which Flutter observatory is run.""" 406 """Forwards the fixed port on which Flutter observatory is run."""
406 self._forward_host_port_to_device(_FLUTTER_OBSERVATORY_PORT, 407 self._forward_host_port_to_device(_FLUTTER_OBSERVATORY_PORT,
407 _FLUTTER_OBSERVATORY_PORT) 408 _FLUTTER_OBSERVATORY_PORT)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 Results.output = rf.read() 450 Results.output = rf.read()
450 451
451 run_thread = threading.Thread(target=do_run) 452 run_thread = threading.Thread(target=do_run)
452 run_thread.start() 453 run_thread.start()
453 run_thread.join(timeout) 454 run_thread.join(timeout)
454 455
455 if run_thread.is_alive(): 456 if run_thread.is_alive():
456 self.stop_shell() 457 self.stop_shell()
457 return None, Results.output, True 458 return None, Results.output, True
458 return None, Results.output, False 459 return None, Results.output, False
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698