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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "crypto/secure_hash.h" | 7 #include "crypto/secure_hash.h" |
8 #include "net/quic/crypto/crypto_utils.h" | 8 #include "net/quic/crypto/crypto_utils.h" |
9 #include "net/quic/crypto/quic_crypto_server_config.h" | 9 #include "net/quic/crypto/quic_crypto_server_config.h" |
10 #include "net/quic/crypto/quic_random.h" | 10 #include "net/quic/crypto/quic_random.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 message, client_address_, &clock_, | 171 message, client_address_, &clock_, |
172 new ValidateCallback(this, false, error_substr, called)); | 172 new ValidateCallback(this, false, error_substr, called)); |
173 } | 173 } |
174 | 174 |
175 void ProcessValidationResult(const CryptoHandshakeMessage& message, | 175 void ProcessValidationResult(const CryptoHandshakeMessage& message, |
176 const ValidateCallback::Result& result, | 176 const ValidateCallback::Result& result, |
177 bool should_succeed, | 177 bool should_succeed, |
178 const char* error_substr) { | 178 const char* error_substr) { |
179 string error_details; | 179 string error_details; |
180 QuicErrorCode error = config_.ProcessClientHello( | 180 QuicErrorCode error = config_.ProcessClientHello( |
181 result, 1 /* GUID */, client_address_, | 181 result, 1 /* ConnectionId */, client_address_, |
182 supported_versions_.front(), supported_versions_, &clock_, rand_, | 182 supported_versions_.front(), supported_versions_, &clock_, rand_, |
183 ¶ms_, &out_, &error_details); | 183 ¶ms_, &out_, &error_details); |
184 | 184 |
185 if (should_succeed) { | 185 if (should_succeed) { |
186 ASSERT_EQ(error, QUIC_NO_ERROR) | 186 ASSERT_EQ(error, QUIC_NO_ERROR) |
187 << "Message failed with error " << error_details << ": " | 187 << "Message failed with error " << error_details << ": " |
188 << message.DebugString(); | 188 << message.DebugString(); |
189 } else { | 189 } else { |
190 ASSERT_NE(error, QUIC_NO_ERROR) | 190 ASSERT_NE(error, QUIC_NO_ERROR) |
191 << "Message didn't fail: " << message.DebugString(); | 191 << "Message didn't fail: " << message.DebugString(); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 502 |
503 strike_register_client_->RunPendingVerifications(); | 503 strike_register_client_->RunPendingVerifications(); |
504 ASSERT_TRUE(called); | 504 ASSERT_TRUE(called); |
505 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); | 505 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); |
506 // The message should be rejected now. | 506 // The message should be rejected now. |
507 EXPECT_EQ(kREJ, out_.tag()); | 507 EXPECT_EQ(kREJ, out_.tag()); |
508 } | 508 } |
509 | 509 |
510 } // namespace test | 510 } // namespace test |
511 } // namespace net | 511 } // namespace net |
OLD | NEW |