diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 02:33:46 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 02:33:46 +0000 |
commit | 861fcd5d715f0590e75eddfb1bacb0ac356c8026 (patch) | |
tree | d16ca24619a70210141952fe0c50859418b5ef45 /net/tools | |
parent | 9fa24879b1b211336e6da511a8931f62ad6845d7 (diff) | |
download | chromium_src-861fcd5d715f0590e75eddfb1bacb0ac356c8026.zip chromium_src-861fcd5d715f0590e75eddfb1bacb0ac356c8026.tar.gz chromium_src-861fcd5d715f0590e75eddfb1bacb0ac356c8026.tar.bz2 |
Add the ability to not send cookies or send user name/password.
Added unit tests for the above functionality plus the do not save cookies functionality.
BUG=http://crbug.com/10961
TEST=Added unit tests for this. Also, this isn't yet called from the rest of the code.
Review URL: http://codereview.chromium.org/173206
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/testserver/testserver.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index aeee5e2..065ea7b 100644 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py @@ -117,6 +117,7 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler): self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, + self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, @@ -699,6 +700,26 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler): return True + def SetCookieHandler(self): + """This handler just sets a cookie, for testing cookie handling.""" + + if not self._ShouldHandleRequest("/set-cookie"): + return False + + query_char = self.path.find('?') + if query_char != -1: + cookie_values = self.path[query_char + 1:].split('&') + else: + cookie_values = ("",) + self.send_response(200) + self.send_header('Content-type', 'text/html') + for cookie_value in cookie_values: + self.send_header('Set-Cookie', '%s' % cookie_value) + self.end_headers() + for cookie_value in cookie_values: + self.wfile.write('%s' % cookie_value) + return True + def AuthBasicHandler(self): """This handler tests 'Basic' authentication. It just sends a page with title 'user/pass' if you succeed.""" |