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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 // Opening a further stream will result in connection close. | 259 // Opening a further stream will result in connection close. |
260 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS)); | 260 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS)); |
261 EXPECT_FALSE(QuicServerSessionPeer::GetIncomingDataStream( | 261 EXPECT_FALSE(QuicServerSessionPeer::GetIncomingDataStream( |
262 session_.get(), kMaxValidStreamId + 2)); | 262 session_.get(), kMaxValidStreamId + 2)); |
263 } | 263 } |
264 | 264 |
265 TEST_P(QuicServerSessionTest, GetEvenIncomingError) { | 265 TEST_P(QuicServerSessionTest, GetEvenIncomingError) { |
266 // Incoming streams on the server session must be odd. | 266 // Incoming streams on the server session must be odd. |
267 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); | 267 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); |
268 EXPECT_EQ(NULL, | 268 EXPECT_EQ(nullptr, |
269 QuicServerSessionPeer::GetIncomingDataStream(session_.get(), 4)); | 269 QuicServerSessionPeer::GetIncomingDataStream(session_.get(), 4)); |
270 } | 270 } |
271 | 271 |
272 TEST_P(QuicServerSessionTest, SetFecProtectionFromConfig) { | 272 TEST_P(QuicServerSessionTest, SetFecProtectionFromConfig) { |
273 ValueRestore<bool> old_flag(&FLAGS_enable_quic_fec, true); | 273 ValueRestore<bool> old_flag(&FLAGS_enable_quic_fec, true); |
274 | 274 |
275 // Set received config to have FEC connection option. | 275 // Set received config to have FEC connection option. |
276 QuicTagVector copt; | 276 QuicTagVector copt; |
277 copt.push_back(kFHDR); | 277 copt.push_back(kFHDR); |
278 QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt); | 278 QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 EXPECT_CALL(*crypto_stream, | 367 EXPECT_CALL(*crypto_stream, |
368 SendServerConfigUpdate(EqualsProto(expected_network_params))) | 368 SendServerConfigUpdate(EqualsProto(expected_network_params))) |
369 .Times(1); | 369 .Times(1); |
370 session_->OnCongestionWindowChange(now); | 370 session_->OnCongestionWindowChange(now); |
371 } | 371 } |
372 | 372 |
373 } // namespace | 373 } // namespace |
374 } // namespace test | 374 } // namespace test |
375 } // namespace tools | 375 } // namespace tools |
376 } // namespace net | 376 } // namespace net |
OLD | NEW |