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_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 server_stream()); | 371 server_stream()); |
372 } | 372 } |
373 | 373 |
374 EXPECT_EQ(1, client_stream()->num_sent_client_hellos()); | 374 EXPECT_EQ(1, client_stream()->num_sent_client_hellos()); |
375 } | 375 } |
376 | 376 |
377 TEST_P(QuicCryptoServerStreamTest, MessageAfterHandshake) { | 377 TEST_P(QuicCryptoServerStreamTest, MessageAfterHandshake) { |
378 FLAGS_quic_require_fix = false; | 378 FLAGS_quic_require_fix = false; |
379 Initialize(); | 379 Initialize(); |
380 CompleteCryptoHandshake(); | 380 CompleteCryptoHandshake(); |
381 EXPECT_CALL( | 381 EXPECT_CALL(*server_connection_, |
382 *server_connection_, | 382 SendConnectionCloseWithDetails( |
383 SendConnectionClose(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE)); | 383 QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE, _)); |
384 message_.set_tag(kCHLO); | 384 message_.set_tag(kCHLO); |
385 ConstructHandshakeMessage(); | 385 ConstructHandshakeMessage(); |
386 server_stream()->OnStreamFrame( | 386 server_stream()->OnStreamFrame( |
387 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, | 387 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, |
388 message_data_->AsStringPiece())); | 388 message_data_->AsStringPiece())); |
389 } | 389 } |
390 | 390 |
391 TEST_P(QuicCryptoServerStreamTest, BadMessageType) { | 391 TEST_P(QuicCryptoServerStreamTest, BadMessageType) { |
392 FLAGS_quic_require_fix = false; | 392 FLAGS_quic_require_fix = false; |
393 Initialize(); | 393 Initialize(); |
394 | 394 |
395 message_.set_tag(kSHLO); | 395 message_.set_tag(kSHLO); |
396 ConstructHandshakeMessage(); | 396 ConstructHandshakeMessage(); |
397 EXPECT_CALL(*server_connection_, | 397 EXPECT_CALL(*server_connection_, SendConnectionCloseWithDetails( |
398 SendConnectionClose(QUIC_INVALID_CRYPTO_MESSAGE_TYPE)); | 398 QUIC_INVALID_CRYPTO_MESSAGE_TYPE, _)); |
399 server_stream()->OnStreamFrame( | 399 server_stream()->OnStreamFrame( |
400 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, | 400 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, |
401 message_data_->AsStringPiece())); | 401 message_data_->AsStringPiece())); |
402 } | 402 } |
403 | 403 |
404 TEST_P(QuicCryptoServerStreamTest, ChannelID) { | 404 TEST_P(QuicCryptoServerStreamTest, ChannelID) { |
405 Initialize(); | 405 Initialize(); |
406 | 406 |
407 client_options_.channel_id_enabled = true; | 407 client_options_.channel_id_enabled = true; |
408 client_options_.channel_id_source_async = false; | 408 client_options_.channel_id_source_async = false; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 /*from_peer=*/true); | 511 /*from_peer=*/true); |
512 | 512 |
513 // The outstanding nonce verification RPC now completes. | 513 // The outstanding nonce verification RPC now completes. |
514 strike_register_client_->RunPendingVerifications(); | 514 strike_register_client_->RunPendingVerifications(); |
515 } | 515 } |
516 | 516 |
517 } // namespace | 517 } // namespace |
518 | 518 |
519 } // namespace test | 519 } // namespace test |
520 } // namespace net | 520 } // namespace net |
OLD | NEW |