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/core/quic_connection.h" | 5 #include "net/quic/core/quic_connection.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <utility> | 10 #include <utility> |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 kDefaultPathId)), | 705 kDefaultPathId)), |
706 frame1_(1, false, 0, StringPiece(data1)), | 706 frame1_(1, false, 0, StringPiece(data1)), |
707 frame2_(1, false, 3, StringPiece(data2)), | 707 frame2_(1, false, 3, StringPiece(data2)), |
708 packet_number_length_(PACKET_6BYTE_PACKET_NUMBER), | 708 packet_number_length_(PACKET_6BYTE_PACKET_NUMBER), |
709 connection_id_length_(PACKET_8BYTE_CONNECTION_ID) { | 709 connection_id_length_(PACKET_8BYTE_CONNECTION_ID) { |
710 connection_.set_defer_send_in_response_to_packets(GetParam().ack_response == | 710 connection_.set_defer_send_in_response_to_packets(GetParam().ack_response == |
711 AckResponse::kDefer); | 711 AckResponse::kDefer); |
712 FLAGS_quic_always_log_bugs_for_tests = true; | 712 FLAGS_quic_always_log_bugs_for_tests = true; |
713 connection_.set_visitor(&visitor_); | 713 connection_.set_visitor(&visitor_); |
714 connection_.SetSendAlgorithm(kDefaultPathId, send_algorithm_); | 714 connection_.SetSendAlgorithm(kDefaultPathId, send_algorithm_); |
715 connection_.SetLossAlgorithm(kDefaultPathId, loss_algorithm_); | 715 connection_.SetLossAlgorithm(kDefaultPathId, loss_algorithm_.get()); |
716 framer_.set_received_entropy_calculator(&entropy_calculator_); | 716 framer_.set_received_entropy_calculator(&entropy_calculator_); |
717 peer_framer_.set_received_entropy_calculator(&peer_entropy_calculator_); | 717 peer_framer_.set_received_entropy_calculator(&peer_entropy_calculator_); |
718 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)) | 718 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)) |
719 .WillRepeatedly(Return(QuicTime::Delta::Zero())); | 719 .WillRepeatedly(Return(QuicTime::Delta::Zero())); |
720 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)) | 720 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)) |
721 .Times(AnyNumber()); | 721 .Times(AnyNumber()); |
722 EXPECT_CALL(*send_algorithm_, RetransmissionDelay()) | 722 EXPECT_CALL(*send_algorithm_, RetransmissionDelay()) |
723 .WillRepeatedly(Return(QuicTime::Delta::Zero())); | 723 .WillRepeatedly(Return(QuicTime::Delta::Zero())); |
724 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) | 724 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) |
725 .WillRepeatedly(Return(kDefaultTCPMSS)); | 725 .WillRepeatedly(Return(kDefaultTCPMSS)); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 QuicFramerPeer::SetPerspective(&peer_framer_, | 1061 QuicFramerPeer::SetPerspective(&peer_framer_, |
1062 InvertPerspective(perspective)); | 1062 InvertPerspective(perspective)); |
1063 } | 1063 } |
1064 | 1064 |
1065 QuicConnectionId connection_id_; | 1065 QuicConnectionId connection_id_; |
1066 QuicFramer framer_; | 1066 QuicFramer framer_; |
1067 MockEntropyCalculator entropy_calculator_; | 1067 MockEntropyCalculator entropy_calculator_; |
1068 MockEntropyCalculator peer_entropy_calculator_; | 1068 MockEntropyCalculator peer_entropy_calculator_; |
1069 | 1069 |
1070 MockSendAlgorithm* send_algorithm_; | 1070 MockSendAlgorithm* send_algorithm_; |
1071 MockLossAlgorithm* loss_algorithm_; | 1071 std::unique_ptr<MockLossAlgorithm> loss_algorithm_; |
1072 MockClock clock_; | 1072 MockClock clock_; |
1073 MockRandom random_generator_; | 1073 MockRandom random_generator_; |
1074 SimpleBufferAllocator buffer_allocator_; | 1074 SimpleBufferAllocator buffer_allocator_; |
1075 std::unique_ptr<TestConnectionHelper> helper_; | 1075 std::unique_ptr<TestConnectionHelper> helper_; |
1076 std::unique_ptr<TestAlarmFactory> alarm_factory_; | 1076 std::unique_ptr<TestAlarmFactory> alarm_factory_; |
1077 QuicFramer peer_framer_; | 1077 QuicFramer peer_framer_; |
1078 QuicPacketCreator peer_creator_; | 1078 QuicPacketCreator peer_creator_; |
1079 std::unique_ptr<TestPacketWriter> writer_; | 1079 std::unique_ptr<TestPacketWriter> writer_; |
1080 TestConnection connection_; | 1080 TestConnection connection_; |
1081 QuicPacketCreator* creator_; | 1081 QuicPacketCreator* creator_; |
(...skipping 3904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4986 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2); | 4986 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2); |
4987 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, | 4987 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, |
4988 ConnectionCloseSource::FROM_SELF)) | 4988 ConnectionCloseSource::FROM_SELF)) |
4989 .Times(1); | 4989 .Times(1); |
4990 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); | 4990 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); |
4991 } | 4991 } |
4992 | 4992 |
4993 } // namespace | 4993 } // namespace |
4994 } // namespace test | 4994 } // namespace test |
4995 } // namespace net | 4995 } // namespace net |
OLD | NEW |