diff options
author | pathorn@chromium.org <pathorn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 18:25:35 +0000 |
---|---|---|
committer | pathorn@chromium.org <pathorn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 18:25:35 +0000 |
commit | 885dc2c4995c28dcd4381d845cb39522782dac29 (patch) | |
tree | 632b9df5ac938a54fdb7f9fccef3d4cb894f8619 /net/tools | |
parent | 8b9be1aeeff8ed853ec0a724442e7d8b090937b7 (diff) | |
download | chromium_src-885dc2c4995c28dcd4381d845cb39522782dac29.zip chromium_src-885dc2c4995c28dcd4381d845cb39522782dac29.tar.gz chromium_src-885dc2c4995c28dcd4381d845cb39522782dac29.tar.bz2 |
Allow testserver to run without chromiumsync.
BUG=43624
TEST=Able to run 'PYTHONPATH=third_party/tlslite:third_party/pyftpdlib python net/tools/testserver/testserver.py --data-dir=chrome/test/data/'
Review URL: http://codereview.chromium.org/3014036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/testserver/testserver.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index 999cde7..e950ff8 100644 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py @@ -28,8 +28,6 @@ import pyftpdlib.ftpserver import tlslite import tlslite.api -import chromiumsync - try: import hashlib _new_md5 = hashlib.md5 @@ -145,8 +143,6 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler): BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, request, client_address, socket_server) - # Class variable; shared across requests. - _sync_handler = chromiumsync.TestServer() def _ShouldHandleRequest(self, handler_name): """Determines if the path can be handled by the handler. @@ -1021,7 +1017,11 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler): length = int(self.headers.getheader('content-length')) raw_request = self.rfile.read(length) - http_response, raw_reply = self._sync_handler.HandleCommand(raw_request) + if not self.server._sync_handler: + import chromiumsync + self.server._sync_handler = chromiumsync.TestServer() + http_response, raw_reply = self.server._sync_handler.HandleCommand( + raw_request) self.send_response(http_response) self.end_headers() self.wfile.write(raw_reply) @@ -1198,6 +1198,8 @@ def main(options, args): server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url + server._sync_handler = None + MakeDumpDir(server.data_dir) # means FTP Server |