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> |
11 | 11 |
12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
| 13 #include "net/quic/crypto/cached_network_parameters.h" |
13 #include "net/quic/quic_connection.h" | 14 #include "net/quic/quic_connection.h" |
14 #include "net/quic/quic_packet_writer.h" | 15 #include "net/quic/quic_packet_writer.h" |
15 #include "net/quic/quic_session.h" | 16 #include "net/quic/quic_session.h" |
16 #include "net/spdy/spdy_framer.h" | 17 #include "net/spdy/spdy_framer.h" |
17 #include "net/tools/quic/quic_dispatcher.h" | 18 #include "net/tools/quic/quic_dispatcher.h" |
18 #include "net/tools/quic/quic_per_connection_packet_writer.h" | 19 #include "net/tools/quic/quic_per_connection_packet_writer.h" |
19 #include "net/tools/quic/quic_server_session.h" | 20 #include "net/tools/quic/quic_server_session.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
21 | 22 |
22 namespace net { | 23 namespace net { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 QuicStreamOffset bytes_written)); | 88 QuicStreamOffset bytes_written)); |
88 MOCK_METHOD3(SendGoAway, void(QuicErrorCode error, | 89 MOCK_METHOD3(SendGoAway, void(QuicErrorCode error, |
89 QuicStreamId last_good_stream_id, | 90 QuicStreamId last_good_stream_id, |
90 const std::string& reason)); | 91 const std::string& reason)); |
91 MOCK_METHOD1(SendBlocked, void(QuicStreamId id)); | 92 MOCK_METHOD1(SendBlocked, void(QuicStreamId id)); |
92 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id, | 93 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id, |
93 QuicStreamOffset byte_offset)); | 94 QuicStreamOffset byte_offset)); |
94 MOCK_METHOD0(OnCanWrite, void()); | 95 MOCK_METHOD0(OnCanWrite, void()); |
95 MOCK_CONST_METHOD0(HasPendingWrites, bool()); | 96 MOCK_CONST_METHOD0(HasPendingWrites, bool()); |
96 | 97 |
| 98 MOCK_METHOD1(ResumeConnectionState, void(const CachedNetworkParameters&)); |
| 99 |
97 void ReallyProcessUdpPacket(const IPEndPoint& self_address, | 100 void ReallyProcessUdpPacket(const IPEndPoint& self_address, |
98 const IPEndPoint& peer_address, | 101 const IPEndPoint& peer_address, |
99 const QuicEncryptedPacket& packet) { | 102 const QuicEncryptedPacket& packet) { |
100 QuicConnection::ProcessUdpPacket(self_address, peer_address, packet); | 103 QuicConnection::ProcessUdpPacket(self_address, peer_address, packet); |
101 } | 104 } |
102 | 105 |
103 virtual bool OnProtocolVersionMismatch(QuicVersion version) override { | 106 virtual bool OnProtocolVersionMismatch(QuicVersion version) override { |
104 return false; | 107 return false; |
105 } | 108 } |
106 | 109 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 void Unregister(PerConnectionPacketWriter* writer); | 216 void Unregister(PerConnectionPacketWriter* writer); |
214 | 217 |
215 PerConnectionPacketWriter* current_writer_; | 218 PerConnectionPacketWriter* current_writer_; |
216 }; | 219 }; |
217 | 220 |
218 } // namespace test | 221 } // namespace test |
219 } // namespace tools | 222 } // namespace tools |
220 } // namespace net | 223 } // namespace net |
221 | 224 |
222 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 225 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |