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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 void QuicTestClient::Initialize(bool secure) { | 214 void QuicTestClient::Initialize(bool secure) { |
215 priority_ = 3; | 215 priority_ = 3; |
216 connect_attempted_ = false; | 216 connect_attempted_ = false; |
217 secure_ = secure; | 217 secure_ = secure; |
218 auto_reconnect_ = false; | 218 auto_reconnect_ = false; |
219 buffer_body_ = true; | 219 buffer_body_ = true; |
220 fec_policy_ = FEC_PROTECT_OPTIONAL; | 220 fec_policy_ = FEC_PROTECT_OPTIONAL; |
221 proof_verifier_ = nullptr; | 221 proof_verifier_ = nullptr; |
222 ClearPerRequestState(); | 222 ClearPerRequestState(); |
223 ExpectCertificates(secure_); | 223 ExpectCertificates(secure_); |
| 224 // As chrome will generally do this, we want it to be the default when it's |
| 225 // not overridden. |
| 226 if (!client_->config()->HasSetBytesForConnectionIdToSend()) { |
| 227 client_->config()->SetBytesForConnectionIdToSend(0); |
| 228 } |
224 } | 229 } |
225 | 230 |
226 void QuicTestClient::ExpectCertificates(bool on) { | 231 void QuicTestClient::ExpectCertificates(bool on) { |
227 if (on) { | 232 if (on) { |
228 proof_verifier_ = new RecordingProofVerifier; | 233 proof_verifier_ = new RecordingProofVerifier; |
229 client_->SetProofVerifier(proof_verifier_); | 234 client_->SetProofVerifier(proof_verifier_); |
230 } else { | 235 } else { |
231 proof_verifier_ = nullptr; | 236 proof_verifier_ = nullptr; |
232 client_->SetProofVerifier(nullptr); | 237 client_->SetProofVerifier(nullptr); |
233 } | 238 } |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 // Set policy for headers and crypto streams. | 564 // Set policy for headers and crypto streams. |
560 ReliableQuicStreamPeer::SetFecPolicy( | 565 ReliableQuicStreamPeer::SetFecPolicy( |
561 QuicSessionPeer::GetHeadersStream(client()->session()), fec_policy); | 566 QuicSessionPeer::GetHeadersStream(client()->session()), fec_policy); |
562 ReliableQuicStreamPeer::SetFecPolicy(client()->session()->GetCryptoStream(), | 567 ReliableQuicStreamPeer::SetFecPolicy(client()->session()->GetCryptoStream(), |
563 fec_policy); | 568 fec_policy); |
564 } | 569 } |
565 | 570 |
566 } // namespace test | 571 } // namespace test |
567 } // namespace tools | 572 } // namespace tools |
568 } // namespace net | 573 } // namespace net |
OLD | NEW |