| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Takes in a Value created from a NetLogHttpResponseParameter, and returns | 120 // Takes in a Value created from a NetLogHttpResponseParameter, and returns |
| 121 // a JSONified list of headers as a single string. Uses single quotes instead | 121 // a JSONified list of headers as a single string. Uses single quotes instead |
| 122 // of double quotes for easier comparison. Returns false on failure. | 122 // of double quotes for easier comparison. Returns false on failure. |
| 123 bool GetHeaders(base::DictionaryValue* params, std::string* headers) { | 123 bool GetHeaders(base::DictionaryValue* params, std::string* headers) { |
| 124 if (!params) | 124 if (!params) |
| 125 return false; | 125 return false; |
| 126 base::ListValue* header_list; | 126 base::ListValue* header_list; |
| 127 if (!params->GetList("headers", &header_list)) | 127 if (!params->GetList("headers", &header_list)) |
| 128 return false; | 128 return false; |
| 129 std::string double_quote_headers; | 129 std::string double_quote_headers; |
| 130 base::JSONWriter::Write(header_list, &double_quote_headers); | 130 base::JSONWriter::Write(*header_list, &double_quote_headers); |
| 131 base::ReplaceChars(double_quote_headers, "\"", "'", headers); | 131 base::ReplaceChars(double_quote_headers, "\"", "'", headers); |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 // Tests LoadTimingInfo in the case a socket is reused and no PAC script is | 135 // Tests LoadTimingInfo in the case a socket is reused and no PAC script is |
| 136 // used. | 136 // used. |
| 137 void TestLoadTimingReused(const LoadTimingInfo& load_timing_info) { | 137 void TestLoadTimingReused(const LoadTimingInfo& load_timing_info) { |
| 138 EXPECT_TRUE(load_timing_info.socket_reused); | 138 EXPECT_TRUE(load_timing_info.socket_reused); |
| 139 EXPECT_NE(NetLog::Source::kInvalidId, load_timing_info.socket_log_id); | 139 EXPECT_NE(NetLog::Source::kInvalidId, load_timing_info.socket_log_id); |
| 140 | 140 |
| (...skipping 14138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14279 ASSERT_TRUE(response); | 14279 ASSERT_TRUE(response); |
| 14280 ASSERT_TRUE(response->headers.get()); | 14280 ASSERT_TRUE(response->headers.get()); |
| 14281 | 14281 |
| 14282 EXPECT_EQ(101, response->headers->response_code()); | 14282 EXPECT_EQ(101, response->headers->response_code()); |
| 14283 | 14283 |
| 14284 trans.reset(); | 14284 trans.reset(); |
| 14285 session->CloseAllConnections(); | 14285 session->CloseAllConnections(); |
| 14286 } | 14286 } |
| 14287 | 14287 |
| 14288 } // namespace net | 14288 } // namespace net |
| OLD | NEW |