OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 TestQuicSpdyServerSession(const QuicConfig& config, | 61 TestQuicSpdyServerSession(const QuicConfig& config, |
62 QuicConnection* connection, | 62 QuicConnection* connection, |
63 const QuicCryptoServerConfig* crypto_config, | 63 const QuicCryptoServerConfig* crypto_config, |
64 QuicCompressedCertsCache* compressed_certs_cache) | 64 QuicCompressedCertsCache* compressed_certs_cache) |
65 : QuicServerSessionBase(config, | 65 : QuicServerSessionBase(config, |
66 connection, | 66 connection, |
67 nullptr, | 67 nullptr, |
68 nullptr, | 68 nullptr, |
69 crypto_config, | 69 crypto_config, |
70 compressed_certs_cache), | 70 compressed_certs_cache), |
71 crypto_stream_(QuicServerSessionBase::GetCryptoStream()) {} | 71 crypto_stream_(QuicServerSessionBase::GetMutableCryptoStream()) {} |
72 | 72 |
73 ~TestQuicSpdyServerSession() override { delete connection(); }; | 73 ~TestQuicSpdyServerSession() override { delete connection(); }; |
74 | 74 |
75 MOCK_METHOD3(OnConnectionClosed, | 75 MOCK_METHOD3(OnConnectionClosed, |
76 void(QuicErrorCode error, | 76 void(QuicErrorCode error, |
77 const string& error_details, | 77 const string& error_details, |
78 ConnectionCloseSource source)); | 78 ConnectionCloseSource source)); |
79 MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); | 79 MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); |
80 MOCK_METHOD1(CreateOutgoingDynamicStream, | 80 MOCK_METHOD1(CreateOutgoingDynamicStream, |
81 QuicSpdyStream*(SpdyPriority priority)); | 81 QuicSpdyStream*(SpdyPriority priority)); |
82 | 82 |
83 QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( | 83 QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( |
84 const QuicCryptoServerConfig* crypto_config, | 84 const QuicCryptoServerConfig* crypto_config, |
85 QuicCompressedCertsCache* compressed_certs_cache) override { | 85 QuicCompressedCertsCache* compressed_certs_cache) override { |
86 return new QuicCryptoServerStream( | 86 return new QuicCryptoServerStream( |
87 crypto_config, compressed_certs_cache, | 87 crypto_config, compressed_certs_cache, |
88 FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support, this, | 88 FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support, this, |
89 stream_helper()); | 89 stream_helper()); |
90 } | 90 } |
91 | 91 |
92 void SetCryptoStream(QuicCryptoServerStream* crypto_stream) { | 92 void SetCryptoStream(QuicCryptoServerStream* crypto_stream) { |
93 crypto_stream_ = crypto_stream; | 93 crypto_stream_ = crypto_stream; |
94 } | 94 } |
95 | 95 |
96 QuicCryptoServerStreamBase* GetCryptoStream() override { | 96 QuicCryptoServerStreamBase* GetMutableCryptoStream() override { |
97 return crypto_stream_; | 97 return crypto_stream_; |
98 } | 98 } |
99 | 99 |
| 100 const QuicCryptoServerStreamBase* GetCryptoStream() const override { |
| 101 return crypto_stream_; |
| 102 } |
| 103 |
100 QuicCryptoServerStream::Helper* stream_helper() { | 104 QuicCryptoServerStream::Helper* stream_helper() { |
101 return QuicServerSessionBase::stream_helper(); | 105 return QuicServerSessionBase::stream_helper(); |
102 } | 106 } |
103 | 107 |
104 private: | 108 private: |
105 QuicCryptoServerStreamBase* crypto_stream_; | 109 QuicCryptoServerStreamBase* crypto_stream_; |
106 | 110 |
107 DISALLOW_COPY_AND_ASSIGN(TestQuicSpdyServerSession); | 111 DISALLOW_COPY_AND_ASSIGN(TestQuicSpdyServerSession); |
108 }; | 112 }; |
109 | 113 |
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 check.Call(2); | 2044 check.Call(2); |
2041 GetFakeProofSource()->InvokePendingCallback(0); | 2045 GetFakeProofSource()->InvokePendingCallback(0); |
2042 ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 0); | 2046 ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 0); |
2043 EXPECT_FALSE(store->HasBufferedPackets(conn_id)); | 2047 EXPECT_FALSE(store->HasBufferedPackets(conn_id)); |
2044 EXPECT_FALSE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id)); | 2048 EXPECT_FALSE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id)); |
2045 } | 2049 } |
2046 | 2050 |
2047 } // namespace | 2051 } // namespace |
2048 } // namespace test | 2052 } // namespace test |
2049 } // namespace net | 2053 } // namespace net |
OLD | NEW |