| 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 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails( | 86 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails( |
| 87 QUIC_INVALID_CRYPTO_MESSAGE_TYPE, "Expected REJ")); | 87 QUIC_INVALID_CRYPTO_MESSAGE_TYPE, "Expected REJ")); |
| 88 stream_->ProcessRawData(message_data_->data(), message_data_->length()); | 88 stream_->ProcessRawData(message_data_->data(), message_data_->length()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 TEST_F(QuicCryptoClientStreamTest, NegotiatedParameters) { | 91 TEST_F(QuicCryptoClientStreamTest, NegotiatedParameters) { |
| 92 CompleteCryptoHandshake(); | 92 CompleteCryptoHandshake(); |
| 93 | 93 |
| 94 const QuicConfig* config = session_->config(); | 94 const QuicConfig* config = session_->config(); |
| 95 EXPECT_EQ(FLAGS_enable_quic_pacing ? kPACE : kQBIC, | 95 EXPECT_EQ(FLAGS_enable_quic_pacing ? kPACE : kQBIC, |
| 96 config->congestion_control()); | 96 config->congestion_feedback()); |
| 97 EXPECT_EQ(kDefaultTimeoutSecs, | 97 EXPECT_EQ(kDefaultTimeoutSecs, |
| 98 config->idle_connection_state_lifetime().ToSeconds()); | 98 config->idle_connection_state_lifetime().ToSeconds()); |
| 99 EXPECT_EQ(kDefaultMaxStreamsPerConnection, | 99 EXPECT_EQ(kDefaultMaxStreamsPerConnection, |
| 100 config->max_streams_per_connection()); | 100 config->max_streams_per_connection()); |
| 101 EXPECT_EQ(0, config->keepalive_timeout().ToSeconds()); | 101 EXPECT_EQ(0, config->keepalive_timeout().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); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 136 | 136 |
| 137 // Check that a client hello was sent and that CryptoConnect doesn't fail | 137 // Check that a client hello was sent and that CryptoConnect doesn't fail |
| 138 // with an error. | 138 // with an error. |
| 139 EXPECT_TRUE(stream_->CryptoConnect()); | 139 EXPECT_TRUE(stream_->CryptoConnect()); |
| 140 ASSERT_EQ(1u, connection_->packets_.size()); | 140 ASSERT_EQ(1u, connection_->packets_.size()); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace | 143 } // namespace |
| 144 } // namespace test | 144 } // namespace test |
| 145 } // namespace net | 145 } // namespace net |
| OLD | NEW |