Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1599)

Unified Diff: net/http/http_response_headers_unittest.cc

Issue 40137: Clean up HttpResponseHeaders::IsKeepAlive. Use the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Upload before checkin Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_response_headers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers_unittest.cc
===================================================================
--- net/http/http_response_headers_unittest.cc (revision 11044)
+++ net/http/http_response_headers_unittest.cc (working copy)
@@ -1042,6 +1042,17 @@
const char* headers;
bool expected_keep_alive;
} tests[] = {
+ // The status line fabricated by HttpNetworkTransaction for a 0.9 response.
+ // Treated as 0.9.
+ { "HTTP/0.9 200 OK",
+ false
+ },
+ // This could come from a broken server. Treated as 1.0 because it has a
+ // header.
+ { "HTTP/0.9 200 OK\n"
+ "connection: keep-alive\n",
+ true
+ },
{ "HTTP/1.1 200 OK\n",
true
},
@@ -1072,10 +1083,22 @@
"connection: keep-alive\n",
true
},
+ { "HTTP/1.0 200 OK\n"
+ "proxy-connection: close\n",
+ false
+ },
+ { "HTTP/1.0 200 OK\n"
+ "proxy-connection: keep-alive\n",
+ true
+ },
{ "HTTP/1.1 200 OK\n"
"proxy-connection: close\n",
false
},
+ { "HTTP/1.1 200 OK\n"
+ "proxy-connection: keep-alive\n",
+ true
+ },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
string headers(tests[i].headers);
« no previous file with comments | « net/http/http_response_headers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698