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/base/completion_callback.h" | 7 #include "net/base/completion_callback.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
9 #include "net/cert/cert_verify_result.h" | 9 #include "net/cert/cert_verify_result.h" |
10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 !uri.starts_with("http://")) { | 78 !uri.starts_with("http://")) { |
79 // If we have a relative URL, set some defaults. | 79 // If we have a relative URL, set some defaults. |
80 string full_uri = secure ? "https://www.google.com" : | 80 string full_uri = secure ? "https://www.google.com" : |
81 "http://www.google.com"; | 81 "http://www.google.com"; |
82 full_uri.append(uri.as_string()); | 82 full_uri.append(uri.as_string()); |
83 headers->SetRequestUri(full_uri); | 83 headers->SetRequestUri(full_uri); |
84 } | 84 } |
85 return headers; | 85 return headers; |
86 } | 86 } |
87 | 87 |
88 QuicTestClient::QuicTestClient(IPEndPoint address, const string& hostname) | 88 QuicTestClient::QuicTestClient(IPEndPoint address, const string& hostname, |
89 : client_(address, hostname) { | 89 const QuicVersion version) |
| 90 : client_(address, hostname, version) { |
90 Initialize(address, hostname); | 91 Initialize(address, hostname); |
91 } | 92 } |
92 | 93 |
93 QuicTestClient::QuicTestClient(IPEndPoint address, | 94 QuicTestClient::QuicTestClient(IPEndPoint address, |
94 const string& hostname, | 95 const string& hostname, |
95 bool secure) | 96 bool secure, |
96 : client_(address, hostname) { | 97 const QuicVersion version) |
| 98 : client_(address, hostname, version) { |
97 Initialize(address, hostname); | 99 Initialize(address, hostname); |
98 secure_ = secure; | 100 secure_ = secure; |
99 // TODO(alyssar, agl) uncomment here and below when default certs are allowed. | 101 // TODO(alyssar, agl) uncomment here and below when default certs are allowed. |
100 // ExpectCertificates(secure_); | 102 // ExpectCertificates(secure_); |
101 } | 103 } |
102 | 104 |
103 QuicTestClient::QuicTestClient(IPEndPoint address, | 105 QuicTestClient::QuicTestClient(IPEndPoint address, |
104 const string& hostname, | 106 const string& hostname, |
105 const QuicConfig& config) | 107 const QuicConfig& config, |
106 : client_(address, hostname, config) { | 108 const QuicVersion version) |
| 109 : client_(address, hostname, config, version) { |
107 Initialize(address, hostname); | 110 Initialize(address, hostname); |
108 } | 111 } |
109 | 112 |
110 void QuicTestClient::Initialize(IPEndPoint address, const string& hostname) { | 113 void QuicTestClient::Initialize(IPEndPoint address, const string& hostname) { |
111 server_address_ = address; | 114 server_address_ = address; |
112 stream_ = NULL; | 115 stream_ = NULL; |
113 stream_error_ = QUIC_STREAM_NO_ERROR; | 116 stream_error_ = QUIC_STREAM_NO_ERROR; |
114 connection_error_ = QUIC_NO_ERROR; | 117 connection_error_ = QUIC_NO_ERROR; |
115 bytes_read_ = 0; | 118 bytes_read_ = 0; |
116 bytes_written_= 0; | 119 bytes_written_= 0; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 stream_error_ = stream_->stream_error(); | 287 stream_error_ = stream_->stream_error(); |
285 connection_error_ = stream_->connection_error(); | 288 connection_error_ = stream_->connection_error(); |
286 bytes_read_ = stream_->stream_bytes_read(); | 289 bytes_read_ = stream_->stream_bytes_read(); |
287 bytes_written_ = stream_->stream_bytes_written(); | 290 bytes_written_ = stream_->stream_bytes_written(); |
288 stream_ = NULL; | 291 stream_ = NULL; |
289 } | 292 } |
290 | 293 |
291 } // namespace test | 294 } // namespace test |
292 } // namespace tools | 295 } // namespace tools |
293 } // namespace net | 296 } // namespace net |
OLD | NEW |