Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: net/quic/core/quic_crypto_client_stream_test.cc

Issue 2322233004: Landing Recent QUIC changes until Sun Sep 4 03:41:00 (Closed)
Patch Set: Remove simulation files from the build. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_connection_test.cc ('k') | net/quic/core/quic_crypto_server_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 server_config_update.SetValue(kSTTL, expiry_seconds); 218 server_config_update.SetValue(kSTTL, expiry_seconds);
219 219
220 std::unique_ptr<QuicData> data( 220 std::unique_ptr<QuicData> data(
221 CryptoFramer::ConstructHandshakeMessage(server_config_update)); 221 CryptoFramer::ConstructHandshakeMessage(server_config_update));
222 stream()->OnStreamFrame(QuicStreamFrame(kCryptoStreamId, /*fin=*/false, 222 stream()->OnStreamFrame(QuicStreamFrame(kCryptoStreamId, /*fin=*/false,
223 /*offset=*/0, data->AsStringPiece())); 223 /*offset=*/0, data->AsStringPiece()));
224 224
225 // Make sure that the STK and SCFG are cached correctly. 225 // Make sure that the STK and SCFG are cached correctly.
226 EXPECT_EQ("xstk", state->source_address_token()); 226 EXPECT_EQ("xstk", state->source_address_token());
227 227
228 string cached_scfg = state->server_config(); 228 const string& cached_scfg = state->server_config();
229 test::CompareCharArraysWithHexError( 229 test::CompareCharArraysWithHexError(
230 "scfg", cached_scfg.data(), cached_scfg.length(), 230 "scfg", cached_scfg.data(), cached_scfg.length(),
231 QuicUtils::AsChars(scfg), arraysize(scfg)); 231 QuicUtils::AsChars(scfg), arraysize(scfg));
232 } 232 }
233 233
234 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateBeforeHandshake) { 234 TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateBeforeHandshake) {
235 EXPECT_CALL( 235 EXPECT_CALL(
236 *connection_, 236 *connection_,
237 CloseConnection(QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE, _, _)); 237 CloseConnection(QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE, _, _));
238 CryptoHandshakeMessage server_config_update; 238 CryptoHandshakeMessage server_config_update;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 client_state->GetNextServerDesignatedConnectionId(); 374 client_state->GetNextServerDesignatedConnectionId();
375 QuicConnectionId expected_id = 375 QuicConnectionId expected_id =
376 server_session_->connection()->random_generator()->RandUint64(); 376 server_session_->connection()->random_generator()->RandUint64();
377 EXPECT_EQ(expected_id, server_designated_id); 377 EXPECT_EQ(expected_id, server_designated_id);
378 EXPECT_FALSE(client_state->has_server_designated_connection_id()); 378 EXPECT_FALSE(client_state->has_server_designated_connection_id());
379 } 379 }
380 380
381 } // namespace 381 } // namespace
382 } // namespace test 382 } // namespace test
383 } // namespace net 383 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_connection_test.cc ('k') | net/quic/core/quic_crypto_server_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698