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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 .ToMilliseconds()); | 370 .ToMilliseconds()); |
371 expected_network_params.set_previous_connection_state( | 371 expected_network_params.set_previous_connection_state( |
372 CachedNetworkParameters::CONGESTION_AVOIDANCE); | 372 CachedNetworkParameters::CONGESTION_AVOIDANCE); |
373 expected_network_params.set_timestamp( | 373 expected_network_params.set_timestamp( |
374 session_->connection()->clock()->WallNow().ToUNIXSeconds()); | 374 session_->connection()->clock()->WallNow().ToUNIXSeconds()); |
375 expected_network_params.set_serving_region(serving_region); | 375 expected_network_params.set_serving_region(serving_region); |
376 | 376 |
377 EXPECT_CALL(*crypto_stream, | 377 EXPECT_CALL(*crypto_stream, |
378 SendServerConfigUpdate(EqualsProto(expected_network_params))) | 378 SendServerConfigUpdate(EqualsProto(expected_network_params))) |
379 .Times(1); | 379 .Times(1); |
| 380 EXPECT_CALL(*connection_, OnSendConnectionState(_)).Times(1); |
380 session_->OnCongestionWindowChange(now); | 381 session_->OnCongestionWindowChange(now); |
381 } | 382 } |
382 | 383 |
383 TEST_P(QuicServerSessionTest, BandwidthResumptionExperiment) { | 384 TEST_P(QuicServerSessionTest, BandwidthResumptionExperiment) { |
384 ValueRestore<bool> old_flag( | 385 ValueRestore<bool> old_flag( |
385 &FLAGS_quic_enable_bandwidth_resumption_experiment, true); | 386 &FLAGS_quic_enable_bandwidth_resumption_experiment, true); |
386 | 387 |
387 // Test that if a client provides a CachedNetworkParameters with the same | 388 // Test that if a client provides a CachedNetworkParameters with the same |
388 // serving region as the current server, that this data is passed down to the | 389 // serving region as the current server, that this data is passed down to the |
389 // send algorithm. | 390 // send algorithm. |
(...skipping 27 matching lines...) Expand all Loading... |
417 cached_network_params.set_serving_region(kTestServingRegion); | 418 cached_network_params.set_serving_region(kTestServingRegion); |
418 crypto_stream->set_previous_cached_network_params(cached_network_params); | 419 crypto_stream->set_previous_cached_network_params(cached_network_params); |
419 EXPECT_CALL(*connection_, ResumeConnectionState(_)).Times(1); | 420 EXPECT_CALL(*connection_, ResumeConnectionState(_)).Times(1); |
420 session_->OnConfigNegotiated(); | 421 session_->OnConfigNegotiated(); |
421 } | 422 } |
422 | 423 |
423 } // namespace | 424 } // namespace |
424 } // namespace test | 425 } // namespace test |
425 } // namespace tools | 426 } // namespace tools |
426 } // namespace net | 427 } // namespace net |
OLD | NEW |