| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/test_tools/mock_crypto_client_stream.h" | 5 #include "net/quic/test_tools/mock_crypto_client_stream.h" |
| 6 | 6 |
| 7 #include "net/quic/core/crypto/null_decrypter.h" | 7 #include "net/quic/core/crypto/null_decrypter.h" |
| 8 #include "net/quic/core/crypto/null_encrypter.h" | 8 #include "net/quic/core/crypto/null_encrypter.h" |
| 9 #include "net/quic/core/crypto/quic_decrypter.h" | 9 #include "net/quic/core/crypto/quic_decrypter.h" |
| 10 #include "net/quic/core/crypto/quic_encrypter.h" | 10 #include "net/quic/core/crypto/quic_encrypter.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ENCRYPTION_FORWARD_SECURE); | 93 ENCRYPTION_FORWARD_SECURE); |
| 94 session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED); | 94 session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED); |
| 95 break; | 95 break; |
| 96 } | 96 } |
| 97 | 97 |
| 98 case COLD_START: { | 98 case COLD_START: { |
| 99 handshake_confirmed_ = false; | 99 handshake_confirmed_ = false; |
| 100 encryption_established_ = false; | 100 encryption_established_ = false; |
| 101 break; | 101 break; |
| 102 } | 102 } |
| 103 |
| 104 case USE_DEFAULT_CRYPTO_STREAM: { |
| 105 NOTREACHED(); |
| 106 break; |
| 107 } |
| 103 } | 108 } |
| 104 } | 109 } |
| 105 | 110 |
| 106 void MockCryptoClientStream::SendOnCryptoHandshakeEvent( | 111 void MockCryptoClientStream::SendOnCryptoHandshakeEvent( |
| 107 QuicSession::CryptoHandshakeEvent event) { | 112 QuicSession::CryptoHandshakeEvent event) { |
| 108 encryption_established_ = true; | 113 encryption_established_ = true; |
| 109 if (event == QuicSession::HANDSHAKE_CONFIRMED) { | 114 if (event == QuicSession::HANDSHAKE_CONFIRMED) { |
| 110 handshake_confirmed_ = true; | 115 handshake_confirmed_ = true; |
| 111 SetConfigNegotiated(); | 116 SetConfigNegotiated(); |
| 112 session()->connection()->SetDecrypter( | 117 session()->connection()->SetDecrypter( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 141 config.ToHandshakeMessage(&msg); | 146 config.ToHandshakeMessage(&msg); |
| 142 string error_details; | 147 string error_details; |
| 143 const QuicErrorCode error = | 148 const QuicErrorCode error = |
| 144 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); | 149 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); |
| 145 ASSERT_EQ(QUIC_NO_ERROR, error); | 150 ASSERT_EQ(QUIC_NO_ERROR, error); |
| 146 ASSERT_TRUE(session()->config()->negotiated()); | 151 ASSERT_TRUE(session()->config()->negotiated()); |
| 147 session()->OnConfigNegotiated(); | 152 session()->OnConfigNegotiated(); |
| 148 } | 153 } |
| 149 | 154 |
| 150 } // namespace net | 155 } // namespace net |
| OLD | NEW |