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 <ostream> | 5 #include <ostream> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "crypto/secure_hash.h" | 10 #include "crypto/secure_hash.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 const char* error_substr, | 149 const char* error_substr, |
150 bool* called) | 150 bool* called) |
151 : test_(test), | 151 : test_(test), |
152 should_succeed_(should_succeed), | 152 should_succeed_(should_succeed), |
153 error_substr_(error_substr), | 153 error_substr_(error_substr), |
154 called_(called) { | 154 called_(called) { |
155 *called_ = false; | 155 *called_ = false; |
156 } | 156 } |
157 | 157 |
158 virtual void RunImpl(const CryptoHandshakeMessage& client_hello, | 158 virtual void RunImpl(const CryptoHandshakeMessage& client_hello, |
159 const Result& result) OVERRIDE { | 159 const Result& result) override { |
160 { | 160 { |
161 // Ensure that the strike register client lock is not held. | 161 // Ensure that the strike register client lock is not held. |
162 QuicCryptoServerConfigPeer peer(&test_->config_); | 162 QuicCryptoServerConfigPeer peer(&test_->config_); |
163 base::Lock* m = peer.GetStrikeRegisterClientLock(); | 163 base::Lock* m = peer.GetStrikeRegisterClientLock(); |
164 // In Chromium, we will dead lock if the lock is held by the current | 164 // In Chromium, we will dead lock if the lock is held by the current |
165 // thread. Chromium doesn't have AssertNotHeld API call. | 165 // thread. Chromium doesn't have AssertNotHeld API call. |
166 // m->AssertNotHeld(); | 166 // m->AssertNotHeld(); |
167 base::AutoLock lock(*m); | 167 base::AutoLock lock(*m); |
168 } | 168 } |
169 ASSERT_FALSE(*called_); | 169 ASSERT_FALSE(*called_); |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 | 718 |
719 strike_register_client_->RunPendingVerifications(); | 719 strike_register_client_->RunPendingVerifications(); |
720 ASSERT_TRUE(called); | 720 ASSERT_TRUE(called); |
721 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); | 721 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); |
722 // The message should be rejected now. | 722 // The message should be rejected now. |
723 EXPECT_EQ(kREJ, out_.tag()); | 723 EXPECT_EQ(kREJ, out_.tag()); |
724 } | 724 } |
725 | 725 |
726 } // namespace test | 726 } // namespace test |
727 } // namespace net | 727 } // namespace net |
OLD | NEW |