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/cached_network_parameters.h" | 7 #include "net/quic/crypto/cached_network_parameters.h" |
8 #include "net/quic/crypto/quic_crypto_server_config.h" | 8 #include "net/quic/crypto/quic_crypto_server_config.h" |
9 #include "net/quic/crypto/quic_random.h" | 9 #include "net/quic/crypto/quic_random.h" |
10 #include "net/quic/quic_connection.h" | 10 #include "net/quic/quic_connection.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 ~MockQuicCryptoServerStream() override {} | 292 ~MockQuicCryptoServerStream() override {} |
293 | 293 |
294 MOCK_METHOD1(SendServerConfigUpdate, | 294 MOCK_METHOD1(SendServerConfigUpdate, |
295 void(const CachedNetworkParameters* cached_network_parameters)); | 295 void(const CachedNetworkParameters* cached_network_parameters)); |
296 | 296 |
297 private: | 297 private: |
298 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream); | 298 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream); |
299 }; | 299 }; |
300 | 300 |
301 TEST_P(QuicServerSessionTest, BandwidthEstimates) { | 301 TEST_P(QuicServerSessionTest, BandwidthEstimates) { |
302 if (version() <= QUIC_VERSION_21) { | |
303 return; | |
304 } | |
305 | |
306 // Test that bandwidth estimate updates are sent to the client, only after the | 302 // Test that bandwidth estimate updates are sent to the client, only after the |
307 // bandwidth estimate has changes sufficiently, and enough time has passed, | 303 // bandwidth estimate has changes sufficiently, and enough time has passed, |
308 // and we don't have any other data to write. | 304 // and we don't have any other data to write. |
309 | 305 |
310 int32 bandwidth_estimate_kbytes_per_second = 123; | 306 int32 bandwidth_estimate_kbytes_per_second = 123; |
311 int32 max_bandwidth_estimate_kbytes_per_second = 134; | 307 int32 max_bandwidth_estimate_kbytes_per_second = 134; |
312 int32 max_bandwidth_estimate_timestamp = 1122334455; | 308 int32 max_bandwidth_estimate_timestamp = 1122334455; |
313 const string serving_region = "not a real region"; | 309 const string serving_region = "not a real region"; |
314 session_->set_serving_region(serving_region); | 310 session_->set_serving_region(serving_region); |
315 | 311 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 cached_network_params.set_serving_region(kTestServingRegion); | 423 cached_network_params.set_serving_region(kTestServingRegion); |
428 crypto_stream->set_previous_cached_network_params(cached_network_params); | 424 crypto_stream->set_previous_cached_network_params(cached_network_params); |
429 EXPECT_CALL(*connection_, ResumeConnectionState(_)).Times(1); | 425 EXPECT_CALL(*connection_, ResumeConnectionState(_)).Times(1); |
430 session_->OnConfigNegotiated(); | 426 session_->OnConfigNegotiated(); |
431 } | 427 } |
432 | 428 |
433 } // namespace | 429 } // namespace |
434 } // namespace test | 430 } // namespace test |
435 } // namespace tools | 431 } // namespace tools |
436 } // namespace net | 432 } // namespace net |
OLD | NEW |