summaryrefslogtreecommitdiffstats
path: root/net/http/http_util.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 16:09:41 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 16:09:41 +0000
commiteb834fb878a343d3ff67ba087e783a6e796d6fd5 (patch)
tree1c730e3d447ec4bee84b402ad98a5518fe46172e /net/http/http_util.h
parent596284a3e66f287144f397cc733ca32447f92df9 (diff)
downloadchromium_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/http/http_util.h')
-rw-r--r--net/http/http_util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/http/http_util.h b/net/http/http_util.h
index a3b0def..c630cfe 100644
--- a/net/http/http_util.h
+++ b/net/http/http_util.h
@@ -144,6 +144,12 @@ class HttpUtil {
// 'euc-jp,utf-8;q=0.7,*;q=0.3'.
static std::string GenerateAcceptCharsetHeader(const std::string& charset);
+ // Helper. If |*headers| already contains |header_name| do nothing,
+ // otherwise add <header_name> ": " <header_value> to the end of the list.
+ static void AppendHeaderIfMissing(const char* header_name,
+ const std::string& header_value,
+ std::string* headers);
+
// Used to iterate over the name/value pairs of HTTP headers. To iterate
// over the values in a multi-value header, use ValuesIterator.
// See AssembleRawHeaders for joining line continuations (this iterator