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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "net/quic/test_tools/quic_test_utils.h" | 22 #include "net/quic/test_tools/quic_test_utils.h" |
23 #include "net/test/gtest_util.h" | 23 #include "net/test/gtest_util.h" |
24 #include "net/tools/quic/quic_spdy_server_stream.h" | 24 #include "net/tools/quic/quic_spdy_server_stream.h" |
25 #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" |
26 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
28 | 28 |
29 using __gnu_cxx::vector; | 29 using __gnu_cxx::vector; |
30 using net::test::CryptoTestUtils; | 30 using net::test::CryptoTestUtils; |
31 using net::test::MockConnection; | 31 using net::test::MockConnection; |
32 using net::test::MockHelper; | 32 using net::test::MockConnectionHelper; |
33 using net::test::QuicConfigPeer; | 33 using net::test::QuicConfigPeer; |
34 using net::test::QuicConnectionPeer; | 34 using net::test::QuicConnectionPeer; |
35 using net::test::QuicSpdyStreamPeer; | 35 using net::test::QuicSpdyStreamPeer; |
36 using net::test::QuicSentPacketManagerPeer; | 36 using net::test::QuicSentPacketManagerPeer; |
37 using net::test::QuicSessionPeer; | 37 using net::test::QuicSessionPeer; |
38 using net::test::QuicSpdySessionPeer; | 38 using net::test::QuicSpdySessionPeer; |
39 using net::test::QuicSustainedBandwidthRecorderPeer; | 39 using net::test::QuicSustainedBandwidthRecorderPeer; |
40 using net::test::SupportedVersions; | 40 using net::test::SupportedVersions; |
41 using net::test::ValueRestore; | 41 using net::test::ValueRestore; |
42 using net::test::kClientDataStreamId1; | 42 using net::test::kClientDataStreamId1; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 new QuicServerSession(config_, connection_, &owner_, &crypto_config_)); | 91 new QuicServerSession(config_, connection_, &owner_, &crypto_config_)); |
92 MockClock clock; | 92 MockClock clock; |
93 handshake_message_.reset(crypto_config_.AddDefaultConfig( | 93 handshake_message_.reset(crypto_config_.AddDefaultConfig( |
94 QuicRandom::GetInstance(), &clock, | 94 QuicRandom::GetInstance(), &clock, |
95 QuicCryptoServerConfig::ConfigOptions())); | 95 QuicCryptoServerConfig::ConfigOptions())); |
96 session_->Initialize(); | 96 session_->Initialize(); |
97 visitor_ = QuicConnectionPeer::GetVisitor(connection_); | 97 visitor_ = QuicConnectionPeer::GetVisitor(connection_); |
98 } | 98 } |
99 | 99 |
100 StrictMock<MockQuicServerSessionVisitor> owner_; | 100 StrictMock<MockQuicServerSessionVisitor> owner_; |
101 MockHelper helper_; | 101 MockConnectionHelper helper_; |
102 StrictMock<MockConnection>* connection_; | 102 StrictMock<MockConnection>* connection_; |
103 QuicConfig config_; | 103 QuicConfig config_; |
104 QuicCryptoServerConfig crypto_config_; | 104 QuicCryptoServerConfig crypto_config_; |
105 scoped_ptr<QuicServerSession> session_; | 105 scoped_ptr<QuicServerSession> session_; |
106 scoped_ptr<CryptoHandshakeMessage> handshake_message_; | 106 scoped_ptr<CryptoHandshakeMessage> handshake_message_; |
107 QuicConnectionVisitorInterface* visitor_; | 107 QuicConnectionVisitorInterface* visitor_; |
108 }; | 108 }; |
109 | 109 |
110 // Compares CachedNetworkParameters. | 110 // Compares CachedNetworkParameters. |
111 MATCHER_P(EqualsProto, network_params, "") { | 111 MATCHER_P(EqualsProto, network_params, "") { |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); | 492 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); |
493 session_->OnConfigNegotiated(); | 493 session_->OnConfigNegotiated(); |
494 EXPECT_FALSE( | 494 EXPECT_FALSE( |
495 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); | 495 QuicServerSessionPeer::IsBandwidthResumptionEnabled(session_.get())); |
496 } | 496 } |
497 | 497 |
498 } // namespace | 498 } // namespace |
499 } // namespace test | 499 } // namespace test |
500 } // namespace tools | 500 } // namespace tools |
501 } // namespace net | 501 } // namespace net |
OLD | NEW |