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

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

Issue 14083012: QUIC: retransmit packets with the correct encryption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 CryptoHandshakeMessage message_; 108 CryptoHandshakeMessage message_;
109 scoped_ptr<QuicData> message_data_; 109 scoped_ptr<QuicData> message_data_;
110 }; 110 };
111 111
112 TEST_F(QuicCryptoServerStreamTest, NotInitiallyConected) { 112 TEST_F(QuicCryptoServerStreamTest, NotInitiallyConected) {
113 if (!Aes128GcmEncrypter::IsSupported()) { 113 if (!Aes128GcmEncrypter::IsSupported()) {
114 LOG(INFO) << "AES GCM not supported. Test skipped."; 114 LOG(INFO) << "AES GCM not supported. Test skipped.";
115 return; 115 return;
116 } 116 }
117 117
118 EXPECT_FALSE(stream_.handshake_complete()); 118 EXPECT_FALSE(stream_.encryption_established());
119 EXPECT_FALSE(stream_.handshake_confirmed());
119 } 120 }
120 121
121 TEST_F(QuicCryptoServerStreamTest, ConnectedAfterCHLO) { 122 TEST_F(QuicCryptoServerStreamTest, ConnectedAfterCHLO) {
122 if (!Aes128GcmEncrypter::IsSupported()) { 123 if (!Aes128GcmEncrypter::IsSupported()) {
123 LOG(INFO) << "AES GCM not supported. Test skipped."; 124 LOG(INFO) << "AES GCM not supported. Test skipped.";
124 return; 125 return;
125 } 126 }
126 127
127 // CompleteCryptoHandshake returns the number of client hellos sent. This 128 // CompleteCryptoHandshake returns the number of client hellos sent. This
128 // test should send: 129 // test should send:
129 // * One to get a source-address token. 130 // * One to get a source-address token.
130 // * One to get the server's certificates 131 // * One to get the server's certificates
131 // * One to complete the handshake. 132 // * One to complete the handshake.
132 EXPECT_EQ(3, CompleteCryptoHandshake()); 133 // TODO(rtenneti): After ProofVerifier is enabled, change the check for
133 EXPECT_TRUE(stream_.handshake_complete()); 134 // CompleteCryptoHandshake() from 2 to 3.
wtc 2013/04/25 00:39:19 Could you explain (not in this TODO comment) why t
ramant (doing other things) 2013/04/26 19:29:54 Done.
135 EXPECT_EQ(2, CompleteCryptoHandshake());
136 EXPECT_TRUE(stream_.encryption_established());
137 EXPECT_TRUE(stream_.handshake_confirmed());
134 } 138 }
135 139
136 TEST_F(QuicCryptoServerStreamTest, ZeroRTT) { 140 TEST_F(QuicCryptoServerStreamTest, ZeroRTT) {
137 if (!Aes128GcmEncrypter::IsSupported()) { 141 if (!Aes128GcmEncrypter::IsSupported()) {
138 LOG(INFO) << "AES GCM not supported. Test skipped."; 142 LOG(INFO) << "AES GCM not supported. Test skipped.";
139 return; 143 return;
140 } 144 }
141 145
142 QuicGuid guid(1); 146 QuicGuid guid(1);
143 IPAddressNumber ip; 147 IPAddressNumber ip;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 message_.set_tag(kSHLO); 231 message_.set_tag(kSHLO);
228 ConstructHandshakeMessage(); 232 ConstructHandshakeMessage();
229 EXPECT_CALL(*connection_, SendConnectionClose( 233 EXPECT_CALL(*connection_, SendConnectionClose(
230 QUIC_INVALID_CRYPTO_MESSAGE_TYPE)); 234 QUIC_INVALID_CRYPTO_MESSAGE_TYPE));
231 stream_.ProcessData(message_data_->data(), message_data_->length()); 235 stream_.ProcessData(message_data_->data(), message_data_->length());
232 } 236 }
233 237
234 } // namespace 238 } // namespace
235 } // namespace test 239 } // namespace test
236 } // namespace net 240 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698