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 namespace tools { | 17 namespace tools { |
18 | 18 |
19 namespace test { | 19 namespace test { |
20 | 20 |
21 class HTTPMessage; | 21 class HTTPMessage; |
22 | 22 |
23 // A toy QUIC client used for testing. | 23 // A toy QUIC client used for testing. |
24 class QuicTestClient : public ReliableQuicStream::Visitor { | 24 class QuicTestClient : public ReliableQuicStream::Visitor { |
25 public: | 25 public: |
26 QuicTestClient(IPEndPoint server_address, const string& server_hostname); | 26 QuicTestClient(IPEndPoint server_address, const string& server_hostname); |
| 27 QuicTestClient(IPEndPoint server_address, |
| 28 const string& server_hostname, |
| 29 const QuicConfig& config); |
| 30 |
27 virtual ~QuicTestClient(); | 31 virtual ~QuicTestClient(); |
28 | 32 |
29 // Clears any outstanding state and sends a simple GET of 'uri' to the | 33 // Clears any outstanding state and sends a simple GET of 'uri' to the |
30 // server. Returns 0 if the request failed and no bytes were written. | 34 // server. Returns 0 if the request failed and no bytes were written. |
31 ssize_t SendRequest(const string& uri); | 35 ssize_t SendRequest(const string& uri); |
32 ssize_t SendMessage(const HTTPMessage& message); | 36 ssize_t SendMessage(const HTTPMessage& message); |
33 | 37 |
34 string SendCustomSynchronousRequest(const HTTPMessage& message); | 38 string SendCustomSynchronousRequest(const HTTPMessage& message); |
35 string SendSynchronousRequest(const string& uri); | 39 string SendSynchronousRequest(const string& uri); |
36 | 40 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // connection reset, it will not automatically reconnect. | 92 // connection reset, it will not automatically reconnect. |
89 bool never_connected_; | 93 bool never_connected_; |
90 }; | 94 }; |
91 | 95 |
92 } // namespace test | 96 } // namespace test |
93 | 97 |
94 } // namespace tools | 98 } // namespace tools |
95 } // namespace net | 99 } // namespace net |
96 | 100 |
97 #endif // NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ | 101 #endif // NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ |
OLD | NEW |