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

Unified Diff: net/http/http_response_headers_unittest.cc

Issue 527883002: Modified to resolve TODO in parseversion in http_response_headers.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified code as per review comments Created 6 years, 3 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
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 098ce73e99aa48a85c42311b3876228ac37567f3..67296d13aab29cb975c2812cc2369a9c733bd415 100644
--- a/net/http/http_response_headers_unittest.cc
+++ b/net/http/http_response_headers_unittest.cc
@@ -193,6 +193,95 @@ TestData response_headers_tests[] = {
net::HttpVersion(0,9)
},
{
+ // Test for Leading zeros 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 Leading zeros in http version
+
+ "HTTP/0001.1 200 OK\n",
+
+ "HTTP/1.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(1, 1),
+ net::HttpVersion(1, 1)
+ },
+ {
+ // Test for Leading zeros in http version
+
+ "HTTP/10.1 200 OK\n",
+
+ "HTTP/10.1 200 OK\n",
+
+ 200,
+ net::HttpVersion(10, 1),
+ net::HttpVersion(10, 1)
+ },
+ {
+ // Test for Leading zeros 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 multiple digits in http version
+
+ "HTTP/21.1 200 OK\n",
+
+ "HTTP/21.1 200 OK\n",
+
+ 200,
+
+ net::HttpVersion(21, 1),
+ net::HttpVersion(21, 1)
+ },
+ {
+ // Test for multiple digits in http version
+
+ "HTTP/1.21 200 OK\n",
+
+ "HTTP/1.21 200 OK\n",
+
+ 200,
+ net::HttpVersion(1, 21),
+ net::HttpVersion(1, 21)
+ },
+ {
+ // Test for multiple digits in http version
+
+ "HTTP/21.21 200 OK\n",
+
+ "HTTP/21.21 200 OK\n",
+
+ 200,
+ net::HttpVersion(21, 21),
+ net::HttpVersion(21, 21)
+ },
+ {
+ // Test for multiple digits in http version
+
+ "HTTP/221.21 200 OK\n",
+
+ "HTTP/221.21 200 OK\n",
+
+ 200,
+ net::HttpVersion(221, 21),
+ net::HttpVersion(221, 21)
+ },
+ {
// Add missing OK.
"HTTP/1.1 201\n"

Powered by Google App Engine
This is Rietveld 408576698