summaryrefslogtreecommitdiffstats
path: root/net/http/http_vary_data_unittest.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:15:43 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:15:43 +0000
commit8c76ae2ff868d7968c850f06822e2f8353bd87e1 (patch)
tree0051ecbee24c9b48fc46ae914aedd8b7a1ab0c25 /net/http/http_vary_data_unittest.cc
parent1e507001a1f4b7e9f96ad4faffd0448a586ac304 (diff)
downloadchromium_src-8c76ae2ff868d7968c850f06822e2f8353bd87e1.zip
chromium_src-8c76ae2ff868d7968c850f06822e2f8353bd87e1.tar.gz
chromium_src-8c76ae2ff868d7968c850f06822e2f8353bd87e1.tar.bz2
Use HttpRequestHeaders for extra_headers.
BUG=22588 Review URL: http://codereview.chromium.org/1604011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_vary_data_unittest.cc')
-rw-r--r--net/http/http_vary_data_unittest.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/http/http_vary_data_unittest.cc b/net/http/http_vary_data_unittest.cc
index 7b2bd16..38e4e32 100644
--- a/net/http/http_vary_data_unittest.cc
+++ b/net/http/http_vary_data_unittest.cc
@@ -23,7 +23,8 @@ struct TestTransaction {
std::replace(temp.begin(), temp.end(), '\n', '\0');
response = new net::HttpResponseHeaders(temp);
- request.extra_headers = request_headers;
+ request.extra_headers.Clear();
+ request.extra_headers.AddHeadersFromString(request_headers);
}
};
@@ -54,13 +55,13 @@ TEST(HttpVaryDataTest, MultipleInit) {
// Init to something valid.
TestTransaction t1;
- t1.Init("Foo: 1\nbar: 23", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
+ t1.Init("Foo: 1\r\nbar: 23", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
EXPECT_TRUE(v.Init(t1.request, *t1.response));
EXPECT_TRUE(v.is_valid());
// Now overwrite by initializing to something invalid.
TestTransaction t2;
- t2.Init("Foo: 1\nbar: 23", "HTTP/1.1 200 OK\nVary: *\n\n");
+ t2.Init("Foo: 1\r\nbar: 23", "HTTP/1.1 200 OK\nVary: *\n\n");
EXPECT_FALSE(v.Init(t2.request, *t2.response));
EXPECT_FALSE(v.is_valid());
}
@@ -80,10 +81,10 @@ TEST(HttpVaryDataTest, DoesVary) {
TEST(HttpVaryDataTest, DoesVary2) {
TestTransaction a;
- a.Init("Foo: 1\nbar: 23", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
+ a.Init("Foo: 1\r\nbar: 23", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
TestTransaction b;
- b.Init("Foo: 12\nbar: 3", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
+ b.Init("Foo: 12\r\nbar: 3", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
net::HttpVaryData v;
EXPECT_TRUE(v.Init(a.request, *a.response));
@@ -106,10 +107,10 @@ TEST(HttpVaryDataTest, DoesntVary) {
TEST(HttpVaryDataTest, DoesntVary2) {
TestTransaction a;
- a.Init("Foo: 1\nbAr: 2", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
+ a.Init("Foo: 1\r\nbAr: 2", "HTTP/1.1 200 OK\nVary: foo, bar\n\n");
TestTransaction b;
- b.Init("Foo: 1\nbaR: 2", "HTTP/1.1 200 OK\nVary: foo\nVary: bar\n\n");
+ b.Init("Foo: 1\r\nbaR: 2", "HTTP/1.1 200 OK\nVary: foo\nVary: bar\n\n");
net::HttpVaryData v;
EXPECT_TRUE(v.Init(a.request, *a.response));