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

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 12210088: Make the TestServer use an absolute document root path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testserver uses absolute docroot path Created 7 years, 10 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: chrome/test/pyautolib/pyauto.py
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index dce9741ea025af71d62a3e028a09d3edcb26282a..a0f0828ac3f38b57401e687ad7eb709c6e9c0ebf 100755
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -851,9 +851,11 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
Returns:
handle to FTP Server, an instance of TestServer
"""
+ source_dir = os.path.normpath(pyauto_paths.GetSourceDir())
+ path = os.path.join(source_dir, data_dir)
ftp_server = pyautolib.TestServer(pyautolib.TestServer.TYPE_FTP,
'127.0.0.1',
- pyautolib.FilePath(data_dir))
+ pyautolib.FilePath(path))
assert ftp_server.Start(), 'Could not start ftp server'
logging.debug('Started ftp server at "%s".', data_dir)
return ftp_server
@@ -874,9 +876,11 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
Returns:
handle to the HTTP TestServer
"""
+ source_dir = os.path.normpath(pyauto_paths.GetSourceDir())
+ path = os.path.join(source_dir, data_dir)
http_server = pyautolib.TestServer(pyautolib.TestServer.TYPE_HTTP,
'127.0.0.1',
- pyautolib.FilePath(data_dir))
+ pyautolib.FilePath(path))
assert http_server.Start(), 'Could not start HTTP server'
logging.debug('Started HTTP server at "%s".', data_dir)
return http_server
@@ -898,10 +902,12 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
Returns:
Handle to the HTTPS TestServer
"""
+ source_dir = os.path.normpath(pyauto_paths.GetSourceDir())
+ path = os.path.join(source_dir, data_dir)
https_server = pyautolib.TestServer(
pyautolib.TestServer.TYPE_HTTPS,
pyautolib.SSLOptions(cert_type),
- pyautolib.FilePath(data_dir))
+ pyautolib.FilePath(path))
assert https_server.Start(), 'Could not start HTTPS server.'
logging.debug('Start HTTPS server at "%s".' % data_dir)
return https_server
@@ -5851,9 +5857,11 @@ class PyUITestSuite(pyautolib.PyUITestSuiteBase, unittest.TestSuite):
global _HTTP_SERVER
assert not _HTTP_SERVER, 'HTTP Server already started'
http_data_dir = _OPTIONS.http_data_dir
+ source_dir = os.path.normpath(pyauto_paths.GetSourceDir())
+ path = os.path.join(source_dir, http_data_dir)
http_server = pyautolib.TestServer(pyautolib.TestServer.TYPE_HTTP,
'127.0.0.1',
- pyautolib.FilePath(http_data_dir))
+ pyautolib.FilePath(path))
assert http_server.Start(), 'Could not start http server'
_HTTP_SERVER = http_server
logging.debug('Started http server at "%s".', http_data_dir)

Powered by Google App Engine
This is Rietveld 408576698