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/quic_client_session_base.h" | 8 #include "net/quic/quic_client_session_base.h" |
9 #include "net/quic/quic_server_id.h" | 9 #include "net/quic/quic_server_id.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 void MockCryptoClientStream::SetConfigNegotiated() { | 82 void MockCryptoClientStream::SetConfigNegotiated() { |
83 ASSERT_FALSE(session()->config()->negotiated()); | 83 ASSERT_FALSE(session()->config()->negotiated()); |
84 QuicTagVector cgst; | 84 QuicTagVector cgst; |
85 // TODO(rtenneti): Enable the following code after BBR code is checked in. | 85 // TODO(rtenneti): Enable the following code after BBR code is checked in. |
86 #if 0 | 86 #if 0 |
87 cgst.push_back(kTBBR); | 87 cgst.push_back(kTBBR); |
88 #endif | 88 #endif |
89 cgst.push_back(kQBIC); | 89 cgst.push_back(kQBIC); |
90 QuicConfig config; | 90 QuicConfig config; |
91 config.SetCongestionFeedback(cgst, kQBIC); | |
92 config.SetIdleConnectionStateLifetime( | 91 config.SetIdleConnectionStateLifetime( |
93 QuicTime::Delta::FromSeconds(2 * kMaximumIdleTimeoutSecs), | 92 QuicTime::Delta::FromSeconds(2 * kMaximumIdleTimeoutSecs), |
94 QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs)); | 93 QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs)); |
95 config.SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection / 2, | 94 config.SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection / 2, |
96 kDefaultMaxStreamsPerConnection / 2); | 95 kDefaultMaxStreamsPerConnection / 2); |
97 config.SetBytesForConnectionIdToSend(PACKET_8BYTE_CONNECTION_ID); | 96 config.SetBytesForConnectionIdToSend(PACKET_8BYTE_CONNECTION_ID); |
98 | 97 |
99 CryptoHandshakeMessage msg; | 98 CryptoHandshakeMessage msg; |
100 config.ToHandshakeMessage(&msg); | 99 config.ToHandshakeMessage(&msg); |
101 string error_details; | 100 string error_details; |
102 const QuicErrorCode error = | 101 const QuicErrorCode error = |
103 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); | 102 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); |
104 ASSERT_EQ(QUIC_NO_ERROR, error); | 103 ASSERT_EQ(QUIC_NO_ERROR, error); |
105 ASSERT_TRUE(session()->config()->negotiated()); | 104 ASSERT_TRUE(session()->config()->negotiated()); |
106 session()->OnConfigNegotiated(); | 105 session()->OnConfigNegotiated(); |
107 } | 106 } |
108 | 107 |
109 QuicClientSessionBase* MockCryptoClientStream::client_session() { | 108 QuicClientSessionBase* MockCryptoClientStream::client_session() { |
110 return reinterpret_cast<QuicClientSessionBase*>(session()); | 109 return reinterpret_cast<QuicClientSessionBase*>(session()); |
111 } | 110 } |
112 | 111 |
113 } // namespace net | 112 } // namespace net |
OLD | NEW |