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

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

Issue 1288003002: Fix `mojo_run --android` to terminate when the shell terminates. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 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 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 match = re.search(r'Observatory listening on http://127.0.0.1:(\d+)', 359 match = re.search(r'Observatory listening on http://127.0.0.1:(\d+)',
360 line) 360 line)
361 if match: 361 if match:
362 device_port = int(match.group(1)) 362 device_port = int(match.group(1))
363 host_port = self._forward_host_port_to_device(0, device_port) 363 host_port = self._forward_host_port_to_device(0, device_port)
364 print ("Dart observatory available at the host at http://127.0.0.1:%d" 364 print ("Dart observatory available at the host at http://127.0.0.1:%d"
365 % host_port) 365 % host_port)
366 366
367 logcat_watch_thread = threading.Thread( 367 logcat_watch_thread = threading.Thread(
368 target=_forward_observatories_as_needed) 368 target=_forward_observatories_as_needed)
369 logcat_watch_thread.daemon = True
369 logcat_watch_thread.start() 370 logcat_watch_thread.start()
370 371
371 @overrides(Shell) 372 @overrides(Shell)
372 def serve_local_directory(self, local_dir_path, port=0): 373 def serve_local_directory(self, local_dir_path, port=0):
373 assert local_dir_path 374 assert local_dir_path
374 mappings = [('', [local_dir_path])] 375 mappings = [('', [local_dir_path])]
375 server_address = start_http_server(mappings, host_port=port) 376 server_address = start_http_server(mappings, host_port=port)
376 377
377 return 'http://127.0.0.1:%d/' % self._forward_device_port_to_host( 378 return 'http://127.0.0.1:%d/' % self._forward_device_port_to_host(
378 port, server_address[1]) 379 port, server_address[1])
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 Results.output = rf.read() 418 Results.output = rf.read()
418 419
419 run_thread = threading.Thread(target=do_run) 420 run_thread = threading.Thread(target=do_run)
420 run_thread.start() 421 run_thread.start()
421 run_thread.join(timeout) 422 run_thread.join(timeout)
422 423
423 if run_thread.is_alive(): 424 if run_thread.is_alive():
424 self.stop_shell() 425 self.stop_shell()
425 return None, Results.output, True 426 return None, Results.output, True
426 return None, Results.output, False 427 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