OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/quic/test_tools/mock_crypto_client_stream.h" | 5 #include "net/quic/test_tools/mock_crypto_client_stream.h" |
6 | 6 |
7 #include "net/quic/crypto/quic_decrypter.h" | 7 #include "net/quic/crypto/quic_decrypter.h" |
8 #include "net/quic/crypto/quic_encrypter.h" | 8 #include "net/quic/crypto/quic_encrypter.h" |
9 #include "net/quic/quic_client_session_base.h" | 9 #include "net/quic/quic_client_session_base.h" |
| 10 #include "net/quic/test_tools/quic_config_peer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 | 12 |
12 using std::string; | 13 using std::string; |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 | 16 |
16 MockCryptoClientStream::MockCryptoClientStream( | 17 MockCryptoClientStream::MockCryptoClientStream( |
17 const QuicServerId& server_id, | 18 const QuicServerId& server_id, |
18 QuicClientSessionBase* session, | 19 QuicClientSessionBase* session, |
19 ProofVerifyContext* verify_context, | 20 ProofVerifyContext* verify_context, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 cgst.push_back(kTBBR); | 118 cgst.push_back(kTBBR); |
118 #endif | 119 #endif |
119 cgst.push_back(kQBIC); | 120 cgst.push_back(kQBIC); |
120 QuicConfig config; | 121 QuicConfig config; |
121 config.SetIdleConnectionStateLifetime( | 122 config.SetIdleConnectionStateLifetime( |
122 QuicTime::Delta::FromSeconds(2 * kMaximumIdleTimeoutSecs), | 123 QuicTime::Delta::FromSeconds(2 * kMaximumIdleTimeoutSecs), |
123 QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs)); | 124 QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs)); |
124 config.SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection / 2, | 125 config.SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection / 2, |
125 kDefaultMaxStreamsPerConnection / 2); | 126 kDefaultMaxStreamsPerConnection / 2); |
126 config.SetBytesForConnectionIdToSend(PACKET_8BYTE_CONNECTION_ID); | 127 config.SetBytesForConnectionIdToSend(PACKET_8BYTE_CONNECTION_ID); |
| 128 config.SetMaxIncomingDynamicStreamsToSend(kDefaultMaxStreamsPerConnection / |
| 129 2); |
127 | 130 |
128 CryptoHandshakeMessage msg; | 131 CryptoHandshakeMessage msg; |
129 config.ToHandshakeMessage(&msg); | 132 config.ToHandshakeMessage(&msg); |
130 string error_details; | 133 string error_details; |
131 const QuicErrorCode error = | 134 const QuicErrorCode error = |
132 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); | 135 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); |
133 ASSERT_EQ(QUIC_NO_ERROR, error); | 136 ASSERT_EQ(QUIC_NO_ERROR, error); |
134 ASSERT_TRUE(session()->config()->negotiated()); | 137 ASSERT_TRUE(session()->config()->negotiated()); |
135 session()->OnConfigNegotiated(); | 138 session()->OnConfigNegotiated(); |
136 } | 139 } |
137 | 140 |
138 } // namespace net | 141 } // namespace net |
OLD | NEW |