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/quic/quic_crypto_client_stream.h" | 5 #include "net/quic/quic_crypto_client_stream.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 8 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
10 #include "net/quic/crypto/quic_encrypter.h" | 10 #include "net/quic/crypto/quic_encrypter.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails( | 87 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails( |
88 QUIC_INVALID_CRYPTO_MESSAGE_TYPE, "Expected REJ")); | 88 QUIC_INVALID_CRYPTO_MESSAGE_TYPE, "Expected REJ")); |
89 stream_->ProcessRawData(message_data_->data(), message_data_->length()); | 89 stream_->ProcessRawData(message_data_->data(), message_data_->length()); |
90 } | 90 } |
91 | 91 |
92 TEST_F(QuicCryptoClientStreamTest, NegotiatedParameters) { | 92 TEST_F(QuicCryptoClientStreamTest, NegotiatedParameters) { |
93 CompleteCryptoHandshake(); | 93 CompleteCryptoHandshake(); |
94 | 94 |
95 const QuicConfig* config = session_->config(); | 95 const QuicConfig* config = session_->config(); |
96 EXPECT_EQ(kQBIC, config->congestion_feedback()); | 96 EXPECT_EQ(kQBIC, config->CongestionFeedback()); |
97 EXPECT_EQ(kMaximumIdleTimeoutSecs, | 97 EXPECT_EQ(kMaximumIdleTimeoutSecs, |
98 config->idle_connection_state_lifetime().ToSeconds()); | 98 config->IdleConnectionStateLifetime().ToSeconds()); |
99 EXPECT_EQ(kDefaultMaxStreamsPerConnection, | 99 EXPECT_EQ(kDefaultMaxStreamsPerConnection, |
100 config->max_streams_per_connection()); | 100 config->MaxStreamsPerConnection()); |
101 EXPECT_EQ(0, config->keepalive_timeout().ToSeconds()); | 101 EXPECT_EQ(0, config->KeepaliveTimeout().ToSeconds()); |
102 | 102 |
103 const QuicCryptoNegotiatedParameters& crypto_params( | 103 const QuicCryptoNegotiatedParameters& crypto_params( |
104 stream_->crypto_negotiated_params()); | 104 stream_->crypto_negotiated_params()); |
105 EXPECT_EQ(crypto_config_.aead[0], crypto_params.aead); | 105 EXPECT_EQ(crypto_config_.aead[0], crypto_params.aead); |
106 EXPECT_EQ(crypto_config_.kexs[0], crypto_params.key_exchange); | 106 EXPECT_EQ(crypto_config_.kexs[0], crypto_params.key_exchange); |
107 } | 107 } |
108 | 108 |
109 TEST_F(QuicCryptoClientStreamTest, InvalidHostname) { | 109 TEST_F(QuicCryptoClientStreamTest, InvalidHostname) { |
110 QuicServerId server_id("invalid", 80, false, PRIVACY_MODE_DISABLED); | 110 QuicServerId server_id("invalid", 80, false, PRIVACY_MODE_DISABLED); |
111 stream_.reset(new QuicCryptoClientStream(server_id, session_.get(), NULL, | 111 stream_.reset(new QuicCryptoClientStream(server_id, session_.get(), NULL, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 CryptoHandshakeMessage server_config_update; | 196 CryptoHandshakeMessage server_config_update; |
197 server_config_update.set_tag(kSCUP); | 197 server_config_update.set_tag(kSCUP); |
198 scoped_ptr<QuicData> data( | 198 scoped_ptr<QuicData> data( |
199 CryptoFramer::ConstructHandshakeMessage(server_config_update)); | 199 CryptoFramer::ConstructHandshakeMessage(server_config_update)); |
200 stream_->ProcessRawData(data->data(), data->length()); | 200 stream_->ProcessRawData(data->data(), data->length()); |
201 } | 201 } |
202 | 202 |
203 } // namespace | 203 } // namespace |
204 } // namespace test | 204 } // namespace test |
205 } // namespace net | 205 } // namespace net |
OLD | NEW |