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 #include "net/tools/quic/test_tools/quic_test_client.h" | 5 #include "net/tools/quic/test_tools/quic_test_client.h" |
6 | 6 |
7 #include "net/tools/flip_server/balsa_headers.h" | 7 #include "net/tools/flip_server/balsa_headers.h" |
8 #include "net/tools/quic/test_tools/http_message_test_utils.h" | 8 #include "net/tools/quic/test_tools/http_message_test_utils.h" |
9 | 9 |
10 using std::string; | 10 using std::string; |
(...skipping 27 matching lines...) Expand all Loading... |
38 : server_address_(address), | 38 : server_address_(address), |
39 client_(address, hostname), | 39 client_(address, hostname), |
40 stream_(NULL), | 40 stream_(NULL), |
41 stream_error_(QUIC_STREAM_NO_ERROR), | 41 stream_error_(QUIC_STREAM_NO_ERROR), |
42 connection_error_(QUIC_NO_ERROR), | 42 connection_error_(QUIC_NO_ERROR), |
43 bytes_read_(0), | 43 bytes_read_(0), |
44 bytes_written_(0), | 44 bytes_written_(0), |
45 never_connected_(true) { | 45 never_connected_(true) { |
46 } | 46 } |
47 | 47 |
| 48 QuicTestClient::QuicTestClient(IPEndPoint address, |
| 49 const string& hostname, |
| 50 const QuicConfig& config) |
| 51 : server_address_(address), |
| 52 client_(address, hostname, config), |
| 53 stream_(NULL), |
| 54 stream_error_(QUIC_STREAM_NO_ERROR), |
| 55 connection_error_(QUIC_NO_ERROR), |
| 56 bytes_read_(0), |
| 57 bytes_written_(0), |
| 58 never_connected_(true) { |
| 59 } |
| 60 |
48 QuicTestClient::~QuicTestClient() { | 61 QuicTestClient::~QuicTestClient() { |
49 if (stream_) { | 62 if (stream_) { |
50 stream_->set_visitor(NULL); | 63 stream_->set_visitor(NULL); |
51 } | 64 } |
52 } | 65 } |
53 | 66 |
54 ssize_t QuicTestClient::SendRequest(const string& uri) { | 67 ssize_t QuicTestClient::SendRequest(const string& uri) { |
55 HTTPMessage message(HttpConstants::HTTP_1_1, HttpConstants::GET, uri); | 68 HTTPMessage message(HttpConstants::HTTP_1_1, HttpConstants::GET, uri); |
56 return SendMessage(message); | 69 return SendMessage(message); |
57 } | 70 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 stream_error_ = stream_->stream_error(); | 187 stream_error_ = stream_->stream_error(); |
175 connection_error_ = stream_->connection_error(); | 188 connection_error_ = stream_->connection_error(); |
176 bytes_read_ = stream_->stream_bytes_read(); | 189 bytes_read_ = stream_->stream_bytes_read(); |
177 bytes_written_ = stream_->stream_bytes_written(); | 190 bytes_written_ = stream_->stream_bytes_written(); |
178 stream_ = NULL; | 191 stream_ = NULL; |
179 } | 192 } |
180 | 193 |
181 } // namespace test | 194 } // namespace test |
182 } // namespace tools | 195 } // namespace tools |
183 } // namespace net | 196 } // namespace net |
OLD | NEW |