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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/strings/string_util.h" | |
13 #include "base/time/time.h" | 12 #include "base/time/time.h" |
14 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
15 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
16 #include "net/cert/cert_verify_result.h" | 15 #include "net/cert/cert_verify_result.h" |
17 #include "net/cert/x509_certificate.h" | 16 #include "net/cert/x509_certificate.h" |
18 #include "net/quic/core/crypto/proof_verifier.h" | 17 #include "net/quic/core/crypto/proof_verifier.h" |
19 #include "net/quic/core/quic_flags.h" | 18 #include "net/quic/core/quic_flags.h" |
20 #include "net/quic/core/quic_server_id.h" | 19 #include "net/quic/core/quic_server_id.h" |
21 #include "net/quic/core/quic_utils.h" | 20 #include "net/quic/core/quic_utils.h" |
22 #include "net/quic/core/spdy_utils.h" | 21 #include "net/quic/core/spdy_utils.h" |
| 22 #include "net/quic/platform/api/quic_text_utils.h" |
23 #include "net/quic/test_tools/crypto_test_utils.h" | 23 #include "net/quic/test_tools/crypto_test_utils.h" |
24 #include "net/quic/test_tools/quic_connection_peer.h" | 24 #include "net/quic/test_tools/quic_connection_peer.h" |
25 #include "net/quic/test_tools/quic_spdy_session_peer.h" | 25 #include "net/quic/test_tools/quic_spdy_session_peer.h" |
26 #include "net/quic/test_tools/quic_stream_peer.h" | 26 #include "net/quic/test_tools/quic_stream_peer.h" |
27 #include "net/quic/test_tools/quic_test_utils.h" | 27 #include "net/quic/test_tools/quic_test_utils.h" |
28 #include "net/tools/quic/quic_epoll_connection_helper.h" | 28 #include "net/tools/quic/quic_epoll_connection_helper.h" |
29 #include "net/tools/quic/quic_packet_writer_wrapper.h" | 29 #include "net/tools/quic/quic_packet_writer_wrapper.h" |
30 #include "net/tools/quic/quic_spdy_client_stream.h" | 30 #include "net/tools/quic/quic_spdy_client_stream.h" |
31 #include "net/tools/quic/test_tools/quic_client_peer.h" | 31 #include "net/tools/quic/test_tools/quic_client_peer.h" |
32 #include "url/gurl.h" | 32 #include "url/gurl.h" |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 694 |
695 void QuicTestClient::TestClientDataToResend::Resend() { | 695 void QuicTestClient::TestClientDataToResend::Resend() { |
696 test_client_->GetOrCreateStreamAndSendRequest(headers_.get(), body_, fin_, | 696 test_client_->GetOrCreateStreamAndSendRequest(headers_.get(), body_, fin_, |
697 ack_listener_); | 697 ack_listener_); |
698 headers_.reset(); | 698 headers_.reset(); |
699 } | 699 } |
700 | 700 |
701 bool QuicTestClient::PopulateHeaderBlockFromUrl(const string& uri, | 701 bool QuicTestClient::PopulateHeaderBlockFromUrl(const string& uri, |
702 SpdyHeaderBlock* headers) { | 702 SpdyHeaderBlock* headers) { |
703 string url; | 703 string url; |
704 if (base::StartsWith(uri, "https://", base::CompareCase::INSENSITIVE_ASCII) || | 704 if (QuicTextUtils::StartsWith(uri, "https://") || |
705 base::StartsWith(uri, "http://", base::CompareCase::INSENSITIVE_ASCII)) { | 705 QuicTextUtils::StartsWith(uri, "http://")) { |
706 url = uri; | 706 url = uri; |
707 } else if (uri[0] == '/') { | 707 } else if (uri[0] == '/') { |
708 url = "https://" + client_->server_id().host() + uri; | 708 url = "https://" + client_->server_id().host() + uri; |
709 } else { | 709 } else { |
710 url = "https://" + uri; | 710 url = "https://" + uri; |
711 } | 711 } |
712 return SpdyUtils::PopulateHeaderBlockFromUrl(url, headers); | 712 return SpdyUtils::PopulateHeaderBlockFromUrl(url, headers); |
713 } | 713 } |
714 | 714 |
715 } // namespace test | 715 } // namespace test |
716 } // namespace net | 716 } // namespace net |
OLD | NEW |