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 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
6 | 6 |
7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 TestWriterFactory* factory_; | 616 TestWriterFactory* factory_; |
617 }; | 617 }; |
618 | 618 |
619 // If an asynchronous write is happening and |writer| gets deleted, this | 619 // If an asynchronous write is happening and |writer| gets deleted, this |
620 // clears the pointer to it to prevent use-after-free. | 620 // clears the pointer to it to prevent use-after-free. |
621 void Unregister(PerConnectionPacketWriter* writer); | 621 void Unregister(PerConnectionPacketWriter* writer); |
622 | 622 |
623 PerConnectionPacketWriter* current_writer_; | 623 PerConnectionPacketWriter* current_writer_; |
624 }; | 624 }; |
625 | 625 |
| 626 class MockQuicConnectionDebugVisitor : public QuicConnectionDebugVisitor { |
| 627 public: |
| 628 MockQuicConnectionDebugVisitor(); |
| 629 ~MockQuicConnectionDebugVisitor(); |
| 630 |
| 631 MOCK_METHOD1(OnFrameAddedToPacket, void(const QuicFrame&)); |
| 632 |
| 633 MOCK_METHOD6(OnPacketSent, |
| 634 void(const SerializedPacket&, |
| 635 QuicPacketSequenceNumber, |
| 636 EncryptionLevel, |
| 637 TransmissionType, |
| 638 const QuicEncryptedPacket&, |
| 639 QuicTime)); |
| 640 |
| 641 MOCK_METHOD3(OnPacketReceived, |
| 642 void(const IPEndPoint&, |
| 643 const IPEndPoint&, |
| 644 const QuicEncryptedPacket&)); |
| 645 |
| 646 MOCK_METHOD1(OnIncorrectConnectionId, void(QuicConnectionId)); |
| 647 |
| 648 MOCK_METHOD1(OnProtocolVersionMismatch, void(QuicVersion)); |
| 649 |
| 650 MOCK_METHOD1(OnPacketHeader, void(const QuicPacketHeader& header)); |
| 651 |
| 652 MOCK_METHOD1(OnStreamFrame, void(const QuicStreamFrame&)); |
| 653 |
| 654 MOCK_METHOD1(OnAckFrame, void(const QuicAckFrame& frame)); |
| 655 |
| 656 MOCK_METHOD1(OnStopWaitingFrame, void(const QuicStopWaitingFrame&)); |
| 657 |
| 658 MOCK_METHOD1(OnRstStreamFrame, void(const QuicRstStreamFrame&)); |
| 659 |
| 660 MOCK_METHOD1(OnConnectionCloseFrame, void(const QuicConnectionCloseFrame&)); |
| 661 |
| 662 MOCK_METHOD1(OnPublicResetPacket, void(const QuicPublicResetPacket&)); |
| 663 |
| 664 MOCK_METHOD1(OnVersionNegotiationPacket, |
| 665 void(const QuicVersionNegotiationPacket&)); |
| 666 |
| 667 MOCK_METHOD2(OnRevivedPacket, |
| 668 void(const QuicPacketHeader&, StringPiece payload)); |
| 669 }; |
| 670 |
626 } // namespace test | 671 } // namespace test |
627 } // namespace net | 672 } // namespace net |
628 | 673 |
629 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 674 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |