Chromium Code Reviews| 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 |