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 #include "testing/gmock/include/gmock/gmock.h" | 6 #include "testing/gmock/include/gmock/gmock.h" |
7 | 7 |
8 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
9 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 9 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 int fd, | 24 int fd, |
25 EpollServer* eps, | 25 EpollServer* eps, |
26 bool is_server); | 26 bool is_server); |
27 // Uses a MockHelper. | 27 // Uses a MockHelper. |
28 MockConnection(QuicGuid guid, IPEndPoint address, bool is_server); | 28 MockConnection(QuicGuid guid, IPEndPoint address, bool is_server); |
29 MockConnection(QuicGuid guid, | 29 MockConnection(QuicGuid guid, |
30 IPEndPoint address, | 30 IPEndPoint address, |
31 QuicConnectionHelperInterface* helper, bool is_server); | 31 QuicConnectionHelperInterface* helper, bool is_server); |
32 virtual ~MockConnection(); | 32 virtual ~MockConnection(); |
33 | 33 |
| 34 // If the constructor that uses a MockHelper has been used then this method |
| 35 // will advance the time of the MockClock. |
| 36 void AdvanceTime(QuicTime::Delta delta); |
| 37 |
34 MOCK_METHOD3(ProcessUdpPacket, void(const IPEndPoint& self_address, | 38 MOCK_METHOD3(ProcessUdpPacket, void(const IPEndPoint& self_address, |
35 const IPEndPoint& peer_address, | 39 const IPEndPoint& peer_address, |
36 const QuicEncryptedPacket& packet)); | 40 const QuicEncryptedPacket& packet)); |
37 MOCK_METHOD1(SendConnectionClose, void(QuicErrorCode error)); | 41 MOCK_METHOD1(SendConnectionClose, void(QuicErrorCode error)); |
38 MOCK_METHOD2(SendConnectionCloseWithDetails, void( | 42 MOCK_METHOD2(SendConnectionCloseWithDetails, void( |
39 QuicErrorCode error, | 43 QuicErrorCode error, |
40 const std::string& details)); | 44 const std::string& details)); |
41 MOCK_METHOD2(SendRstStream, void(QuicStreamId id, | 45 MOCK_METHOD2(SendRstStream, void(QuicStreamId id, |
42 QuicRstStreamErrorCode error)); | 46 QuicRstStreamErrorCode error)); |
43 MOCK_METHOD3(SendGoAway, void(QuicErrorCode error, | 47 MOCK_METHOD3(SendGoAway, void(QuicErrorCode error, |
(...skipping 15 matching lines...) Expand all Loading... |
59 const bool has_mock_helper_; | 63 const bool has_mock_helper_; |
60 | 64 |
61 DISALLOW_COPY_AND_ASSIGN(MockConnection); | 65 DISALLOW_COPY_AND_ASSIGN(MockConnection); |
62 }; | 66 }; |
63 | 67 |
64 } // namespace test | 68 } // namespace test |
65 } // namespace tools | 69 } // namespace tools |
66 } // namespace net | 70 } // namespace net |
67 | 71 |
68 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 72 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |