| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 QuicClient* QuicTestClient::client() { return client_.get(); } | 284 QuicClient* QuicTestClient::client() { return client_.get(); } |
| 285 | 285 |
| 286 const string& QuicTestClient::cert_common_name() const { | 286 const string& QuicTestClient::cert_common_name() const { |
| 287 return reinterpret_cast<RecordingProofVerifier*>(proof_verifier_) | 287 return reinterpret_cast<RecordingProofVerifier*>(proof_verifier_) |
| 288 ->common_name(); | 288 ->common_name(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 QuicTagValueMap QuicTestClient::GetServerConfig() const { | 291 QuicTagValueMap QuicTestClient::GetServerConfig() const { |
| 292 net::QuicCryptoClientConfig* config = | 292 net::QuicCryptoClientConfig* config = |
| 293 QuicClientPeer::GetCryptoConfig(client_.get()); | 293 QuicClientPeer::GetCryptoConfig(client_.get()); |
| 294 // TODO(rtenneti): What is the server_port?? Default to the same port always? |
| 294 net::QuicCryptoClientConfig::CachedState* state = | 295 net::QuicCryptoClientConfig::CachedState* state = |
| 295 config->LookupOrCreate(client_->server_hostname()); | 296 config->LookupOrCreate(client_->server_hostname(), 0); |
| 296 const net::CryptoHandshakeMessage* handshake_msg = state->GetServerConfig(); | 297 const net::CryptoHandshakeMessage* handshake_msg = state->GetServerConfig(); |
| 297 if (handshake_msg != NULL) { | 298 if (handshake_msg != NULL) { |
| 298 return handshake_msg->tag_value_map(); | 299 return handshake_msg->tag_value_map(); |
| 299 } else { | 300 } else { |
| 300 return QuicTagValueMap(); | 301 return QuicTagValueMap(); |
| 301 } | 302 } |
| 302 } | 303 } |
| 303 | 304 |
| 304 bool QuicTestClient::connected() const { | 305 bool QuicTestClient::connected() const { |
| 305 return client_->connected(); | 306 return client_->connected(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 | 456 |
| 456 void QuicTestClient::WaitForWriteToFlush() { | 457 void QuicTestClient::WaitForWriteToFlush() { |
| 457 while (connected() && client()->session()->HasDataToWrite()) { | 458 while (connected() && client()->session()->HasDataToWrite()) { |
| 458 client_->WaitForEvents(); | 459 client_->WaitForEvents(); |
| 459 } | 460 } |
| 460 } | 461 } |
| 461 | 462 |
| 462 } // namespace test | 463 } // namespace test |
| 463 } // namespace tools | 464 } // namespace tools |
| 464 } // namespace net | 465 } // namespace net |
| OLD | NEW |