| 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 HttpRequestHeaders headers; | 169 HttpRequestHeaders headers; |
| 170 headers.SetHeader("B", "b"); | 170 headers.SetHeader("B", "b"); |
| 171 headers.SetHeader("A", "a"); | 171 headers.SetHeader("A", "a"); |
| 172 std::string request_line("GET /stuff"); | 172 std::string request_line("GET /stuff"); |
| 173 | 173 |
| 174 scoped_ptr<base::Value> event_param( | 174 scoped_ptr<base::Value> event_param( |
| 175 headers.NetLogCallback(&request_line, NetLog::LOG_ALL_BUT_BYTES)); | 175 headers.NetLogCallback(&request_line, NetLog::LOG_ALL_BUT_BYTES)); |
| 176 HttpRequestHeaders headers2; | 176 HttpRequestHeaders headers2; |
| 177 std::string request_line2; | 177 std::string request_line2; |
| 178 | 178 |
| 179 ASSERT_TRUE(HttpRequestHeaders::FromNetLogParam(event_param.get(), | 179 ASSERT_TRUE(HttpRequestHeaders::FromNetLogParam( |
| 180 &headers2, | 180 event_param.get(), &headers2, &request_line2)); |
| 181 &request_line2)); | |
| 182 EXPECT_EQ(request_line, request_line2); | 181 EXPECT_EQ(request_line, request_line2); |
| 183 EXPECT_EQ("B: b\r\nA: a\r\n\r\n", headers2.ToString()); | 182 EXPECT_EQ("B: b\r\nA: a\r\n\r\n", headers2.ToString()); |
| 184 } | 183 } |
| 185 | 184 |
| 186 } // namespace | 185 } // namespace |
| 187 | 186 |
| 188 } // namespace net | 187 } // namespace net |
| OLD | NEW |