| 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/quic/chromium/quic_http_stream.h" | 5 #include "net/quic/chromium/quic_http_stream.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "net/quic/chromium/quic_http_utils.h" | 35 #include "net/quic/chromium/quic_http_utils.h" |
| 36 #include "net/quic/chromium/quic_server_info.h" | 36 #include "net/quic/chromium/quic_server_info.h" |
| 37 #include "net/quic/chromium/quic_test_packet_maker.h" | 37 #include "net/quic/chromium/quic_test_packet_maker.h" |
| 38 #include "net/quic/core/congestion_control/send_algorithm_interface.h" | 38 #include "net/quic/core/congestion_control/send_algorithm_interface.h" |
| 39 #include "net/quic/core/crypto/crypto_protocol.h" | 39 #include "net/quic/core/crypto/crypto_protocol.h" |
| 40 #include "net/quic/core/crypto/quic_decrypter.h" | 40 #include "net/quic/core/crypto/quic_decrypter.h" |
| 41 #include "net/quic/core/crypto/quic_encrypter.h" | 41 #include "net/quic/core/crypto/quic_encrypter.h" |
| 42 #include "net/quic/core/quic_connection.h" | 42 #include "net/quic/core/quic_connection.h" |
| 43 #include "net/quic/core/quic_write_blocked_list.h" | 43 #include "net/quic/core/quic_write_blocked_list.h" |
| 44 #include "net/quic/core/spdy_utils.h" | 44 #include "net/quic/core/spdy_utils.h" |
| 45 #include "net/quic/platform/api/quic_string_piece.h" |
| 45 #include "net/quic/test_tools/crypto_test_utils.h" | 46 #include "net/quic/test_tools/crypto_test_utils.h" |
| 46 #include "net/quic/test_tools/mock_clock.h" | 47 #include "net/quic/test_tools/mock_clock.h" |
| 47 #include "net/quic/test_tools/mock_random.h" | 48 #include "net/quic/test_tools/mock_random.h" |
| 48 #include "net/quic/test_tools/quic_connection_peer.h" | 49 #include "net/quic/test_tools/quic_connection_peer.h" |
| 49 #include "net/quic/test_tools/quic_test_utils.h" | 50 #include "net/quic/test_tools/quic_test_utils.h" |
| 50 #include "net/quic/test_tools/test_task_runner.h" | 51 #include "net/quic/test_tools/test_task_runner.h" |
| 51 #include "net/socket/socket_performance_watcher.h" | 52 #include "net/socket/socket_performance_watcher.h" |
| 52 #include "net/socket/socket_test_util.h" | 53 #include "net/socket/socket_test_util.h" |
| 53 #include "net/spdy/spdy_frame_builder.h" | 54 #include "net/spdy/spdy_frame_builder.h" |
| 54 #include "net/spdy/spdy_framer.h" | 55 #include "net/spdy/spdy_framer.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 response_headers_ = server_maker_.GetResponseHeaders(status); | 362 response_headers_ = server_maker_.GetResponseHeaders(status); |
| 362 response_data_ = body; | 363 response_data_ = body; |
| 363 } | 364 } |
| 364 | 365 |
| 365 std::unique_ptr<QuicReceivedPacket> InnerConstructDataPacket( | 366 std::unique_ptr<QuicReceivedPacket> InnerConstructDataPacket( |
| 366 QuicPacketNumber packet_number, | 367 QuicPacketNumber packet_number, |
| 367 QuicStreamId stream_id, | 368 QuicStreamId stream_id, |
| 368 bool should_include_version, | 369 bool should_include_version, |
| 369 bool fin, | 370 bool fin, |
| 370 QuicStreamOffset offset, | 371 QuicStreamOffset offset, |
| 371 base::StringPiece data, | 372 QuicStringPiece data, |
| 372 QuicTestPacketMaker* maker) { | 373 QuicTestPacketMaker* maker) { |
| 373 return maker->MakeDataPacket(packet_number, stream_id, | 374 return maker->MakeDataPacket(packet_number, stream_id, |
| 374 should_include_version, fin, offset, data); | 375 should_include_version, fin, offset, data); |
| 375 } | 376 } |
| 376 | 377 |
| 377 std::unique_ptr<QuicReceivedPacket> ConstructClientDataPacket( | 378 std::unique_ptr<QuicReceivedPacket> ConstructClientDataPacket( |
| 378 QuicPacketNumber packet_number, | 379 QuicPacketNumber packet_number, |
| 379 bool should_include_version, | 380 bool should_include_version, |
| 380 bool fin, | 381 bool fin, |
| 381 QuicStreamOffset offset, | 382 QuicStreamOffset offset, |
| 382 base::StringPiece data) { | 383 QuicStringPiece data) { |
| 383 return InnerConstructDataPacket(packet_number, stream_id_, | 384 return InnerConstructDataPacket(packet_number, stream_id_, |
| 384 should_include_version, fin, offset, data, | 385 should_include_version, fin, offset, data, |
| 385 &client_maker_); | 386 &client_maker_); |
| 386 } | 387 } |
| 387 | 388 |
| 388 std::unique_ptr<QuicReceivedPacket> ConstructServerDataPacket( | 389 std::unique_ptr<QuicReceivedPacket> ConstructServerDataPacket( |
| 389 QuicPacketNumber packet_number, | 390 QuicPacketNumber packet_number, |
| 390 bool should_include_version, | 391 bool should_include_version, |
| 391 bool fin, | 392 bool fin, |
| 392 QuicStreamOffset offset, | 393 QuicStreamOffset offset, |
| 393 base::StringPiece data) { | 394 QuicStringPiece data) { |
| 394 return InnerConstructDataPacket(packet_number, stream_id_, | 395 return InnerConstructDataPacket(packet_number, stream_id_, |
| 395 should_include_version, fin, offset, data, | 396 should_include_version, fin, offset, data, |
| 396 &server_maker_); | 397 &server_maker_); |
| 397 } | 398 } |
| 398 | 399 |
| 399 std::unique_ptr<QuicReceivedPacket> InnerConstructRequestHeadersPacket( | 400 std::unique_ptr<QuicReceivedPacket> InnerConstructRequestHeadersPacket( |
| 400 QuicPacketNumber packet_number, | 401 QuicPacketNumber packet_number, |
| 401 QuicStreamId stream_id, | 402 QuicStreamId stream_id, |
| 402 bool should_include_version, | 403 bool should_include_version, |
| 403 bool fin, | 404 bool fin, |
| (...skipping 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 EXPECT_TRUE(AtEof()); | 2161 EXPECT_TRUE(AtEof()); |
| 2161 | 2162 |
| 2162 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. | 2163 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. |
| 2163 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), | 2164 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), |
| 2164 stream_->GetTotalSentBytes()); | 2165 stream_->GetTotalSentBytes()); |
| 2165 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); | 2166 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); |
| 2166 } | 2167 } |
| 2167 | 2168 |
| 2168 } // namespace test | 2169 } // namespace test |
| 2169 } // namespace net | 2170 } // namespace net |
| OLD | NEW |