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/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 .WillRepeatedly(Return(QuicTime::Zero())); | 655 .WillRepeatedly(Return(QuicTime::Zero())); |
656 EXPECT_CALL(*loss_algorithm_, DetectLostPackets(_, _, _, _)) | 656 EXPECT_CALL(*loss_algorithm_, DetectLostPackets(_, _, _, _)) |
657 .WillRepeatedly(Return(SequenceNumberSet())); | 657 .WillRepeatedly(Return(SequenceNumberSet())); |
658 } | 658 } |
659 | 659 |
660 QuicVersion version() { | 660 QuicVersion version() { |
661 return GetParam(); | 661 return GetParam(); |
662 } | 662 } |
663 | 663 |
664 QuicAckFrame* outgoing_ack() { | 664 QuicAckFrame* outgoing_ack() { |
665 outgoing_ack_.reset(QuicConnectionPeer::CreateAckFrame(&connection_)); | 665 QuicConnectionPeer::PopulateAckFrame(&connection_, &ack_); |
666 return outgoing_ack_.get(); | 666 return &ack_; |
667 } | 667 } |
668 | 668 |
669 QuicStopWaitingFrame* stop_waiting() { | 669 QuicStopWaitingFrame* stop_waiting() { |
670 stop_waiting_.reset( | 670 QuicConnectionPeer::PopulateStopWaitingFrame(&connection_, &stop_waiting_); |
671 QuicConnectionPeer::CreateStopWaitingFrame(&connection_)); | 671 return &stop_waiting_; |
672 return stop_waiting_.get(); | |
673 } | 672 } |
674 | 673 |
675 QuicPacketSequenceNumber least_unacked() { | 674 QuicPacketSequenceNumber least_unacked() { |
676 if (writer_->stop_waiting_frames().empty()) { | 675 if (writer_->stop_waiting_frames().empty()) { |
677 return 0; | 676 return 0; |
678 } | 677 } |
679 return writer_->stop_waiting_frames()[0].least_unacked; | 678 return writer_->stop_waiting_frames()[0].least_unacked; |
680 } | 679 } |
681 | 680 |
682 void use_tagging_decrypter() { | 681 void use_tagging_decrypter() { |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 NiceMock<MockPacketWriterFactory> factory_; | 998 NiceMock<MockPacketWriterFactory> factory_; |
1000 TestConnection connection_; | 999 TestConnection connection_; |
1001 QuicPacketCreator* creator_; | 1000 QuicPacketCreator* creator_; |
1002 QuicPacketGenerator* generator_; | 1001 QuicPacketGenerator* generator_; |
1003 QuicSentPacketManager* manager_; | 1002 QuicSentPacketManager* manager_; |
1004 StrictMock<MockConnectionVisitor> visitor_; | 1003 StrictMock<MockConnectionVisitor> visitor_; |
1005 | 1004 |
1006 QuicPacketHeader header_; | 1005 QuicPacketHeader header_; |
1007 QuicStreamFrame frame1_; | 1006 QuicStreamFrame frame1_; |
1008 QuicStreamFrame frame2_; | 1007 QuicStreamFrame frame2_; |
1009 scoped_ptr<QuicAckFrame> outgoing_ack_; | 1008 QuicAckFrame ack_; |
1010 scoped_ptr<QuicStopWaitingFrame> stop_waiting_; | 1009 QuicStopWaitingFrame stop_waiting_; |
1011 QuicSequenceNumberLength sequence_number_length_; | 1010 QuicSequenceNumberLength sequence_number_length_; |
1012 QuicConnectionIdLength connection_id_length_; | 1011 QuicConnectionIdLength connection_id_length_; |
1013 | 1012 |
1014 private: | 1013 private: |
1015 DISALLOW_COPY_AND_ASSIGN(QuicConnectionTest); | 1014 DISALLOW_COPY_AND_ASSIGN(QuicConnectionTest); |
1016 }; | 1015 }; |
1017 | 1016 |
1018 // Run all end to end tests with all supported versions. | 1017 // Run all end to end tests with all supported versions. |
1019 INSTANTIATE_TEST_CASE_P(SupportedVersion, | 1018 INSTANTIATE_TEST_CASE_P(SupportedVersion, |
1020 QuicConnectionTest, | 1019 QuicConnectionTest, |
(...skipping 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4422 // Regression test for b/18594622 | 4421 // Regression test for b/18594622 |
4423 scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate); | 4422 scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate); |
4424 EXPECT_DFATAL( | 4423 EXPECT_DFATAL( |
4425 connection_.SendStreamDataWithString(3, "", 0, !kFin, delegate.get()), | 4424 connection_.SendStreamDataWithString(3, "", 0, !kFin, delegate.get()), |
4426 "Attempt to send empty stream frame"); | 4425 "Attempt to send empty stream frame"); |
4427 } | 4426 } |
4428 | 4427 |
4429 } // namespace | 4428 } // namespace |
4430 } // namespace test | 4429 } // namespace test |
4431 } // namespace net | 4430 } // namespace net |
OLD | NEW |