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

Unified Diff: net/tools/testserver/testserver.py

Issue 3078031: Simple offline startup integration test. (Closed)
Patch Set: Disable test. Created 10 years, 4 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 | « net/tools/testserver/chromiumsync.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/testserver.py
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index 0ad5d285f5357ac508080cec60709d24c0148c19..849ec1794a7cc22bd1856ba7bb7dc766aaab514b 100644
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -127,6 +127,7 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.WriteFile,
self.EchoTitleHandler,
self.EchoAllHandler,
+ self.ChromiumSyncConfigureHandler,
self.ChromiumSyncCommandHandler,
self.EchoHandler] + self._get_handlers
self._put_handlers = [
@@ -1007,6 +1008,29 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.end_headers()
return True
+ def ChromiumSyncConfigureHandler(self):
+ """Handle updating the configuration of the sync server.
+
+ The name and value pairs of the post payload will update the
+ configuration of the sync server. Supported tuples are:
+ user_email,<email address> - Sets the email for the fake user account
+ """
+ test_name = "/chromiumsync/configure"
+ if not self._ShouldHandleRequest(test_name):
+ return False
+
+ length = int(self.headers.getheader('content-length'))
+ raw_request = self.rfile.read(length)
+ config = cgi.parse_qs(raw_request, keep_blank_values=1)
+
+ success = self._sync_handler.HandleConfigure(config)
+ if success:
+ self.send_response(200)
+ else:
+ self.send_response(500)
+ self.end_headers()
+ return True
+
def ChromiumSyncCommandHandler(self):
"""Handle a chromiumsync command arriving via http.
« no previous file with comments | « net/tools/testserver/chromiumsync.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698