| 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 14090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14231 ASSERT_TRUE(response); | 14231 ASSERT_TRUE(response); |
| 14232 ASSERT_TRUE(response->headers.get()); | 14232 ASSERT_TRUE(response->headers.get()); |
| 14233 | 14233 |
| 14234 EXPECT_EQ(101, response->headers->response_code()); | 14234 EXPECT_EQ(101, response->headers->response_code()); |
| 14235 | 14235 |
| 14236 trans.reset(); | 14236 trans.reset(); |
| 14237 session->CloseAllConnections(); | 14237 session->CloseAllConnections(); |
| 14238 } | 14238 } |
| 14239 | 14239 |
| 14240 } // namespace net | 14240 } // namespace net |
| OLD | NEW |