OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |