Index: build/android/pylib/chrome_test_server_spawner.py |
diff --git a/build/android/pylib/chrome_test_server_spawner.py b/build/android/pylib/chrome_test_server_spawner.py |
index 8206ca03b3f32410e34d04a383f6b315e1c5b60a..1ec22041628fc148c28c9b961a17378f33d401a8 100644 |
--- a/build/android/pylib/chrome_test_server_spawner.py |
+++ b/build/android/pylib/chrome_test_server_spawner.py |
@@ -1,4 +1,4 @@ |
-# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Copyright 2013 The Chromium Authors. All rights reserved. |
Philippe
2013/01/17 10:27:13
Nit: it seems that '(c)' disappeared :)
Raghu Simha
2013/01/17 21:51:09
That was intentional. The new coding guidelines as
|
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
@@ -24,18 +24,20 @@ from forwarder import Forwarder |
import ports |
-# Path that are needed to import necessary modules when running testserver.py. |
-os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', '') + ':%s:%s:%s:%s' % ( |
- os.path.join(constants.CHROME_DIR, 'third_party'), |
- os.path.join(constants.CHROME_DIR, 'third_party', 'tlslite'), |
- os.path.join(constants.CHROME_DIR, 'third_party', 'pyftpdlib', 'src'), |
- os.path.join(constants.CHROME_DIR, 'net', 'tools', 'testserver')) |
+# Path that are needed to import necessary modules when launching a testserver. |
+os.environ['PYTHONPATH'] = \ |
Philippe
2013/01/17 10:27:13
Nit: I really don't feel strongly about line break
Raghu Simha
2013/01/17 21:51:09
Fixed.
|
+ os.environ.get('PYTHONPATH', '') + ':%s:%s:%s:%s:%s' % ( |
+ os.path.join(constants.CHROME_DIR, 'third_party'), |
+ os.path.join(constants.CHROME_DIR, 'third_party', 'tlslite'), |
+ os.path.join(constants.CHROME_DIR, 'third_party', 'pyftpdlib', 'src'), |
+ os.path.join(constants.CHROME_DIR, 'net', 'tools', 'testserver'), |
+ os.path.join(constants.CHROME_DIR, 'sync', 'tools', 'testserver')) |
SERVER_TYPES = { |
'http': '', |
'ftp': '-f', |
- 'sync': '--sync', |
+ 'sync': '', # Sync uses its own script, and doesn't take a server type arg. |
'tcpecho': '--tcp-echo', |
'udpecho': '--udp-echo', |
} |
@@ -207,8 +209,16 @@ class TestServerThread(threading.Thread): |
logging.info('Start running the thread!') |
self.wait_event.clear() |
self._GenerateCommandLineArguments() |
- command = [os.path.join(constants.CHROME_DIR, 'net', 'tools', |
- 'testserver', 'testserver.py')] + self.command_line |
+ # The sync testserver is started by launching the sync_testserver.py script |
+ # from sync/tools/testserver. All other testservers are started by launching |
+ # the testserver.py script from net/tools/testserver. |
+ command = constants.CHROME_DIR |
+ if self.arguments['server-type'] is 'sync': |
+ command = [os.path.join(command, 'sync', 'tools', 'testserver', |
+ 'sync_testserver.py')] + self.command_line |
+ else: |
+ command = [os.path.join(command, 'net', 'tools', 'testserver', |
+ 'testserver.py')] + self.command_line |
logging.info('Running: %s', command) |
self.process = subprocess.Popen(command) |
if self.process: |