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 "net/http/http_request_headers.h" | 5 #include "net/http/http_request_headers.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "net/log/net_log_capture_mode.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 TEST(HttpRequestHeaders, HasHeader) { | 17 TEST(HttpRequestHeaders, HasHeader) { |
17 HttpRequestHeaders headers; | 18 HttpRequestHeaders headers; |
18 headers.SetHeader("Foo", "bar"); | 19 headers.SetHeader("Foo", "bar"); |
19 EXPECT_TRUE(headers.HasHeader("foo")); | 20 EXPECT_TRUE(headers.HasHeader("foo")); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 ASSERT_TRUE(HttpRequestHeaders::FromNetLogParam(event_param.get(), | 181 ASSERT_TRUE(HttpRequestHeaders::FromNetLogParam(event_param.get(), |
181 &headers2, | 182 &headers2, |
182 &request_line2)); | 183 &request_line2)); |
183 EXPECT_EQ(request_line, request_line2); | 184 EXPECT_EQ(request_line, request_line2); |
184 EXPECT_EQ("B: b\r\nA: a\r\n\r\n", headers2.ToString()); | 185 EXPECT_EQ("B: b\r\nA: a\r\n\r\n", headers2.ToString()); |
185 } | 186 } |
186 | 187 |
187 } // namespace | 188 } // namespace |
188 | 189 |
189 } // namespace net | 190 } // namespace net |
OLD | NEW |