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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 EXPECT_CALL(*connection_, | 103 EXPECT_CALL(*connection_, |
104 SendConnectionCloseWithDetails(QUIC_INVALID_CRYPTO_MESSAGE_TYPE, | 104 SendConnectionCloseWithDetails(QUIC_INVALID_CRYPTO_MESSAGE_TYPE, |
105 "Expected REJ")); | 105 "Expected REJ")); |
106 stream()->OnStreamFrame(QuicStreamFrame(kCryptoStreamId, /*fin=*/false, | 106 stream()->OnStreamFrame(QuicStreamFrame(kCryptoStreamId, /*fin=*/false, |
107 /*offset=*/0, | 107 /*offset=*/0, |
108 message_data_->AsStringPiece())); | 108 message_data_->AsStringPiece())); |
109 } | 109 } |
110 | 110 |
111 TEST_F(QuicCryptoClientStreamTest, NegotiatedParameters) { | 111 TEST_F(QuicCryptoClientStreamTest, NegotiatedParameters) { |
112 FLAGS_quic_use_rfc7539 = true; | |
113 CompleteCryptoHandshake(); | 112 CompleteCryptoHandshake(); |
114 | 113 |
115 const QuicConfig* config = session_->config(); | 114 const QuicConfig* config = session_->config(); |
116 EXPECT_EQ(kMaximumIdleTimeoutSecs, | 115 EXPECT_EQ(kMaximumIdleTimeoutSecs, |
117 config->IdleConnectionStateLifetime().ToSeconds()); | 116 config->IdleConnectionStateLifetime().ToSeconds()); |
118 EXPECT_EQ(kDefaultMaxStreamsPerConnection, config->MaxStreamsPerConnection()); | 117 EXPECT_EQ(kDefaultMaxStreamsPerConnection, config->MaxStreamsPerConnection()); |
119 | 118 |
120 const QuicCryptoNegotiatedParameters& crypto_params( | 119 const QuicCryptoNegotiatedParameters& crypto_params( |
121 stream()->crypto_negotiated_params()); | 120 stream()->crypto_negotiated_params()); |
122 EXPECT_EQ(crypto_config_.aead[0], crypto_params.aead); | 121 EXPECT_EQ(crypto_config_.aead[0], crypto_params.aead); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 client_state->GetNextServerDesignatedConnectionId(); | 347 client_state->GetNextServerDesignatedConnectionId(); |
349 QuicConnectionId expected_id = | 348 QuicConnectionId expected_id = |
350 server_session_->connection()->random_generator()->RandUint64(); | 349 server_session_->connection()->random_generator()->RandUint64(); |
351 EXPECT_EQ(expected_id, server_designated_id); | 350 EXPECT_EQ(expected_id, server_designated_id); |
352 EXPECT_FALSE(client_state->has_server_designated_connection_id()); | 351 EXPECT_FALSE(client_state->has_server_designated_connection_id()); |
353 } | 352 } |
354 | 353 |
355 } // namespace | 354 } // namespace |
356 } // namespace test | 355 } // namespace test |
357 } // namespace net | 356 } // namespace net |
OLD | NEW |