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