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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 // Only 2 client hellos need to be sent in the no-certs case: one to get the | 249 // Only 2 client hellos need to be sent in the no-certs case: one to get the |
250 // source-address token and the second to finish. | 250 // source-address token and the second to finish. |
251 EXPECT_EQ(2, CompleteCryptoHandshake()); | 251 EXPECT_EQ(2, CompleteCryptoHandshake()); |
252 EXPECT_TRUE(stream_.encryption_established()); | 252 EXPECT_TRUE(stream_.encryption_established()); |
253 EXPECT_TRUE(stream_.handshake_confirmed()); | 253 EXPECT_TRUE(stream_.handshake_confirmed()); |
254 } | 254 } |
255 | 255 |
256 TEST_P(QuicCryptoServerStreamTest, ChannelID) { | 256 TEST_P(QuicCryptoServerStreamTest, ChannelID) { |
257 client_options_.channel_id_enabled = true; | 257 client_options_.channel_id_enabled = true; |
| 258 client_options_.channel_id_source_async = false; |
258 // CompleteCryptoHandshake verifies | 259 // CompleteCryptoHandshake verifies |
259 // stream_.crypto_negotiated_params().channel_id is correct. | 260 // stream_.crypto_negotiated_params().channel_id is correct. |
260 EXPECT_EQ(2, CompleteCryptoHandshake()); | 261 EXPECT_EQ(2, CompleteCryptoHandshake()); |
| 262 EXPECT_TRUE(stream_.encryption_established()); |
| 263 EXPECT_TRUE(stream_.handshake_confirmed()); |
| 264 } |
| 265 |
| 266 TEST_P(QuicCryptoServerStreamTest, ChannelIDAsync) { |
| 267 client_options_.channel_id_enabled = true; |
| 268 client_options_.channel_id_source_async = true; |
| 269 // CompleteCryptoHandshake verifies |
| 270 // stream_.crypto_negotiated_params().channel_id is correct. |
| 271 EXPECT_EQ(2, CompleteCryptoHandshake()); |
261 EXPECT_TRUE(stream_.encryption_established()); | 272 EXPECT_TRUE(stream_.encryption_established()); |
262 EXPECT_TRUE(stream_.handshake_confirmed()); | 273 EXPECT_TRUE(stream_.handshake_confirmed()); |
263 } | 274 } |
264 | 275 |
265 } // namespace | 276 } // namespace |
266 } // namespace test | 277 } // namespace test |
267 } // namespace net | 278 } // namespace net |
OLD | NEW |