Drop default port number in `http_server.py` and `shell.py`.
It turns out nothing was using these defaults outside of
`http_server_unittest.py`.
R=qsr@chromium.org
Review URL: https://codereview.chromium.org/1433353007 .
Cr-Mirrored-From: https://github.com/domokit/mojo
Cr-Mirrored-Commit: 2e6ef79dc1d9bf56e15eaff0994b0344820cd911
diff --git a/devtoolslib/android_shell.py b/devtoolslib/android_shell.py
index 7f69c08..bd0e684 100644
--- a/devtoolslib/android_shell.py
+++ b/devtoolslib/android_shell.py
@@ -421,7 +421,7 @@
logcat_watch_thread.start()
@overrides(Shell)
- def serve_local_directories(self, mappings, port=0, reuse_servers=False):
+ def serve_local_directories(self, mappings, port, reuse_servers=False):
assert mappings
if reuse_servers:
assert port, 'Cannot reuse the server when |port| is 0.'
diff --git a/devtoolslib/http_server.py b/devtoolslib/http_server.py
index 2de71e1..259ea96 100644
--- a/devtoolslib/http_server.py
+++ b/devtoolslib/http_server.py
@@ -207,7 +207,7 @@
return RequestHandler
-def start_http_server(mappings, host_port=0):
+def start_http_server(mappings, host_port):
"""Starts an http server serving files from |local_dir_path| on |host_port|.
Args:
diff --git a/devtoolslib/http_server_unittest.py b/devtoolslib/http_server_unittest.py
index b089e70..bb2e32a 100644
--- a/devtoolslib/http_server_unittest.py
+++ b/devtoolslib/http_server_unittest.py
@@ -67,7 +67,7 @@
('other/', [self.other_dir]),
]
server_address = ('http://%s:%u/' %
- http_server.start_http_server(mappings))
+ http_server.start_http_server(mappings, 0))
hello_relpath = os.path.relpath(self.hello_file.name, self.hello_dir)
hello_response = urllib2.urlopen(server_address + 'hello/' +
@@ -87,7 +87,7 @@
('hello/', [self.hello_dir]),
]
server_address = ('http://%s:%u/' %
- http_server.start_http_server(mappings))
+ http_server.start_http_server(mappings, 0))
error_code = None
try:
@@ -102,7 +102,7 @@
('singularity/', [self.hello_dir, self.other_dir]),
]
server_address = ('http://%s:%u/' %
- http_server.start_http_server(mappings))
+ http_server.start_http_server(mappings, 0))
hello_relpath = os.path.relpath(self.hello_file.name, self.hello_dir)
hello_response = urllib2.urlopen(server_address + 'singularity/' +
@@ -129,7 +129,7 @@
('hello/', [self.hello_dir]),
]
server_address = ('http://%s:%u/' %
- http_server.start_http_server(mappings))
+ http_server.start_http_server(mappings, 0))
hello_relpath = os.path.relpath(self.hello_file.name, self.hello_dir)
hello_response = urllib2.urlopen(server_address + 'hello/' +
@@ -150,7 +150,7 @@
('', [self.apps_dir]),
]
server_address = ('http://%s:%u/' %
- http_server.start_http_server(mappings))
+ http_server.start_http_server(mappings, 0))
app_relpath = os.path.relpath(self.dart_app_path, self.apps_dir)
hello_response = urllib2.urlopen(server_address + app_relpath)
diff --git a/devtoolslib/linux_shell.py b/devtoolslib/linux_shell.py
index 8a0ec7f..5fad2a1 100644
--- a/devtoolslib/linux_shell.py
+++ b/devtoolslib/linux_shell.py
@@ -25,7 +25,7 @@
self.command_prefix = command_prefix if command_prefix else []
@overrides(Shell)
- def serve_local_directories(self, mappings, port=0, reuse_servers=False):
+ def serve_local_directories(self, mappings, port, reuse_servers=False):
if reuse_servers:
assert port, 'Cannot reuse the server when |port| is 0.'
server_address = ('127.0.0.1', port)
diff --git a/devtoolslib/shell.py b/devtoolslib/shell.py
index bc47856..7e7ee88 100644
--- a/devtoolslib/shell.py
+++ b/devtoolslib/shell.py
@@ -6,7 +6,7 @@
class Shell(object):
"""Represents an abstract Mojo shell."""
- def serve_local_directories(self, mappings, port=0, reuse_servers=False):
+ def serve_local_directories(self, mappings, port, reuse_servers=False):
"""Serves the content of the local (host) directories, making it available
to the shell under the url returned by the function.