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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 EXPECT_CALL(*connection_, OnSendConnectionState(_)).Times(1); |
381 session_->OnCongestionWindowChange(now); | 381 session_->OnCongestionWindowChange(now); |
382 } | 382 } |
383 | 383 |
384 TEST_P(QuicServerSessionTest, BandwidthResumptionExperiment) { | 384 TEST_P(QuicServerSessionTest, BandwidthResumptionExperiment) { |
385 ValueRestore<bool> old_flag( | |
386 &FLAGS_quic_enable_bandwidth_resumption_experiment, true); | |
387 | |
388 // Test that if a client provides a CachedNetworkParameters with the same | 385 // Test that if a client provides a CachedNetworkParameters with the same |
389 // serving region as the current server, that this data is passed down to the | 386 // serving region as the current server, that this data is passed down to the |
390 // send algorithm. | 387 // send algorithm. |
391 | 388 |
392 // Client has sent kBWRE connection option to trigger bandwidth resumption. | 389 // Client has sent kBWRE connection option to trigger bandwidth resumption. |
393 QuicTagVector copt; | 390 QuicTagVector copt; |
394 copt.push_back(kBWRE); | 391 copt.push_back(kBWRE); |
395 QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt); | 392 QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt); |
396 | 393 |
397 const string kTestServingRegion = "a serving region"; | 394 const string kTestServingRegion = "a serving region"; |
(...skipping 20 matching lines...) Expand all Loading... |
418 cached_network_params.set_serving_region(kTestServingRegion); | 415 cached_network_params.set_serving_region(kTestServingRegion); |
419 crypto_stream->set_previous_cached_network_params(cached_network_params); | 416 crypto_stream->set_previous_cached_network_params(cached_network_params); |
420 EXPECT_CALL(*connection_, ResumeConnectionState(_)).Times(1); | 417 EXPECT_CALL(*connection_, ResumeConnectionState(_)).Times(1); |
421 session_->OnConfigNegotiated(); | 418 session_->OnConfigNegotiated(); |
422 } | 419 } |
423 | 420 |
424 } // namespace | 421 } // namespace |
425 } // namespace test | 422 } // namespace test |
426 } // namespace tools | 423 } // namespace tools |
427 } // namespace net | 424 } // namespace net |
OLD | NEW |