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

Side by Side Diff: net/http/http_response_headers_unittest.cc

Issue 1594973004: Remove use of void** from HttpResponseHeaders::EnumerateHeaderLines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « net/http/http_response_headers.cc ('k') | net/spdy/spdy_http_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iostream> 8 #include <iostream>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 1048
1049 TEST_P(EnumerateHeaderLinesTest, EnumerateHeaderLines) { 1049 TEST_P(EnumerateHeaderLinesTest, EnumerateHeaderLines) {
1050 const EnumerateHeaderTestData test = GetParam(); 1050 const EnumerateHeaderTestData test = GetParam();
1051 1051
1052 std::string headers(test.headers); 1052 std::string headers(test.headers);
1053 HeadersToRaw(&headers); 1053 HeadersToRaw(&headers);
1054 scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers)); 1054 scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
1055 1055
1056 std::string name, value, lines; 1056 std::string name, value, lines;
1057 1057
1058 void* iter = NULL; 1058 size_t iter = 0;
1059 while (parsed->EnumerateHeaderLines(&iter, &name, &value)) { 1059 while (parsed->EnumerateHeaderLines(&iter, &name, &value)) {
1060 lines.append(name); 1060 lines.append(name);
1061 lines.append(": "); 1061 lines.append(": ");
1062 lines.append(value); 1062 lines.append(value);
1063 lines.append("\n"); 1063 lines.append("\n");
1064 } 1064 }
1065 1065
1066 EXPECT_EQ(std::string(test.expected_lines), lines); 1066 EXPECT_EQ(std::string(test.expected_lines), lines);
1067 } 1067 }
1068 1068
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 TEST_F(HttpResponseHeadersCacheControlTest, 2114 TEST_F(HttpResponseHeadersCacheControlTest,
2115 FirstStaleWhileRevalidateValueUsed) { 2115 FirstStaleWhileRevalidateValueUsed) {
2116 InitializeHeadersWithCacheControl( 2116 InitializeHeadersWithCacheControl(
2117 "stale-while-revalidate=1,stale-while-revalidate=7200"); 2117 "stale-while-revalidate=1,stale-while-revalidate=7200");
2118 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue()); 2118 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue());
2119 } 2119 }
2120 2120
2121 } // namespace 2121 } // namespace
2122 2122
2123 } // namespace net 2123 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_response_headers.cc ('k') | net/spdy/spdy_http_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698