Chromium Code Reviews| 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 ead30dd1dd27d5450ef3936c86fade5d59c6a224..04e030b5082f35d6a78c83e0ab81304ee9946b50 100644 |
| --- a/net/http/http_response_headers_unittest.cc |
| +++ b/net/http/http_response_headers_unittest.cc |
| @@ -1801,6 +1801,40 @@ INSTANTIATE_TEST_CASE_P(HttpResponseHeaders, |
| HasStrongValidatorsTest, |
| testing::ValuesIn(strong_validators_tests)); |
| +TEST(HttpResponseHeadersTest, HasValidatorsNone) { |
|
bengr
2015/12/03 17:42:21
Add tests that expect false when the HTTP version
jamartin (wrong)
2015/12/08 16:58:18
Those test are already in http_util_unittest.cc, w
|
| + 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"); |
|
bengr
2015/12/03 17:42:21
Add a test that expects false when last-modified h
jamartin (wrong)
2015/12/08 16:58:18
Please see my reply above.
|
| + 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()); |
| +} |
| + |
| TEST(HttpResponseHeadersTest, GetStatusText) { |
| std::string headers("HTTP/1.1 404 Not Found"); |
| HeadersToRaw(&headers); |