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

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

Issue 380543003: Add an async ChannelIDSource for testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do work after moving packets. Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/quic/test_tools/crypto_test_utils.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 <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
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
OLDNEW
« no previous file with comments | « no previous file | net/quic/test_tools/crypto_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698