diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-07 17:52:05 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-07 17:52:05 +0000 |
commit | 1bc869d5bb06728b63a3e9a603605e27ead5f985 (patch) | |
tree | 9fe051a473073ff5316b83d1f955c04849ccea4f /net | |
parent | 1ae412959a5ff5cfe4d2538f8580df8645631eec (diff) | |
download | chromium_src-1bc869d5bb06728b63a3e9a603605e27ead5f985.zip chromium_src-1bc869d5bb06728b63a3e9a603605e27ead5f985.tar.gz chromium_src-1bc869d5bb06728b63a3e9a603605e27ead5f985.tar.bz2 |
Fix the *AcceptCharset* and *AcceptLanguage* net test failures on the ChromeFrame IE6 builder. These tests
randomly fail as IE6 caches the response as per the directive passed back by the python webserver.
Proposed fix is to send back the no-cache header for all echoheader requests. The URLRequestTestHTTP.VaryHeader
test expects the response to be cached. Added a new url substring /echoheadercache which returns back the
expected cache header.
Removed the echoheaderoverride url handling from the test server.
BUG=none
TEST=ChromeFrame net tests should pass on IE6. Net tests should continue to pass everywhere else.
Review URL: http://codereview.chromium.org/6810001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rwxr-xr-x | net/tools/testserver/testserver.py | 22 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.cc | 16 |
2 files changed, 17 insertions, 21 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index 36e0a89..2ba417f 100755 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py @@ -278,7 +278,7 @@ class TestPageHandler(BasePageHandler): self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, - self.EchoHeaderOverride, + self.EchoHeaderCache, self.EchoAllHandler, self.FileHandler, self.SetCookieHandler, @@ -555,19 +555,12 @@ class TestPageHandler(BasePageHandler): 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") - 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") + """This function echoes back the value of a specific request header""" + """while allowing caching for 16 hours.""" + def EchoHeaderCache(self): + return self.EchoHeaderHelper("/echoheadercache") def EchoHeaderHelper(self, echo_header): """This function echoes back the value of the request header passed in.""" @@ -580,7 +573,10 @@ class TestPageHandler(BasePageHandler): self.send_response(200) self.send_header('Content-type', 'text/plain') - self.send_header('Cache-control', 'max-age=60000') + if echo_header == '/echoheadercache': + self.send_header('Cache-control', 'max-age=60000') + else: + self.send_header('Cache-control', 'no-cache') # insert a vary header to properly indicate that the cachability of this # request is subject to value of the request header being echoed. if len(header_name) > 0: diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 662b615..394f813 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -1256,7 +1256,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) { // populate the cache { TestDelegate d; - URLRequest req(test_server_.GetURL("echoheader?foo"), &d); + URLRequest req(test_server_.GetURL("echoheadercache?foo"), &d); req.set_context(context); HttpRequestHeaders headers; headers.SetHeader("foo", "1"); @@ -1268,7 +1268,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) { // expect a cache hit { TestDelegate d; - URLRequest req(test_server_.GetURL("echoheader?foo"), &d); + URLRequest req(test_server_.GetURL("echoheadercache?foo"), &d); req.set_context(context); HttpRequestHeaders headers; headers.SetHeader("foo", "1"); @@ -1282,7 +1282,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) { // expect a cache miss { TestDelegate d; - URLRequest req(test_server_.GetURL("echoheader?foo"), &d); + URLRequest req(test_server_.GetURL("echoheadercache?foo"), &d); req.set_context(context); HttpRequestHeaders headers; headers.SetHeader("foo", "2"); @@ -2670,7 +2670,7 @@ TEST_F(URLRequestTestHTTP, EmptyAcceptLanguage) { ASSERT_TRUE(test_server_.Start()); TestDelegate d; - TestURLRequest req(test_server_.GetURL("echoheaderoverride?Accept-Language"), + TestURLRequest req(test_server_.GetURL("echoheader?Accept-Language"), &d); scoped_refptr<URLRequestContext> context = new TestURLRequestContext; context->set_accept_language(""); @@ -2687,7 +2687,7 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptLanguage) { TestDelegate d; TestURLRequest - req(test_server_.GetURL("echoheaderoverride?Accept-Language"), &d); + req(test_server_.GetURL("echoheader?Accept-Language"), &d); req.set_context(new TestURLRequestContext()); HttpRequestHeaders headers; headers.SetHeader(HttpRequestHeaders::kAcceptLanguage, "ru"); @@ -2716,7 +2716,7 @@ TEST_F(URLRequestTestHTTP, EmptyAcceptCharset) { ASSERT_TRUE(test_server_.Start()); TestDelegate d; - TestURLRequest req(test_server_.GetURL("echoheaderoverride?Accept-Charset"), + TestURLRequest req(test_server_.GetURL("echoheader?Accept-Charset"), &d); scoped_refptr<URLRequestContext> context = new TestURLRequestContext; context->set_accept_charset(""); @@ -2733,7 +2733,7 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptCharset) { TestDelegate d; TestURLRequest - req(test_server_.GetURL("echoheaderoverride?Accept-Charset"), &d); + req(test_server_.GetURL("echoheader?Accept-Charset"), &d); req.set_context(new TestURLRequestContext()); HttpRequestHeaders headers; headers.SetHeader(HttpRequestHeaders::kAcceptCharset, "koi-8r"); @@ -2762,7 +2762,7 @@ TEST_F(URLRequestTestHTTP, OverrideUserAgent) { TestDelegate d; TestURLRequest - req(test_server_.GetURL("echoheaderoverride?User-Agent"), &d); + req(test_server_.GetURL("echoheader?User-Agent"), &d); req.set_context(new TestURLRequestContext()); HttpRequestHeaders headers; headers.SetHeader(HttpRequestHeaders::kUserAgent, "Lynx (textmode)"); |