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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 using QuicConnection::SelectMutualVersion; | 549 using QuicConnection::SelectMutualVersion; |
550 | 550 |
551 private: | 551 private: |
552 TestPacketWriter* writer_; | 552 TestPacketWriter* writer_; |
553 | 553 |
554 DISALLOW_COPY_AND_ASSIGN(TestConnection); | 554 DISALLOW_COPY_AND_ASSIGN(TestConnection); |
555 }; | 555 }; |
556 | 556 |
557 // Used for testing packets revived from FEC packets. | 557 // Used for testing packets revived from FEC packets. |
558 class FecQuicConnectionDebugVisitor | 558 class FecQuicConnectionDebugVisitor |
559 : public QuicConnectionDebugVisitorInterface { | 559 : public QuicConnectionDebugVisitor { |
560 public: | 560 public: |
561 virtual void OnRevivedPacket(const QuicPacketHeader& header, | 561 virtual void OnRevivedPacket(const QuicPacketHeader& header, |
562 StringPiece data) OVERRIDE { | 562 StringPiece data) OVERRIDE { |
563 revived_header_ = header; | 563 revived_header_ = header; |
564 } | 564 } |
565 | 565 |
566 // Public accessor method. | 566 // Public accessor method. |
567 QuicPacketHeader revived_header() const { | 567 QuicPacketHeader revived_header() const { |
568 return revived_header_; | 568 return revived_header_; |
569 } | 569 } |
(...skipping 3292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3862 | 3862 |
3863 QuicPacket* packet = | 3863 QuicPacket* packet = |
3864 BuildUnsizedDataPacket(&framer_, ack_header, frames).packet; | 3864 BuildUnsizedDataPacket(&framer_, ack_header, frames).packet; |
3865 | 3865 |
3866 // Take the packet which contains the ACK frame, and construct and deliver an | 3866 // Take the packet which contains the ACK frame, and construct and deliver an |
3867 // FEC packet which allows the ACK packet to be recovered. | 3867 // FEC packet which allows the ACK packet to be recovered. |
3868 ProcessFecPacket(2, 1, true, !kEntropyFlag, packet); | 3868 ProcessFecPacket(2, 1, true, !kEntropyFlag, packet); |
3869 } | 3869 } |
3870 | 3870 |
3871 class MockQuicConnectionDebugVisitor | 3871 class MockQuicConnectionDebugVisitor |
3872 : public QuicConnectionDebugVisitorInterface { | 3872 : public QuicConnectionDebugVisitor { |
3873 public: | 3873 public: |
3874 MOCK_METHOD1(OnFrameAddedToPacket, | 3874 MOCK_METHOD1(OnFrameAddedToPacket, |
3875 void(const QuicFrame&)); | 3875 void(const QuicFrame&)); |
3876 | 3876 |
3877 MOCK_METHOD5(OnPacketSent, | 3877 MOCK_METHOD5(OnPacketSent, |
3878 void(QuicPacketSequenceNumber, | 3878 void(QuicPacketSequenceNumber, |
3879 EncryptionLevel, | 3879 EncryptionLevel, |
3880 TransmissionType, | 3880 TransmissionType, |
3881 const QuicEncryptedPacket&, | 3881 const QuicEncryptedPacket&, |
3882 WriteResult)); | 3882 WriteResult)); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3964 QuicBlockedFrame blocked; | 3964 QuicBlockedFrame blocked; |
3965 blocked.stream_id = 3; | 3965 blocked.stream_id = 3; |
3966 EXPECT_CALL(visitor_, OnBlockedFrames(_)); | 3966 EXPECT_CALL(visitor_, OnBlockedFrames(_)); |
3967 ProcessFramePacket(QuicFrame(&blocked)); | 3967 ProcessFramePacket(QuicFrame(&blocked)); |
3968 EXPECT_TRUE(ack_alarm->IsSet()); | 3968 EXPECT_TRUE(ack_alarm->IsSet()); |
3969 } | 3969 } |
3970 | 3970 |
3971 } // namespace | 3971 } // namespace |
3972 } // namespace test | 3972 } // namespace test |
3973 } // namespace net | 3973 } // namespace net |
OLD | NEW |