| 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_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ | 6 #define NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "net/quic/quic_framer.h" | 11 #include "net/quic/quic_framer.h" |
| 12 #include "net/quic/quic_packet_creator.h" | 12 #include "net/quic/quic_packet_creator.h" |
| 13 #include "net/quic/quic_protocol.h" | 13 #include "net/quic/quic_protocol.h" |
| 14 #include "net/tools/quic/quic_client.h" | 14 #include "net/tools/quic/quic_client.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 class ProofVerifier; | 18 class ProofVerifier; |
| 19 | 19 |
| 20 namespace tools { | 20 namespace tools { |
| 21 | 21 |
| 22 namespace test { | 22 namespace test { |
| 23 | 23 |
| 24 class HTTPMessage; | 24 class HTTPMessage; |
| 25 | 25 |
| 26 // A toy QUIC client used for testing. | 26 // A toy QUIC client used for testing. |
| 27 class QuicTestClient : public ReliableQuicStream::Visitor { | 27 class QuicTestClient : public ReliableQuicStream::Visitor { |
| 28 public: | 28 public: |
| 29 QuicTestClient(IPEndPoint server_address, const string& server_hostname); | 29 QuicTestClient(IPEndPoint server_address, const string& server_hostname, |
| 30 const QuicVersion version); |
| 30 QuicTestClient(IPEndPoint server_address, | 31 QuicTestClient(IPEndPoint server_address, |
| 31 const string& server_hostname, | 32 const string& server_hostname, |
| 32 bool secure); | 33 bool secure, |
| 34 const QuicVersion version); |
| 33 QuicTestClient(IPEndPoint server_address, | 35 QuicTestClient(IPEndPoint server_address, |
| 34 const string& server_hostname, | 36 const string& server_hostname, |
| 35 const QuicConfig& config); | 37 const QuicConfig& config, |
| 38 const QuicVersion version); |
| 36 | 39 |
| 37 virtual ~QuicTestClient(); | 40 virtual ~QuicTestClient(); |
| 38 | 41 |
| 39 // ExpectCertificates controls whether the server is expected to provide | 42 // ExpectCertificates controls whether the server is expected to provide |
| 40 // certificates. The certificates, if any, are not verified, but the common | 43 // certificates. The certificates, if any, are not verified, but the common |
| 41 // name is recorded and available with |cert_common_name()|. | 44 // name is recorded and available with |cert_common_name()|. |
| 42 void ExpectCertificates(bool on); | 45 void ExpectCertificates(bool on); |
| 43 | 46 |
| 44 // Clears any outstanding state and sends a simple GET of 'uri' to the | 47 // Clears any outstanding state and sends a simple GET of 'uri' to the |
| 45 // server. Returns 0 if the request failed and no bytes were written. | 48 // server. Returns 0 if the request failed and no bytes were written. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // client_. | 121 // client_. |
| 119 ProofVerifier* proof_verifier_; | 122 ProofVerifier* proof_verifier_; |
| 120 }; | 123 }; |
| 121 | 124 |
| 122 } // namespace test | 125 } // namespace test |
| 123 | 126 |
| 124 } // namespace tools | 127 } // namespace tools |
| 125 } // namespace net | 128 } // namespace net |
| 126 | 129 |
| 127 #endif // NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ | 130 #endif // NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ |
| OLD | NEW |