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

Unified Diff: net/http/http_response_headers_unittest.cc

Issue 1129983003: Handle HTTP-Version information as per RFC2616 sec 3.1 references. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments Created 5 years, 7 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
diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc
index c3aff96ea9b42e145074de2cedf8bf245e1fed91..e2b6d0b861452d253a88415f026ed9451a9fa7e7 100644
--- a/net/http/http_response_headers_unittest.cc
+++ b/net/http/http_response_headers_unittest.cc
@@ -185,6 +185,123 @@ TestData response_headers_tests[] = {
200,
HttpVersion(0, 9),
HttpVersion(0, 9)},
+ {// Test for two or more digits in http version
+
+ "HTTP/01.1 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(1, 1),
+ net::HttpVersion(1, 1)},
+ {// Test for two or more digits in http version
+
+ "HTTP/10.1 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(10, 1),
+ net::HttpVersion(1, 1)},
+ {// Test for two or more digits in http version
+
+ "HTTP/1.01 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(1, 1),
+ net::HttpVersion(1, 1)},
+ {// Test for two or more digits in http version
+
+ "HTTP/1.10 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(1, 10),
+ net::HttpVersion(1, 1)},
+ {// Test for octal vs decimal digits in http version
+
+ "HTTP/9.9 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(9, 9),
+ net::HttpVersion(1, 1)},
+ {// Test for two or more digits in http version
+
+ "HTTP/21.21 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(21, 21),
+ net::HttpVersion(1, 1)},
+ {// Test for signed digits in http version
+
+ "HTTP/-21.21 200 OK\n",
+
+ "HTTP/1.0 200 OK\n",
+
+ 200,
+ net::HttpVersion(0, 0),
+ net::HttpVersion(1, 0)},
+ {// Test for signed digits in http version
+
+ "HTTP/+21.21 200 OK\n",
+
+ "HTTP/1.0 200 OK\n",
+
+ 200,
+ net::HttpVersion(0, 0),
+ net::HttpVersion(1, 0)},
+ {// Test for overflow condition in http version
+
+ "HTTP/4294967295.1 200 OK\n",
+
+ "HTTP/1.0 200 OK\n",
+
+ 200,
+ net::HttpVersion(0, 0),
+ net::HttpVersion(1, 0)},
+ {// Test for boundary condition in http version
+
+ "HTTP/65535.1 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(65535, 1),
+ net::HttpVersion(1, 1)},
+ {// Test for overflow (2^32) in http version
+
+ "HTTP/4.4294967296 200 OK\n",
+
+ "HTTP/1.0 200 OK\n",
+
+ 200,
+ net::HttpVersion(0, 0),
+ net::HttpVersion(1, 0)},
+ {// Test for overflow (2^64) in http version
+
+ "HTTP/18446744073709551616 200 OK\n",
+
+ "HTTP/1.0 200 OK\n",
+
+ 200,
+ net::HttpVersion(0, 0),
+ net::HttpVersion(1, 0)},
+ {// Test for alphanumeric in http version
+
+ "HTTP/12aaasa.1 200 OK\n",
+
+ "HTTP/1.0 200 OK\n",
+
+ 200,
+ net::HttpVersion(0, 0),
+ net::HttpVersion(1, 0)},
{// Add missing OK.
"HTTP/1.1 201\n"
« 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