diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 16:09:41 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 16:09:41 +0000 |
commit | eb834fb878a343d3ff67ba087e783a6e796d6fd5 (patch) | |
tree | 1c730e3d447ec4bee84b402ad98a5518fe46172e /net/tools/testserver | |
parent | 596284a3e66f287144f397cc733ca32447f92df9 (diff) | |
download | chromium_src-eb834fb878a343d3ff67ba087e783a6e796d6fd5.zip chromium_src-eb834fb878a343d3ff67ba087e783a6e796d6fd5.tar.gz chromium_src-eb834fb878a343d3ff67ba087e783a6e796d6fd5.tar.bz2 |
Fixes ChromeFrame net tests which run the URLRequest unit tests by launching IE and having it issue
the corresponding HTTP requests via automation. Fixes as below:-
1. The DefaultAcceptCharset and DefaultAcceptLanguage tests were failing because the URL request automation
job would only read the extra headers from the request. These tests set these headers in the URLRequestContext.
We needed to mimic the functionality in the URLRequestHttpJob to add in these headers if they were not
already present. As part of this I moved the AppendHeaderIfMissing function from url_request_http_job.cc
to HttpUtil as it is needed by the automation job as well.
2. The OverrideAcceptLanguage and OverrideAcceptCharset tests started failing in chrome frame net tests
after the fixes to get the default versions of these tests to pass. These tests basically pass in the
Accept-Language and Accept-Charset headers and expect the same values to be echoed back. IE ends up
caching the responses from the default versions of these tests and thus echoes back the old response
which causes these tests to fail. I tried passing in the no-cache header from our HTTP server for
the EchoHeader tests but this did not work. To fix this we now pass in the echoheaderoverride
parameter for the OverrideAcceptLanguage and OverrideAcceptCharset tests. The HTTP server has been
updated to support this.
3. NotifyDone can be called on the job if the original request was redirected. Added a check for whether
NotifyDone was already called on the job in URLRequestAutomationJob
Review URL: http://codereview.chromium.org/322004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools/testserver')
-rw-r--r-- | net/tools/testserver/testserver.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index b80a939..98d5bbc 100644 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py @@ -113,6 +113,7 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler): self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, + self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, @@ -408,8 +409,23 @@ class TestPageHandler(BaseHTTPServer.BaseHTTPRequestHandler): def EchoHeader(self): """This handler echoes back the value of a specific request header.""" + """The only difference between this function and the EchoHeaderOverride""" + """function is in the parameter being passed to the helper function""" + return self.EchoHeaderHelper("/echoheader") - if not self._ShouldHandleRequest("/echoheader"): + def EchoHeaderOverride(self): + """This handler echoes back the value of a specific request header.""" + """The UrlRequest unit tests also execute for ChromeFrame which uses""" + """IE to issue HTTP requests using the host network stack.""" + """The Accept and Charset tests which expect the server to echo back""" + """the corresponding headers fail here as IE returns cached responses""" + """The EchoHeaderOverride parameter is an easy way to ensure that IE""" + """treats this request as a new request and does not cache it.""" + return self.EchoHeaderHelper("/echoheaderoverride") + + def EchoHeaderHelper(self, echo_header): + """This function echoes back the value of the request header passed in.""" + if not self._ShouldHandleRequest(echo_header): return False query_char = self.path.find('?') |