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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 virtual ~MockableQuicClient() OVERRIDE; | 47 virtual ~MockableQuicClient() OVERRIDE; |
48 virtual QuicPacketWriter* CreateQuicPacketWriter() OVERRIDE; | 48 virtual QuicPacketWriter* CreateQuicPacketWriter() OVERRIDE; |
49 virtual QuicConnectionId GenerateConnectionId() OVERRIDE; | 49 virtual QuicConnectionId GenerateConnectionId() OVERRIDE; |
50 void UseWriter(QuicPacketWriterWrapper* writer); | 50 void UseWriter(QuicPacketWriterWrapper* writer); |
51 void UseConnectionId(QuicConnectionId connection_id); | 51 void UseConnectionId(QuicConnectionId connection_id); |
52 | 52 |
53 private: | 53 private: |
54 QuicConnectionId override_connection_id_; // ConnectionId to use, if nonzero | 54 QuicConnectionId override_connection_id_; // ConnectionId to use, if nonzero |
55 QuicPacketWriterWrapper* test_writer_; | 55 QuicPacketWriterWrapper* test_writer_; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(MockableQuicClient); |
56 }; | 58 }; |
57 | 59 |
58 // A toy QUIC client used for testing, mostly following the SimpleClient APIs. | 60 // A toy QUIC client used for testing, mostly following the SimpleClient APIs. |
59 class QuicTestClient : public SimpleClient, | 61 class QuicTestClient : public SimpleClient, |
60 public QuicDataStream::Visitor { | 62 public QuicDataStream::Visitor { |
61 public: | 63 public: |
62 QuicTestClient(IPEndPoint server_address, | 64 QuicTestClient(IPEndPoint server_address, |
63 const string& server_hostname, | 65 const string& server_hostname, |
64 const QuicVersionVector& supported_versions); | 66 const QuicVersionVector& supported_versions); |
65 QuicTestClient(IPEndPoint server_address, | 67 QuicTestClient(IPEndPoint server_address, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // The client will auto-connect exactly once before sending data. If | 189 // The client will auto-connect exactly once before sending data. If |
188 // something causes a connection reset, it will not automatically reconnect | 190 // something causes a connection reset, it will not automatically reconnect |
189 // unless auto_reconnect_ is true. | 191 // unless auto_reconnect_ is true. |
190 bool auto_reconnect_; | 192 bool auto_reconnect_; |
191 // Should we buffer the response body? Defaults to true. | 193 // Should we buffer the response body? Defaults to true. |
192 bool buffer_body_; | 194 bool buffer_body_; |
193 | 195 |
194 // proof_verifier_ points to a RecordingProofVerifier that is owned by | 196 // proof_verifier_ points to a RecordingProofVerifier that is owned by |
195 // client_. | 197 // client_. |
196 ProofVerifier* proof_verifier_; | 198 ProofVerifier* proof_verifier_; |
| 199 |
| 200 DISALLOW_COPY_AND_ASSIGN(QuicTestClient); |
197 }; | 201 }; |
198 | 202 |
199 } // namespace test | 203 } // namespace test |
200 | 204 |
201 } // namespace tools | 205 } // namespace tools |
202 } // namespace net | 206 } // namespace net |
203 | 207 |
204 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 208 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
OLD | NEW |