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

Unified Diff: build/android/pylib/chrome_test_server_spawner.py

Issue 257613006: Change the Android test server's cwd rather than mangle arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix empty document root. Created 6 years, 8 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
« no previous file with comments | « no previous file | net/test/spawned_test_server/remote_test_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1726230c131cb8911bb50c2efb571af6ae0d8cb6..e1fe7b18b61fec26bb0ac32d882c0b9930f5773e 100644
--- a/build/android/pylib/chrome_test_server_spawner.py
+++ b/build/android/pylib/chrome_test_server_spawner.py
@@ -196,16 +196,12 @@ class TestServerThread(threading.Thread):
# Pass the remaining arguments as-is.
for key, values in args_copy.iteritems():
- is_path = key in ['data-dir', 'cert-and-key-file', 'ssl-client-ca']
if not isinstance(values, list):
values = [values]
for value in values:
if value is None:
self.command_line.append('--%s' % key)
else:
- # Arguments with file paths get mangled.
- if is_path and not os.path.isabs(value):
- value = os.path.join(constants.DIR_SOURCE_ROOT, value)
self.command_line.append('--%s=%s' % (key, value))
bulach 2014/04/29 09:06:21 probably unrelated, but does |value| needs quoting
davidben 2014/04/29 16:09:12 This gets put into an argv not a shell command and
def _CloseUnnecessaryFDsForTestServerProcess(self):
@@ -231,8 +227,11 @@ class TestServerThread(threading.Thread):
command = [os.path.join(command, 'net', 'tools', 'testserver',
'testserver.py')] + self.command_line
logging.info('Running: %s', command)
+ # Pass DIR_SOURCE_ROOT as the child's working directory so that relative
+ # paths in the arguments are resolved correctly.
self.process = subprocess.Popen(
- command, preexec_fn=self._CloseUnnecessaryFDsForTestServerProcess)
+ command, preexec_fn=self._CloseUnnecessaryFDsForTestServerProcess,
+ cwd=constants.DIR_SOURCE_ROOT)
if self.process:
if self.pipe_out:
self.is_ready = self._WaitToStartAndGetPortFromTestServer()
« no previous file with comments | « no previous file | net/test/spawned_test_server/remote_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698