OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quic_server_session.h" | 5 #include "net/tools/quic/quic_server_session.h" |
6 | 6 |
7 #include "net/quic/crypto/quic_crypto_server_config.h" | 7 #include "net/quic/crypto/quic_crypto_server_config.h" |
8 #include "net/quic/crypto/quic_random.h" | 8 #include "net/quic/crypto/quic_random.h" |
9 #include "net/quic/proto/cached_network_parameters.pb.h" | 9 #include "net/quic/proto/cached_network_parameters.pb.h" |
10 #include "net/quic/quic_connection.h" | 10 #include "net/quic/quic_connection.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 RttStats* rtt_stats = | 341 RttStats* rtt_stats = |
342 QuicSentPacketManagerPeer::GetRttStats(sent_packet_manager); | 342 QuicSentPacketManagerPeer::GetRttStats(sent_packet_manager); |
343 rtt_stats->UpdateRtt(QuicTime::Delta::FromMicroseconds( | 343 rtt_stats->UpdateRtt(QuicTime::Delta::FromMicroseconds( |
344 rtt_stats->initial_rtt_us()), QuicTime::Delta::Zero(), QuicTime::Zero()); | 344 rtt_stats->initial_rtt_us()), QuicTime::Delta::Zero(), QuicTime::Zero()); |
345 QuicSustainedBandwidthRecorderPeer::SetBandwidthEstimate( | 345 QuicSustainedBandwidthRecorderPeer::SetBandwidthEstimate( |
346 &bandwidth_recorder, bandwidth_estimate_kbytes_per_second); | 346 &bandwidth_recorder, bandwidth_estimate_kbytes_per_second); |
347 QuicSustainedBandwidthRecorderPeer::SetMaxBandwidthEstimate( | 347 QuicSustainedBandwidthRecorderPeer::SetMaxBandwidthEstimate( |
348 &bandwidth_recorder, max_bandwidth_estimate_kbytes_per_second, | 348 &bandwidth_recorder, max_bandwidth_estimate_kbytes_per_second, |
349 max_bandwidth_estimate_timestamp); | 349 max_bandwidth_estimate_timestamp); |
350 // Queue up some pending data. | 350 // Queue up some pending data. |
351 session_->MarkWriteBlocked(kCryptoStreamId, | 351 session_->MarkConnectionLevelWriteBlocked( |
352 QuicWriteBlockedList::kHighestPriority); | 352 kCryptoStreamId, QuicWriteBlockedList::kHighestPriority); |
353 EXPECT_TRUE(session_->HasDataToWrite()); | 353 EXPECT_TRUE(session_->HasDataToWrite()); |
354 | 354 |
355 // There will be no update sent yet - not enough time has passed. | 355 // There will be no update sent yet - not enough time has passed. |
356 QuicTime now = QuicTime::Zero(); | 356 QuicTime now = QuicTime::Zero(); |
357 session_->OnCongestionWindowChange(now); | 357 session_->OnCongestionWindowChange(now); |
358 | 358 |
359 // Bandwidth estimate has now changed sufficiently but not enough time has | 359 // Bandwidth estimate has now changed sufficiently but not enough time has |
360 // passed to send a Server Config Update. | 360 // passed to send a Server Config Update. |
361 bandwidth_estimate_kbytes_per_second = | 361 bandwidth_estimate_kbytes_per_second = |
362 bandwidth_estimate_kbytes_per_second * 1.6; | 362 bandwidth_estimate_kbytes_per_second * 1.6; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); | 461 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); |
462 session_->OnConfigNegotiated(); | 462 session_->OnConfigNegotiated(); |
463 EXPECT_FALSE( | 463 EXPECT_FALSE( |
464 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); | 464 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); |
465 } | 465 } |
466 | 466 |
467 } // namespace | 467 } // namespace |
468 } // namespace test | 468 } // namespace test |
469 } // namespace tools | 469 } // namespace tools |
470 } // namespace net | 470 } // namespace net |
OLD | NEW |