| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 string QuicTestClient::SendCustomSynchronousRequest( | 78 string QuicTestClient::SendCustomSynchronousRequest( |
| 79 const HTTPMessage& message) { | 79 const HTTPMessage& message) { |
| 80 SendMessage(message); | 80 SendMessage(message); |
| 81 WaitForResponse(); | 81 WaitForResponse(); |
| 82 return response_; | 82 return response_; |
| 83 } | 83 } |
| 84 | 84 |
| 85 string QuicTestClient::SendSynchronousRequest(const string& uri) { | 85 string QuicTestClient::SendSynchronousRequest(const string& uri) { |
| 86 if (SendRequest(uri) == 0) { | 86 if (SendRequest(uri) == 0) { |
| 87 DLOG(ERROR) << "Failed to the request for uri:" << uri; | 87 DLOG(ERROR) << "Failed to the request for uri:" << uri; |
| 88 return ""; | 88 return std::string(); |
| 89 } | 89 } |
| 90 WaitForResponse(); | 90 WaitForResponse(); |
| 91 return response_; | 91 return response_; |
| 92 } | 92 } |
| 93 | 93 |
| 94 QuicReliableClientStream* QuicTestClient::GetOrCreateStream() { | 94 QuicReliableClientStream* QuicTestClient::GetOrCreateStream() { |
| 95 if (never_connected_ == true) { | 95 if (never_connected_ == true) { |
| 96 if (!connected()) { | 96 if (!connected()) { |
| 97 Connect(); | 97 Connect(); |
| 98 } | 98 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 stream_error_ = stream_->stream_error(); | 174 stream_error_ = stream_->stream_error(); |
| 175 connection_error_ = stream_->connection_error(); | 175 connection_error_ = stream_->connection_error(); |
| 176 bytes_read_ = stream_->stream_bytes_read(); | 176 bytes_read_ = stream_->stream_bytes_read(); |
| 177 bytes_written_ = stream_->stream_bytes_written(); | 177 bytes_written_ = stream_->stream_bytes_written(); |
| 178 stream_ = NULL; | 178 stream_ = NULL; |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace test | 181 } // namespace test |
| 182 } // namespace tools | 182 } // namespace tools |
| 183 } // namespace net | 183 } // namespace net |
| OLD | NEW |