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

Unified Diff: net/http/http_response_headers_unittest.cc

Issue 448373003: parameterize http response header tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 76790e3e69e526bdb60ba15cb6c0fd35cf68ce84..1666b59797bd7d2629cf8dd6b46ef54c259ada67 100644
--- a/net/http/http_response_headers_unittest.cc
+++ b/net/http/http_response_headers_unittest.cc
@@ -33,6 +33,11 @@ struct ContentTypeTestData {
const std::string all_content_type;
};
+struct MaxAgeTestData {
+ const char* max_age_string;
+ const int64 expected_seconds;
+};
+
class HttpResponseHeadersTest : public testing::Test {
};
@@ -2026,10 +2031,7 @@ TEST_F(HttpResponseHeadersCacheControlTest, MaxAgeEdgeCases) {
// This test doesn't use TEST_P() for consistency with the rest of the tests
// in this file.
// TODO(ricea): Port the tests in this file to use TEST_P().
- const struct {
- const char* max_age_string;
- int64 expected_seconds;
- } tests[] = {
+ const MaxAgeTestData tests[] = {
Adam Rice 2014/08/11 12:17:54 It would probably be better to use ARRAYSIZE_UNSAF
Mostyn Bramley-Moore 2014/08/11 12:24:02 I could try converting them all to use arraysize,
Adam Rice 2014/08/11 12:28:46 Unless you're willing to refactor all the tests to
Mostyn Bramley-Moore 2014/08/11 12:35:36 I will give that a try, but it might take a day or
{" 1 ", 1}, // Spaces are ignored
{"-1", -1}, // Negative numbers are passed through
{"--1", 0}, // Leading junk gives 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698