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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 std::vector<QuicPacket*> packets_; | 310 std::vector<QuicPacket*> packets_; |
311 std::vector<QuicEncryptedPacket*> encrypted_packets_; | 311 std::vector<QuicEncryptedPacket*> encrypted_packets_; |
312 | 312 |
313 private: | 313 private: |
314 DISALLOW_COPY_AND_ASSIGN(PacketSavingConnection); | 314 DISALLOW_COPY_AND_ASSIGN(PacketSavingConnection); |
315 }; | 315 }; |
316 | 316 |
317 class MockSession : public QuicSession { | 317 class MockSession : public QuicSession { |
318 public: | 318 public: |
319 MockSession(QuicConnection* connection, bool is_server); | 319 explicit MockSession(QuicConnection* connection); |
320 virtual ~MockSession(); | 320 virtual ~MockSession(); |
321 | 321 |
322 MOCK_METHOD4(OnPacket, bool(const IPEndPoint& self_address, | 322 MOCK_METHOD4(OnPacket, bool(const IPEndPoint& self_address, |
323 const IPEndPoint& peer_address, | 323 const IPEndPoint& peer_address, |
324 const QuicPacketHeader& header, | 324 const QuicPacketHeader& header, |
325 const std::vector<QuicStreamFrame>& frame)); | 325 const std::vector<QuicStreamFrame>& frame)); |
326 MOCK_METHOD2(OnConnectionClosed, void(QuicErrorCode error, bool from_peer)); | 326 MOCK_METHOD2(OnConnectionClosed, void(QuicErrorCode error, bool from_peer)); |
327 MOCK_METHOD1(CreateIncomingDataStream, QuicDataStream*(QuicStreamId id)); | 327 MOCK_METHOD1(CreateIncomingDataStream, QuicDataStream*(QuicStreamId id)); |
328 MOCK_METHOD0(GetCryptoStream, QuicCryptoStream*()); | 328 MOCK_METHOD0(GetCryptoStream, QuicCryptoStream*()); |
329 MOCK_METHOD0(CreateOutgoingDataStream, QuicDataStream*()); | 329 MOCK_METHOD0(CreateOutgoingDataStream, QuicDataStream*()); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 MockAckNotifierDelegate(); | 443 MockAckNotifierDelegate(); |
444 virtual ~MockAckNotifierDelegate(); | 444 virtual ~MockAckNotifierDelegate(); |
445 | 445 |
446 MOCK_METHOD0(OnAckNotification, void()); | 446 MOCK_METHOD0(OnAckNotification, void()); |
447 }; | 447 }; |
448 | 448 |
449 } // namespace test | 449 } // namespace test |
450 } // namespace net | 450 } // namespace net |
451 | 451 |
452 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 452 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |