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

Side by Side Diff: net/quic/quic_crypto_server_stream_test.cc

Issue 1983183002: Landing Recent QUIC changes until 5/14/2016 02:25:25 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "first try to fix link error for win_clang build" Created 4 years, 7 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/quic_crypto_server_stream.cc ('k') | net/quic/quic_flags.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/quic_crypto_server_stream.h" 5 #include "net/quic/quic_crypto_server_stream.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 } 452 }
453 453
454 TEST_P(QuicCryptoServerStreamTest, OnlySendSCUPAfterHandshakeComplete) { 454 TEST_P(QuicCryptoServerStreamTest, OnlySendSCUPAfterHandshakeComplete) {
455 // An attempt to send a SCUP before completing handshake should fail. 455 // An attempt to send a SCUP before completing handshake should fail.
456 Initialize(); 456 Initialize();
457 457
458 server_stream()->SendServerConfigUpdate(nullptr); 458 server_stream()->SendServerConfigUpdate(nullptr);
459 EXPECT_EQ(0, server_stream()->NumServerConfigUpdateMessagesSent()); 459 EXPECT_EQ(0, server_stream()->NumServerConfigUpdateMessagesSent());
460 } 460 }
461 461
462 TEST_P(QuicCryptoServerStreamTest, SendSCUPAfterHandshakeComplete) {
463 FLAGS_quic_use_hash_in_scup = true;
464 Initialize();
465
466 InitializeFakeClient(/* supports_stateless_rejects= */ false);
467
468 // Do a first handshake in order to prime the client config with the server's
469 // information.
470 AdvanceHandshakeWithFakeClient();
471
472 // Now do another handshake, with the blocking SHLO connection option.
473 InitializeServer();
474 InitializeFakeClient(/* supports_stateless_rejects= */ false);
475 AdvanceHandshakeWithFakeClient();
476
477 // Send a SCUP message and ensure that the client was able to verify it.
478 EXPECT_CALL(*client_connection_, CloseConnection(_, _, _)).Times(0);
479 server_stream()->SendServerConfigUpdate(nullptr);
480 CryptoTestUtils::AdvanceHandshake(client_connection_, client_stream(), 1,
481 server_connection_, server_stream(), 1);
482
483 EXPECT_EQ(1, server_stream()->NumServerConfigUpdateMessagesSent());
484 EXPECT_EQ(1, client_stream()->num_scup_messages_received());
485 }
486
462 TEST_P(QuicCryptoServerStreamTest, DoesPeerSupportStatelessRejects) { 487 TEST_P(QuicCryptoServerStreamTest, DoesPeerSupportStatelessRejects) {
463 Initialize(); 488 Initialize();
464 489
465 ConstructHandshakeMessage(); 490 ConstructHandshakeMessage();
466 QuicConfig stateless_reject_config = DefaultQuicConfigStatelessRejects(); 491 QuicConfig stateless_reject_config = DefaultQuicConfigStatelessRejects();
467 stateless_reject_config.ToHandshakeMessage(&message_); 492 stateless_reject_config.ToHandshakeMessage(&message_);
468 EXPECT_TRUE( 493 EXPECT_TRUE(
469 QuicCryptoServerStreamPeer::DoesPeerSupportStatelessRejects(message_)); 494 QuicCryptoServerStreamPeer::DoesPeerSupportStatelessRejects(message_));
470 495
471 message_.Clear(); 496 message_.Clear();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 QUIC_NO_ERROR, "", ConnectionCloseBehavior::SILENT_CLOSE); 561 QUIC_NO_ERROR, "", ConnectionCloseBehavior::SILENT_CLOSE);
537 562
538 // The outstanding nonce verification RPC now completes. 563 // The outstanding nonce verification RPC now completes.
539 strike_register_client_->RunPendingVerifications(); 564 strike_register_client_->RunPendingVerifications();
540 } 565 }
541 566
542 } // namespace 567 } // namespace
543 568
544 } // namespace test 569 } // namespace test
545 } // namespace net 570 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_server_stream.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698