| 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_simple_server_session.h" | 5 #include "net/tools/quic/quic_simple_server_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> |
| 8 | 9 |
| 9 #include "base/macros.h" | 10 #include "base/macros.h" |
| 10 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 11 #include "net/quic/crypto/quic_crypto_server_config.h" | 12 #include "net/quic/crypto/quic_crypto_server_config.h" |
| 12 #include "net/quic/crypto/quic_random.h" | 13 #include "net/quic/crypto/quic_random.h" |
| 13 #include "net/quic/proto/cached_network_parameters.pb.h" | 14 #include "net/quic/proto/cached_network_parameters.pb.h" |
| 14 #include "net/quic/quic_connection.h" | 15 #include "net/quic/quic_connection.h" |
| 15 #include "net/quic/quic_crypto_server_stream.h" | 16 #include "net/quic/quic_crypto_server_stream.h" |
| 16 #include "net/quic/quic_utils.h" | 17 #include "net/quic/quic_utils.h" |
| 17 #include "net/quic/test_tools/crypto_test_utils.h" | 18 #include "net/quic/test_tools/crypto_test_utils.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 FLAGS_quic_cede_correctly = false; | 187 FLAGS_quic_cede_correctly = false; |
| 187 } | 188 } |
| 188 | 189 |
| 189 StrictMock<MockQuicServerSessionVisitor> owner_; | 190 StrictMock<MockQuicServerSessionVisitor> owner_; |
| 190 MockConnectionHelper helper_; | 191 MockConnectionHelper helper_; |
| 191 MockAlarmFactory alarm_factory_; | 192 MockAlarmFactory alarm_factory_; |
| 192 StrictMock<MockConnectionWithSendStreamData>* connection_; | 193 StrictMock<MockConnectionWithSendStreamData>* connection_; |
| 193 QuicConfig config_; | 194 QuicConfig config_; |
| 194 QuicCryptoServerConfig crypto_config_; | 195 QuicCryptoServerConfig crypto_config_; |
| 195 QuicCompressedCertsCache compressed_certs_cache_; | 196 QuicCompressedCertsCache compressed_certs_cache_; |
| 196 scoped_ptr<QuicSimpleServerSession> session_; | 197 std::unique_ptr<QuicSimpleServerSession> session_; |
| 197 scoped_ptr<CryptoHandshakeMessage> handshake_message_; | 198 std::unique_ptr<CryptoHandshakeMessage> handshake_message_; |
| 198 QuicConnectionVisitorInterface* visitor_; | 199 QuicConnectionVisitorInterface* visitor_; |
| 199 MockQuicHeadersStream* headers_stream_; | 200 MockQuicHeadersStream* headers_stream_; |
| 200 }; | 201 }; |
| 201 | 202 |
| 202 INSTANTIATE_TEST_CASE_P(Tests, | 203 INSTANTIATE_TEST_CASE_P(Tests, |
| 203 QuicSimpleServerSessionTest, | 204 QuicSimpleServerSessionTest, |
| 204 ::testing::ValuesIn(QuicSupportedVersions())); | 205 ::testing::ValuesIn(QuicSupportedVersions())); |
| 205 | 206 |
| 206 TEST_P(QuicSimpleServerSessionTest, CloseStreamDueToReset) { | 207 TEST_P(QuicSimpleServerSessionTest, CloseStreamDueToReset) { |
| 207 // Open a stream, then reset it. | 208 // Open a stream, then reset it. |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false))); | 570 .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false))); |
| 570 | 571 |
| 571 EXPECT_CALL(*connection_, SendBlocked(stream_to_open)); | 572 EXPECT_CALL(*connection_, SendBlocked(stream_to_open)); |
| 572 QuicRstStreamFrame rst(stream_got_reset, QUIC_STREAM_CANCELLED, 0); | 573 QuicRstStreamFrame rst(stream_got_reset, QUIC_STREAM_CANCELLED, 0); |
| 573 visitor_->OnRstStream(rst); | 574 visitor_->OnRstStream(rst); |
| 574 } | 575 } |
| 575 | 576 |
| 576 } // namespace | 577 } // namespace |
| 577 } // namespace test | 578 } // namespace test |
| 578 } // namespace net | 579 } // namespace net |
| OLD | NEW |