| 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_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 virtual ~MockConnection(); | 71 virtual ~MockConnection(); |
| 72 | 72 |
| 73 // If the constructor that uses a MockHelper has been used then this method | 73 // If the constructor that uses a MockHelper has been used then this method |
| 74 // will advance the time of the MockClock. | 74 // will advance the time of the MockClock. |
| 75 void AdvanceTime(QuicTime::Delta delta); | 75 void AdvanceTime(QuicTime::Delta delta); |
| 76 | 76 |
| 77 MOCK_METHOD3(ProcessUdpPacket, void(const IPEndPoint& self_address, | 77 MOCK_METHOD3(ProcessUdpPacket, void(const IPEndPoint& self_address, |
| 78 const IPEndPoint& peer_address, | 78 const IPEndPoint& peer_address, |
| 79 const QuicEncryptedPacket& packet)); | 79 const QuicEncryptedPacket& packet)); |
| 80 MOCK_METHOD1(SendConnectionClose, void(QuicErrorCode error)); | 80 MOCK_METHOD1(SendConnectionClose, void(QuicErrorCode error)); |
| 81 MOCK_METHOD2(SendConnectionCloseWithDetails, void( | 81 MOCK_METHOD2(SendConnectionCloseWithDetails, |
| 82 QuicErrorCode error, | 82 void(QuicErrorCode error, const std::string& details)); |
| 83 const std::string& details)); | 83 MOCK_METHOD2(SendConnectionClosePacket, |
| 84 MOCK_METHOD2(SendConnectionClosePacket, void(QuicErrorCode error, | 84 void(QuicErrorCode error, const std::string& details)); |
| 85 const std::string& details)); | |
| 86 MOCK_METHOD3(SendRstStream, void(QuicStreamId id, | 85 MOCK_METHOD3(SendRstStream, void(QuicStreamId id, |
| 87 QuicRstStreamErrorCode error, | 86 QuicRstStreamErrorCode error, |
| 88 QuicStreamOffset bytes_written)); | 87 QuicStreamOffset bytes_written)); |
| 89 MOCK_METHOD3(SendGoAway, void(QuicErrorCode error, | 88 MOCK_METHOD3(SendGoAway, |
| 90 QuicStreamId last_good_stream_id, | 89 void(QuicErrorCode error, |
| 91 const std::string& reason)); | 90 QuicStreamId last_good_stream_id, |
| 91 const std::string& reason)); |
| 92 MOCK_METHOD1(SendBlocked, void(QuicStreamId id)); | 92 MOCK_METHOD1(SendBlocked, void(QuicStreamId id)); |
| 93 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id, | 93 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id, |
| 94 QuicStreamOffset byte_offset)); | 94 QuicStreamOffset byte_offset)); |
| 95 MOCK_METHOD0(OnCanWrite, void()); | 95 MOCK_METHOD0(OnCanWrite, void()); |
| 96 MOCK_CONST_METHOD0(HasPendingWrites, bool()); | 96 MOCK_CONST_METHOD0(HasPendingWrites, bool()); |
| 97 | 97 |
| 98 MOCK_METHOD1(ResumeConnectionState, bool(const CachedNetworkParameters&)); | 98 MOCK_METHOD1(ResumeConnectionState, bool(const CachedNetworkParameters&)); |
| 99 | 99 |
| 100 void ReallyProcessUdpPacket(const IPEndPoint& self_address, | 100 void ReallyProcessUdpPacket(const IPEndPoint& self_address, |
| 101 const IPEndPoint& peer_address, | 101 const IPEndPoint& peer_address, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 class MockQuicServerSessionVisitor : public QuicServerSessionVisitor { | 152 class MockQuicServerSessionVisitor : public QuicServerSessionVisitor { |
| 153 public: | 153 public: |
| 154 MockQuicServerSessionVisitor(); | 154 MockQuicServerSessionVisitor(); |
| 155 virtual ~MockQuicServerSessionVisitor(); | 155 virtual ~MockQuicServerSessionVisitor(); |
| 156 MOCK_METHOD2(OnConnectionClosed, void(QuicConnectionId connection_id, | 156 MOCK_METHOD2(OnConnectionClosed, void(QuicConnectionId connection_id, |
| 157 QuicErrorCode error)); | 157 QuicErrorCode error)); |
| 158 MOCK_METHOD1(OnWriteBlocked, | 158 MOCK_METHOD1(OnWriteBlocked, |
| 159 void(QuicBlockedWriterInterface* blocked_writer)); | 159 void(QuicBlockedWriterInterface* blocked_writer)); |
| 160 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, |
| 161 void(QuicConnectionId connection_id)); |
| 162 MOCK_METHOD1(OnConnectionRemovedFromTimeWaitList, |
| 163 void(QuicConnectionId connection_id)); |
| 160 | 164 |
| 161 private: | 165 private: |
| 162 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionVisitor); | 166 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionVisitor); |
| 163 }; | 167 }; |
| 164 | 168 |
| 165 class MockAckNotifierDelegate : public QuicAckNotifier::DelegateInterface { | 169 class MockAckNotifierDelegate : public QuicAckNotifier::DelegateInterface { |
| 166 public: | 170 public: |
| 167 MockAckNotifierDelegate(); | 171 MockAckNotifierDelegate(); |
| 168 | 172 |
| 169 MOCK_METHOD5(OnAckNotification, void(int num_original_packets, | 173 MOCK_METHOD5(OnAckNotification, void(int num_original_packets, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 void Unregister(PerConnectionPacketWriter* writer); | 220 void Unregister(PerConnectionPacketWriter* writer); |
| 217 | 221 |
| 218 PerConnectionPacketWriter* current_writer_; | 222 PerConnectionPacketWriter* current_writer_; |
| 219 }; | 223 }; |
| 220 | 224 |
| 221 } // namespace test | 225 } // namespace test |
| 222 } // namespace tools | 226 } // namespace tools |
| 223 } // namespace net | 227 } // namespace net |
| 224 | 228 |
| 225 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 229 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |