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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const QuicServerId& server_id, | 43 const QuicServerId& server_id, |
44 const QuicConfig& config, | 44 const QuicConfig& config, |
45 const QuicVersionVector& supported_versions, | 45 const QuicVersionVector& supported_versions, |
46 EpollServer* epoll_server); | 46 EpollServer* epoll_server); |
47 | 47 |
48 ~MockableQuicClient() override; | 48 ~MockableQuicClient() override; |
49 QuicPacketWriter* CreateQuicPacketWriter() override; | 49 QuicPacketWriter* CreateQuicPacketWriter() override; |
50 QuicConnectionId GenerateConnectionId() override; | 50 QuicConnectionId GenerateConnectionId() override; |
51 void UseWriter(QuicPacketWriterWrapper* writer); | 51 void UseWriter(QuicPacketWriterWrapper* writer); |
52 void UseConnectionId(QuicConnectionId connection_id); | 52 void UseConnectionId(QuicConnectionId connection_id); |
| 53 void SendCachedNetworkParamaters( |
| 54 const CachedNetworkParameters& cached_network_params) { |
| 55 cached_network_paramaters_ = cached_network_params; |
| 56 } |
53 | 57 |
54 private: | 58 private: |
55 QuicConnectionId override_connection_id_; // ConnectionId to use, if nonzero | 59 QuicConnectionId override_connection_id_; // ConnectionId to use, if nonzero |
56 QuicPacketWriterWrapper* test_writer_; | 60 QuicPacketWriterWrapper* test_writer_; |
| 61 CachedNetworkParameters cached_network_paramaters_; |
57 | 62 |
58 DISALLOW_COPY_AND_ASSIGN(MockableQuicClient); | 63 DISALLOW_COPY_AND_ASSIGN(MockableQuicClient); |
59 }; | 64 }; |
60 | 65 |
61 // A toy QUIC client used for testing, mostly following the SimpleClient APIs. | 66 // A toy QUIC client used for testing, mostly following the SimpleClient APIs. |
62 class QuicTestClient : public SimpleClient, | 67 class QuicTestClient : public SimpleClient, |
63 public QuicDataStream::Visitor { | 68 public QuicDataStream::Visitor { |
64 public: | 69 public: |
65 QuicTestClient(IPEndPoint server_address, | 70 QuicTestClient(IPEndPoint server_address, |
66 const std::string& server_hostname, | 71 const std::string& server_hostname, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 211 |
207 DISALLOW_COPY_AND_ASSIGN(QuicTestClient); | 212 DISALLOW_COPY_AND_ASSIGN(QuicTestClient); |
208 }; | 213 }; |
209 | 214 |
210 } // namespace test | 215 } // namespace test |
211 | 216 |
212 } // namespace tools | 217 } // namespace tools |
213 } // namespace net | 218 } // namespace net |
214 | 219 |
215 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 220 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
OLD | NEW |