| 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/core/quic_crypto_client_stream.h" | 5 #include "net/quic/core/quic_crypto_client_stream.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "net/quic/core/crypto/aes_128_gcm_12_encrypter.h" | 9 #include "net/quic/core/crypto/aes_128_gcm_12_encrypter.h" |
| 10 #include "net/quic/core/crypto/quic_decrypter.h" | 10 #include "net/quic/core/crypto/quic_decrypter.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 // Make sure that the STK and SCFG are cached correctly. | 224 // Make sure that the STK and SCFG are cached correctly. |
| 225 EXPECT_EQ("xstk", state->source_address_token()); | 225 EXPECT_EQ("xstk", state->source_address_token()); |
| 226 | 226 |
| 227 const string& cached_scfg = state->server_config(); | 227 const string& cached_scfg = state->server_config(); |
| 228 test::CompareCharArraysWithHexError( | 228 test::CompareCharArraysWithHexError( |
| 229 "scfg", cached_scfg.data(), cached_scfg.length(), | 229 "scfg", cached_scfg.data(), cached_scfg.length(), |
| 230 reinterpret_cast<char*>(scfg), arraysize(scfg)); | 230 reinterpret_cast<char*>(scfg), arraysize(scfg)); |
| 231 | 231 |
| 232 QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(stream()); | 232 QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(stream()); |
| 233 EXPECT_NE(FLAGS_quic_release_crypto_stream_buffer, | 233 EXPECT_NE( |
| 234 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); | 234 FLAGS_quic_release_crypto_stream_buffer && |
| 235 FLAGS_quic_reduce_sequencer_buffer_memory_life_time, // NOLINT |
| 236 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); |
| 235 } | 237 } |
| 236 | 238 |
| 237 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateWithCert) { | 239 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateWithCert) { |
| 238 // Test that the crypto client stream can receive and use server config | 240 // Test that the crypto client stream can receive and use server config |
| 239 // updates with certificates after the connection has been established. | 241 // updates with certificates after the connection has been established. |
| 240 CompleteCryptoHandshake(); | 242 CompleteCryptoHandshake(); |
| 241 | 243 |
| 242 // Build a server config update message with certificates | 244 // Build a server config update message with certificates |
| 243 QuicCryptoServerConfig crypto_config( | 245 QuicCryptoServerConfig crypto_config( |
| 244 QuicCryptoServerConfig::TESTING, QuicRandom::GetInstance(), | 246 QuicCryptoServerConfig::TESTING, QuicRandom::GetInstance(), |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 client_state->GetNextServerDesignatedConnectionId(); | 426 client_state->GetNextServerDesignatedConnectionId(); |
| 425 QuicConnectionId expected_id = | 427 QuicConnectionId expected_id = |
| 426 server_session_->connection()->random_generator()->RandUint64(); | 428 server_session_->connection()->random_generator()->RandUint64(); |
| 427 EXPECT_EQ(expected_id, server_designated_id); | 429 EXPECT_EQ(expected_id, server_designated_id); |
| 428 EXPECT_FALSE(client_state->has_server_designated_connection_id()); | 430 EXPECT_FALSE(client_state->has_server_designated_connection_id()); |
| 429 } | 431 } |
| 430 | 432 |
| 431 } // namespace | 433 } // namespace |
| 432 } // namespace test | 434 } // namespace test |
| 433 } // namespace net | 435 } // namespace net |
| OLD | NEW |