| 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/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
| 10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 class QuicServerSessionTest : public ::testing::TestWithParam<QuicVersion> { | 48 class QuicServerSessionTest : public ::testing::TestWithParam<QuicVersion> { |
| 49 protected: | 49 protected: |
| 50 QuicServerSessionTest() | 50 QuicServerSessionTest() |
| 51 : crypto_config_(QuicCryptoServerConfig::TESTING, | 51 : crypto_config_(QuicCryptoServerConfig::TESTING, |
| 52 QuicRandom::GetInstance()) { | 52 QuicRandom::GetInstance()) { |
| 53 config_.SetDefaults(); | 53 config_.SetDefaults(); |
| 54 config_.set_max_streams_per_connection(3, 3); | 54 config_.set_max_streams_per_connection(3, 3); |
| 55 config_.SetInitialFlowControlWindowToSend(kInitialFlowControlWindowForTest); |
| 55 | 56 |
| 56 connection_ = | 57 connection_ = |
| 57 new StrictMock<MockConnection>(true, SupportedVersions(GetParam())); | 58 new StrictMock<MockConnection>(true, SupportedVersions(GetParam())); |
| 58 session_.reset(new QuicServerSession( | 59 session_.reset(new QuicServerSession(config_, connection_, &owner_)); |
| 59 config_, connection_, kInitialFlowControlWindowForTest, &owner_)); | |
| 60 session_->InitializeSession(crypto_config_); | 60 session_->InitializeSession(crypto_config_); |
| 61 visitor_ = QuicConnectionPeer::GetVisitor(connection_); | 61 visitor_ = QuicConnectionPeer::GetVisitor(connection_); |
| 62 } | 62 } |
| 63 | 63 |
| 64 QuicVersion version() const { return connection_->version(); } | 64 QuicVersion version() const { return connection_->version(); } |
| 65 | 65 |
| 66 StrictMock<MockQuicServerSessionVisitor> owner_; | 66 StrictMock<MockQuicServerSessionVisitor> owner_; |
| 67 StrictMock<MockConnection>* connection_; | 67 StrictMock<MockConnection>* connection_; |
| 68 QuicConfig config_; | 68 QuicConfig config_; |
| 69 QuicCryptoServerConfig crypto_config_; | 69 QuicCryptoServerConfig crypto_config_; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Incoming streams on the server session must be odd. | 174 // Incoming streams on the server session must be odd. |
| 175 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); | 175 EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID)); |
| 176 EXPECT_EQ(NULL, | 176 EXPECT_EQ(NULL, |
| 177 QuicServerSessionPeer::GetIncomingDataStream(session_.get(), 4)); | 177 QuicServerSessionPeer::GetIncomingDataStream(session_.get(), 4)); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace | 180 } // namespace |
| 181 } // namespace test | 181 } // namespace test |
| 182 } // namespace tools | 182 } // namespace tools |
| 183 } // namespace net | 183 } // namespace net |
| OLD | NEW |