Fix default AndroidTouchDevice addr in webplot
Webplot was using 'localhost' as the default address for android
devices, which doesn't work. Android addresses are a string of
characters like "T0632076QO" that are determined by using the
command "adb devices"
This CL just changes the default address value to be None, then
uses the TouchDevice Wrapper to turn this into 127.0.0.1 for ChromeOS
and leaves it as None for Android.
BUG=chromium:473338
TEST=Ran "python webplot.py -t android -p 8080" and it plotted from
my Android phone perfectly. It still works for ChromeOS too.
Change-Id: Id5aca4d49fb5aaa99c4d5c0781f696465fca91c5
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/263770
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
diff --git a/webplot/webplot.py b/webplot/webplot.py
index 55026bb..64384f3 100755
--- a/webplot/webplot.py
+++ b/webplot/webplot.py
@@ -92,6 +92,8 @@
def __init__(self, dut_type, addr, is_touchscreen):
if dut_type == 'chromeos':
+ if addr is None:
+ addr = '127.0.0.1'
self.device = ChromeOSTouchDevice(addr, is_touchscreen)
else:
self.device = AndroidTouchDevice(addr, True)
@@ -305,7 +307,7 @@
def _ParseArguments():
"""Parse the command line options."""
parser = argparse.ArgumentParser(description='Webplot Server')
- parser.add_argument('-d', '--dut_addr', default='localhost',
+ parser.add_argument('-d', '--dut_addr', default=None,
help='the address of the dut')
parser.add_argument('-s', '--server_addr', default='localhost',
help='the address the webplot http server listens to')