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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 } | 403 } |
404 | 404 |
405 MockableQuicClient* QuicTestClient::client() { return client_.get(); } | 405 MockableQuicClient* QuicTestClient::client() { return client_.get(); } |
406 | 406 |
407 const string& QuicTestClient::cert_common_name() const { | 407 const string& QuicTestClient::cert_common_name() const { |
408 return reinterpret_cast<RecordingProofVerifier*>(proof_verifier_) | 408 return reinterpret_cast<RecordingProofVerifier*>(proof_verifier_) |
409 ->common_name(); | 409 ->common_name(); |
410 } | 410 } |
411 | 411 |
412 QuicTagValueMap QuicTestClient::GetServerConfig() const { | 412 QuicTagValueMap QuicTestClient::GetServerConfig() const { |
413 QuicCryptoClientConfig* config = | 413 QuicCryptoClientConfig* config = client_->crypto_config(); |
414 QuicClientPeer::GetCryptoConfig(client_.get()); | |
415 QuicCryptoClientConfig::CachedState* state = | 414 QuicCryptoClientConfig::CachedState* state = |
416 config->LookupOrCreate(client_->server_id()); | 415 config->LookupOrCreate(client_->server_id()); |
417 const CryptoHandshakeMessage* handshake_msg = state->GetServerConfig(); | 416 const CryptoHandshakeMessage* handshake_msg = state->GetServerConfig(); |
418 if (handshake_msg != nullptr) { | 417 if (handshake_msg != nullptr) { |
419 return handshake_msg->tag_value_map(); | 418 return handshake_msg->tag_value_map(); |
420 } else { | 419 } else { |
421 return QuicTagValueMap(); | 420 return QuicTagValueMap(); |
422 } | 421 } |
423 } | 422 } |
424 | 423 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 message->headers()->SetRequestVersion( | 635 message->headers()->SetRequestVersion( |
637 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); | 636 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); |
638 message->headers()->SetRequestMethod( | 637 message->headers()->SetRequestMethod( |
639 HTTPMessage::MethodToString(HttpConstants::GET)); | 638 HTTPMessage::MethodToString(HttpConstants::GET)); |
640 message->headers()->SetRequestUri(uri); | 639 message->headers()->SetRequestUri(uri); |
641 } | 640 } |
642 | 641 |
643 } // namespace test | 642 } // namespace test |
644 } // namespace tools | 643 } // namespace tools |
645 } // namespace net | 644 } // namespace net |
OLD | NEW |