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 "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/cert/cert_verify_result.h" | 10 #include "net/cert/cert_verify_result.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 ssize_t QuicTestClient::SendData(string data, bool last_data) { | 267 ssize_t QuicTestClient::SendData(string data, bool last_data) { |
268 QuicSpdyClientStream* stream = GetOrCreateStream(); | 268 QuicSpdyClientStream* stream = GetOrCreateStream(); |
269 if (!stream) { return 0; } | 269 if (!stream) { return 0; } |
270 GetOrCreateStream()->SendBody(data, last_data); | 270 GetOrCreateStream()->SendBody(data, last_data); |
271 WaitForWriteToFlush(); | 271 WaitForWriteToFlush(); |
272 return data.length(); | 272 return data.length(); |
273 } | 273 } |
274 | 274 |
275 QuicPacketCreator::Options* QuicTestClient::options() { | |
276 return client_->options(); | |
277 } | |
278 | |
279 bool QuicTestClient::response_complete() const { | 275 bool QuicTestClient::response_complete() const { |
280 return response_complete_; | 276 return response_complete_; |
281 } | 277 } |
282 | 278 |
283 int QuicTestClient::response_header_size() const { | 279 int QuicTestClient::response_header_size() const { |
284 return response_header_size_; | 280 return response_header_size_; |
285 } | 281 } |
286 | 282 |
287 int64 QuicTestClient::response_body_size() const { | 283 int64 QuicTestClient::response_body_size() const { |
288 return response_body_size_; | 284 return response_body_size_; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 540 |
545 void QuicTestClient::WaitForWriteToFlush() { | 541 void QuicTestClient::WaitForWriteToFlush() { |
546 while (connected() && client()->session()->HasDataToWrite()) { | 542 while (connected() && client()->session()->HasDataToWrite()) { |
547 client_->WaitForEvents(); | 543 client_->WaitForEvents(); |
548 } | 544 } |
549 } | 545 } |
550 | 546 |
551 } // namespace test | 547 } // namespace test |
552 } // namespace tools | 548 } // namespace tools |
553 } // namespace net | 549 } // namespace net |
OLD | NEW |