| 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..6579f93e9eb7ebcd34a345659e040fb77111d01e 100644
|
| --- a/net/http/http_util_unittest.cc
|
| +++ b/net/http/http_util_unittest.cc
|
| @@ -1178,4 +1178,45 @@ TEST(HttpUtilTest, NameValuePairsIteratorMissingEndQuote) {
|
| &parser, false, true, std::string(), std::string()));
|
| }
|
|
|
| +TEST(HttpUtilTest, HasValidatorsHttp09) {
|
| + std::string etags[] = {"", "\"strong\"", "W/\"weak\""};
|
| + std::string last_modified_values[] = {"", "Tue, 15 Nov 1994 12:45:26 GMT",
|
| + "invalid"};
|
| +
|
| + for (const std::string& etag : etags) {
|
| + for (const std::string& last_modified : last_modified_values) {
|
| + EXPECT_FALSE(
|
| + HttpUtil::HasValidators(HttpVersion(0, 9), etag, last_modified));
|
| + }
|
| + }
|
| +}
|
| +
|
| +TEST(HttpUtilTest, HasValidatorsHttp10) {
|
| + std::string etags[] = {"", "\"strong\"", "W/\"weak\""};
|
| + std::string last_modified_values[] = {"", "Tue, 15 Nov 1994 12:45:26 GMT",
|
| + "invalid"};
|
| +
|
| + for (const std::string& etag : etags) {
|
| + for (const std::string& last_modified : last_modified_values) {
|
| + EXPECT_EQ(
|
| + last_modified != "" && last_modified != "invalid",
|
| + HttpUtil::HasValidators(HttpVersion(1, 0), etag, last_modified));
|
| + }
|
| + }
|
| +}
|
| +
|
| +TEST(HttpUtilTest, HasValidatorsHttp11) {
|
| + std::string etags[] = {"", "\"strong\"", "W/\"weak\""};
|
| + std::string last_modified_values[] = {"", "Tue, 15 Nov 1994 12:45:26 GMT",
|
| + "invalid"};
|
| +
|
| + for (const std::string& etag : etags) {
|
| + for (const std::string& last_modified : last_modified_values) {
|
| + EXPECT_EQ(
|
| + etag != "" || (last_modified != "" && last_modified != "invalid"),
|
| + HttpUtil::HasValidators(HttpVersion(1, 1), etag, last_modified));
|
| + }
|
| + }
|
| +}
|
| +
|
| } // namespace net
|
|
|