| 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 cb0d200b2e76220a71e3379082a92a7c47e63244..70a5d09562a4a13d31f0c7bfebb92e64513ec74b 100644
|
| --- a/net/http/http_response_headers_unittest.cc
|
| +++ b/net/http/http_response_headers_unittest.cc
|
| @@ -1634,6 +1634,40 @@ INSTANTIATE_TEST_CASE_P(HttpResponseHeaders,
|
| HasStrongValidatorsTest,
|
| testing::ValuesIn(strong_validators_tests));
|
|
|
| +TEST(HttpResponseHeadersTest, HasValidatorsNone) {
|
| + std::string headers("HTTP/1.1 200 OK");
|
| + HeadersToRaw(&headers);
|
| + scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
|
| + EXPECT_FALSE(parsed->HasValidators());
|
| +}
|
| +
|
| +TEST(HttpResponseHeadersTest, HasValidatorsEtag) {
|
| + std::string headers(
|
| + "HTTP/1.1 200 OK\n"
|
| + "etag: \"anything\"");
|
| + HeadersToRaw(&headers);
|
| + scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
|
| + EXPECT_TRUE(parsed->HasValidators());
|
| +}
|
| +
|
| +TEST(HttpResponseHeadersTest, HasValidatorsLastModified) {
|
| + std::string headers(
|
| + "HTTP/1.1 200 OK\n"
|
| + "Last-Modified: Wed, 28 Nov 2007 00:40:10 GMT");
|
| + HeadersToRaw(&headers);
|
| + scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
|
| + EXPECT_TRUE(parsed->HasValidators());
|
| +}
|
| +
|
| +TEST(HttpResponseHeadersTest, HasValidatorsWeakEtag) {
|
| + std::string headers(
|
| + "HTTP/1.1 200 OK\n"
|
| + "etag: W/\"anything\"");
|
| + HeadersToRaw(&headers);
|
| + scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
|
| + EXPECT_TRUE(parsed->HasValidators());
|
| +}
|
| +
|
| struct AddHeaderTestData {
|
| const char* orig_headers;
|
| const char* new_header;
|
|
|