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

Unified Diff: mojo/devtools/common/devtoolslib/android_shell.py

Issue 1397193005: mojo_run: support parallel Android runs of mojo_run. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: mojo/devtools/common/devtoolslib/android_shell.py
diff --git a/mojo/devtools/common/devtoolslib/android_shell.py b/mojo/devtools/common/devtoolslib/android_shell.py
index 275a3dce94a49eabf809397af38ee4257b0841ce..611732e045da426e1836253a76d3c78f038f30a8 100644
--- a/mojo/devtools/common/devtoolslib/android_shell.py
+++ b/mojo/devtools/common/devtoolslib/android_shell.py
@@ -408,18 +408,20 @@ class AndroidShell(Shell):
logcat_watch_thread.start()
@overrides(Shell)
- def serve_local_directory(self, local_dir_path, port=0):
+ def serve_local_directory(self, local_dir_path, port=0, free_host_port=False):
assert local_dir_path
mappings = [('', [local_dir_path])]
- server_address = start_http_server(mappings, host_port=port)
+ host_port = 0 if free_host_port else port
+ server_address = start_http_server(mappings, host_port=host_port)
return 'http://127.0.0.1:%d/' % self._forward_device_port_to_host(
port, server_address[1])
@overrides(Shell)
- def serve_local_directories(self, mappings, port=0):
+ def serve_local_directories(self, mappings, port=0, free_host_port=False):
assert mappings
- server_address = start_http_server(mappings, host_port=port)
+ host_port = 0 if free_host_port else port
+ server_address = start_http_server(mappings, host_port=host_port)
return 'http://127.0.0.1:%d/' % self._forward_device_port_to_host(
port, server_address[1])
« no previous file with comments | « no previous file | mojo/devtools/common/devtoolslib/linux_shell.py » ('j') | mojo/devtools/common/devtoolslib/shell_arguments.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698