| 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/crypto/source_address_token.h" | 9 #include "net/quic/crypto/source_address_token.h" |
| 10 #include "net/quic/quic_connection.h" | 10 #include "net/quic/quic_connection.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy()); | 287 EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy()); |
| 288 } | 288 } |
| 289 | 289 |
| 290 class MockQuicCryptoServerStream : public QuicCryptoServerStream { | 290 class MockQuicCryptoServerStream : public QuicCryptoServerStream { |
| 291 public: | 291 public: |
| 292 explicit MockQuicCryptoServerStream( | 292 explicit MockQuicCryptoServerStream( |
| 293 const QuicCryptoServerConfig& crypto_config, QuicSession* session) | 293 const QuicCryptoServerConfig& crypto_config, QuicSession* session) |
| 294 : QuicCryptoServerStream(crypto_config, session) {} | 294 : QuicCryptoServerStream(crypto_config, session) {} |
| 295 virtual ~MockQuicCryptoServerStream() {} | 295 virtual ~MockQuicCryptoServerStream() {} |
| 296 | 296 |
| 297 MOCK_METHOD2(SendServerConfigUpdate, | 297 MOCK_METHOD1(SendServerConfigUpdate, |
| 298 void(const CachedNetworkParameters* cached_network_parameters, | 298 void(const CachedNetworkParameters* cached_network_parameters)); |
| 299 bool on_handshake_complete)); | |
| 300 | 299 |
| 301 private: | 300 private: |
| 302 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream); | 301 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream); |
| 303 }; | 302 }; |
| 304 | 303 |
| 305 TEST_P(QuicServerSessionTest, BandwidthEstimates) { | 304 TEST_P(QuicServerSessionTest, BandwidthEstimates) { |
| 306 if (version() <= QUIC_VERSION_21) { | 305 if (version() <= QUIC_VERSION_21) { |
| 307 return; | 306 return; |
| 308 } | 307 } |
| 309 // Test that bandwidth estimate updates are sent to the client, only after the | 308 // Test that bandwidth estimate updates are sent to the client, only after the |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 .GetRttStats() | 358 .GetRttStats() |
| 360 ->MinRtt() | 359 ->MinRtt() |
| 361 .ToMilliseconds()); | 360 .ToMilliseconds()); |
| 362 expected_network_params.set_previous_connection_state( | 361 expected_network_params.set_previous_connection_state( |
| 363 CachedNetworkParameters::CONGESTION_AVOIDANCE); | 362 CachedNetworkParameters::CONGESTION_AVOIDANCE); |
| 364 expected_network_params.set_timestamp( | 363 expected_network_params.set_timestamp( |
| 365 session_->connection()->clock()->WallNow().ToUNIXSeconds()); | 364 session_->connection()->clock()->WallNow().ToUNIXSeconds()); |
| 366 expected_network_params.set_serving_region(serving_region); | 365 expected_network_params.set_serving_region(serving_region); |
| 367 | 366 |
| 368 EXPECT_CALL(*crypto_stream, | 367 EXPECT_CALL(*crypto_stream, |
| 369 SendServerConfigUpdate(EqualsProto(expected_network_params), _)) | 368 SendServerConfigUpdate(EqualsProto(expected_network_params))) |
| 370 .Times(1); | 369 .Times(1); |
| 371 session_->OnCongestionWindowChange(now); | 370 session_->OnCongestionWindowChange(now); |
| 372 } | 371 } |
| 373 | 372 |
| 374 } // namespace | 373 } // namespace |
| 375 } // namespace test | 374 } // namespace test |
| 376 } // namespace tools | 375 } // namespace tools |
| 377 } // namespace net | 376 } // namespace net |
| OLD | NEW |