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/quic/test_tools/quic_test_packet_maker.h" | 5 #include "net/quic/test_tools/quic_test_packet_maker.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "net/quic/quic_framer.h" | 9 #include "net/quic/quic_framer.h" |
10 #include "net/quic/quic_http_utils.h" | 10 #include "net/quic/quic_http_utils.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 base::StringPiece(spdy_frame->data(), spdy_frame->size())); | 223 base::StringPiece(spdy_frame->data(), spdy_frame->size())); |
224 return MakePacket(header_, QuicFrame(&frame)); | 224 return MakePacket(header_, QuicFrame(&frame)); |
225 } | 225 } |
226 | 226 |
227 SpdyHeaderBlock QuicTestPacketMaker::GetRequestHeaders( | 227 SpdyHeaderBlock QuicTestPacketMaker::GetRequestHeaders( |
228 const std::string& method, | 228 const std::string& method, |
229 const std::string& scheme, | 229 const std::string& scheme, |
230 const std::string& path) { | 230 const std::string& path) { |
231 SpdyHeaderBlock headers; | 231 SpdyHeaderBlock headers; |
232 if (version_ <= QUIC_VERSION_24) { | 232 if (version_ <= QUIC_VERSION_24) { |
| 233 headers[":version"] = "HTTP/1.1"; |
| 234 } |
| 235 headers[":method"] = method; |
| 236 if (version_ <= QUIC_VERSION_24) { |
233 headers[":host"] = host_; | 237 headers[":host"] = host_; |
234 } else { | 238 } else { |
235 headers[":authority"] = host_; | 239 headers[":authority"] = host_; |
236 } | 240 } |
| 241 headers[":scheme"] = scheme; |
237 headers[":path"] = path; | 242 headers[":path"] = path; |
238 headers[":scheme"] = scheme; | |
239 headers[":method"] = method; | |
240 if (version_ <= QUIC_VERSION_24) { | |
241 headers[":version"] = "HTTP/1.1"; | |
242 } | |
243 return headers; | 243 return headers; |
244 } | 244 } |
245 | 245 |
246 SpdyHeaderBlock QuicTestPacketMaker::GetResponseHeaders( | 246 SpdyHeaderBlock QuicTestPacketMaker::GetResponseHeaders( |
247 const std::string& status) { | 247 const std::string& status) { |
248 SpdyHeaderBlock headers; | 248 SpdyHeaderBlock headers; |
249 headers[":status"] = status; | 249 headers[":status"] = status; |
250 if (version_ <= QUIC_VERSION_24) { | 250 if (version_ <= QUIC_VERSION_24) { |
251 headers[":version"] = "HTTP/1.1"; | 251 headers[":version"] = "HTTP/1.1"; |
252 } | 252 } |
(...skipping 25 matching lines...) Expand all Loading... |
278 header_.public_header.version_flag = should_include_version; | 278 header_.public_header.version_flag = should_include_version; |
279 header_.public_header.packet_number_length = PACKET_1BYTE_PACKET_NUMBER; | 279 header_.public_header.packet_number_length = PACKET_1BYTE_PACKET_NUMBER; |
280 header_.packet_packet_number = packet_number; | 280 header_.packet_packet_number = packet_number; |
281 header_.fec_group = 0; | 281 header_.fec_group = 0; |
282 header_.entropy_flag = false; | 282 header_.entropy_flag = false; |
283 header_.fec_flag = false; | 283 header_.fec_flag = false; |
284 } | 284 } |
285 | 285 |
286 } // namespace test | 286 } // namespace test |
287 } // namespace net | 287 } // namespace net |
OLD | NEW |