| 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/proto/cached_network_parameters.pb.h" | 9 #include "net/quic/proto/cached_network_parameters.pb.h" |
| 10 #include "net/quic/quic_connection.h" | 10 #include "net/quic/quic_connection.h" |
| 11 #include "net/quic/quic_crypto_server_stream.h" | 11 #include "net/quic/quic_crypto_server_stream.h" |
| 12 #include "net/quic/quic_flags.h" | 12 #include "net/quic/quic_flags.h" |
| 13 #include "net/quic/quic_utils.h" | 13 #include "net/quic/quic_utils.h" |
| 14 #include "net/quic/test_tools/crypto_test_utils.h" |
| 14 #include "net/quic/test_tools/quic_config_peer.h" | 15 #include "net/quic/test_tools/quic_config_peer.h" |
| 15 #include "net/quic/test_tools/quic_connection_peer.h" | 16 #include "net/quic/test_tools/quic_connection_peer.h" |
| 16 #include "net/quic/test_tools/quic_data_stream_peer.h" | 17 #include "net/quic/test_tools/quic_data_stream_peer.h" |
| 17 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" | 18 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" |
| 18 #include "net/quic/test_tools/quic_session_peer.h" | 19 #include "net/quic/test_tools/quic_session_peer.h" |
| 19 #include "net/quic/test_tools/quic_spdy_session_peer.h" | 20 #include "net/quic/test_tools/quic_spdy_session_peer.h" |
| 20 #include "net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h" | 21 #include "net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h" |
| 21 #include "net/quic/test_tools/quic_test_utils.h" | 22 #include "net/quic/test_tools/quic_test_utils.h" |
| 22 #include "net/test/gtest_util.h" | 23 #include "net/test/gtest_util.h" |
| 23 #include "net/tools/quic/quic_spdy_server_stream.h" | 24 #include "net/tools/quic/quic_spdy_server_stream.h" |
| 24 #include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" | 25 #include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" |
| 25 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 28 |
| 28 using __gnu_cxx::vector; | 29 using __gnu_cxx::vector; |
| 30 using net::test::CryptoTestUtils; |
| 29 using net::test::MockConnection; | 31 using net::test::MockConnection; |
| 30 using net::test::QuicConfigPeer; | 32 using net::test::QuicConfigPeer; |
| 31 using net::test::QuicConnectionPeer; | 33 using net::test::QuicConnectionPeer; |
| 32 using net::test::QuicDataStreamPeer; | 34 using net::test::QuicDataStreamPeer; |
| 33 using net::test::QuicSentPacketManagerPeer; | 35 using net::test::QuicSentPacketManagerPeer; |
| 34 using net::test::QuicSessionPeer; | 36 using net::test::QuicSessionPeer; |
| 35 using net::test::QuicSpdySessionPeer; | 37 using net::test::QuicSpdySessionPeer; |
| 36 using net::test::QuicSustainedBandwidthRecorderPeer; | 38 using net::test::QuicSustainedBandwidthRecorderPeer; |
| 37 using net::test::SupportedVersions; | 39 using net::test::SupportedVersions; |
| 38 using net::test::ValueRestore; | 40 using net::test::ValueRestore; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 namespace { | 70 namespace { |
| 69 | 71 |
| 70 const size_t kMaxStreamsForTest = 10; | 72 const size_t kMaxStreamsForTest = 10; |
| 71 | 73 |
| 72 class QuicServerSessionTest : public ::testing::TestWithParam<QuicVersion> { | 74 class QuicServerSessionTest : public ::testing::TestWithParam<QuicVersion> { |
| 73 protected: | 75 protected: |
| 74 QuicServerSessionTest() | 76 QuicServerSessionTest() |
| 75 : crypto_config_(QuicCryptoServerConfig::TESTING, | 77 : crypto_config_(QuicCryptoServerConfig::TESTING, |
| 76 QuicRandom::GetInstance()) { | 78 QuicRandom::GetInstance(), |
| 79 CryptoTestUtils::ProofSourceForTesting()) { |
| 77 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, | 80 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, |
| 78 kMaxStreamsForTest); | 81 kMaxStreamsForTest); |
| 79 config_.SetInitialStreamFlowControlWindowToSend( | 82 config_.SetInitialStreamFlowControlWindowToSend( |
| 80 kInitialStreamFlowControlWindowForTest); | 83 kInitialStreamFlowControlWindowForTest); |
| 81 config_.SetInitialSessionFlowControlWindowToSend( | 84 config_.SetInitialSessionFlowControlWindowToSend( |
| 82 kInitialSessionFlowControlWindowForTest); | 85 kInitialSessionFlowControlWindowForTest); |
| 83 | 86 |
| 84 connection_ = new StrictMock<MockConnection>(Perspective::IS_SERVER, | 87 connection_ = new StrictMock<MockConnection>(Perspective::IS_SERVER, |
| 85 SupportedVersions(GetParam())); | 88 SupportedVersions(GetParam())); |
| 86 session_.reset( | 89 session_.reset( |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); | 482 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); |
| 480 session_->OnConfigNegotiated(); | 483 session_->OnConfigNegotiated(); |
| 481 EXPECT_FALSE( | 484 EXPECT_FALSE( |
| 482 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); | 485 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); |
| 483 } | 486 } |
| 484 | 487 |
| 485 } // namespace | 488 } // namespace |
| 486 } // namespace test | 489 } // namespace test |
| 487 } // namespace tools | 490 } // namespace tools |
| 488 } // namespace net | 491 } // namespace net |
| OLD | NEW |