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

Unified Diff: net/http/http_util_unittest.cc

Issue 1481143002: Added HttpUtils::HasValidators and HttpResponse::HasValidators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« net/http/http_util.cc ('K') | « net/http/http_util.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_util_unittest.cc
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index a5c984db66b1f5e46798036e8c1ac3758fab9f81..8c38206a737482d4897fc95651b5f1650b319546 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -1178,4 +1178,20 @@ TEST(HttpUtilTest, NameValuePairsIteratorMissingEndQuote) {
&parser, false, true, std::string(), std::string()));
}
+TEST(HttpUtilTest, HasValidators) {
bengr 2015/12/03 17:42:21 For completeness, I think you should test the foll
jamartin (wrong) 2015/12/08 16:58:18 Done. I've gone for the full N^3 approach on this
+ EXPECT_FALSE(HttpUtil::HasValidators(HttpVersion(0, 9), "anything",
+ "Tue, 15 Nov 1994 12:45:26 GMT"));
+
+ EXPECT_FALSE(HttpUtil::HasValidators(HttpVersion(1, 0), "", ""));
+ EXPECT_FALSE(HttpUtil::HasValidators(HttpVersion(1, 0), "stub etag", ""));
bengr 2015/12/03 17:42:21 Maybe use the string "anything" here too, as well
jamartin (wrong) 2015/12/08 16:58:18 Done.
+ EXPECT_FALSE(HttpUtil::HasValidators(HttpVersion(1, 0), "", "invalid date"));
+ EXPECT_TRUE(HttpUtil::HasValidators(HttpVersion(1, 0), "",
bengr 2015/12/03 17:42:21 Also EXPECT_TRUE when both an etag and a last-modi
jamartin (wrong) 2015/12/08 16:58:18 Done.
+ "Tue, 15 Nov 1994 12:45:26 GMT"));
+
+ EXPECT_FALSE(HttpUtil::HasValidators(HttpVersion(1, 1), "", ""));
+ EXPECT_TRUE(HttpUtil::HasValidators(HttpVersion(1, 1), "stub etag", ""));
+ EXPECT_TRUE(HttpUtil::HasValidators(HttpVersion(1, 1), "stub etag",
+ "Tue, 15 Nov 1994 12:45:26 GMT"));
+}
+
} // namespace net
« net/http/http_util.cc ('K') | « net/http/http_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698