OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "net/quic/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
11 #include "net/quic/crypto/crypto_handshake_message.h" | 11 #include "net/quic/crypto/crypto_handshake_message.h" |
12 #include "net/quic/crypto/crypto_secret_boxer.h" | 12 #include "net/quic/crypto/crypto_secret_boxer.h" |
13 #include "net/quic/crypto/crypto_server_config_protobuf.h" | 13 #include "net/quic/crypto/crypto_server_config_protobuf.h" |
14 #include "net/quic/crypto/quic_random.h" | 14 #include "net/quic/crypto/quic_random.h" |
15 #include "net/quic/crypto/strike_register_client.h" | 15 #include "net/quic/crypto/strike_register_client.h" |
16 #include "net/quic/quic_flags.h" | 16 #include "net/quic/quic_flags.h" |
17 #include "net/quic/quic_time.h" | 17 #include "net/quic/quic_time.h" |
18 #include "net/quic/test_tools/mock_clock.h" | 18 #include "net/quic/test_tools/mock_clock.h" |
19 #include "net/quic/test_tools/quic_test_utils.h" | 19 #include "net/quic/test_tools/quic_test_utils.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 using base::StringPiece; | 23 using base::StringPiece; |
24 using std::make_pair; | |
25 using std::map; | 24 using std::map; |
26 using std::pair; | 25 using std::pair; |
27 using std::string; | 26 using std::string; |
28 using std::vector; | 27 using std::vector; |
29 | 28 |
30 namespace net { | 29 namespace net { |
31 namespace test { | 30 namespace test { |
32 | 31 |
33 class QuicCryptoServerConfigPeer { | 32 class QuicCryptoServerConfigPeer { |
34 public: | 33 public: |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 server_config_id = va_arg(ap, const char*); | 144 server_config_id = va_arg(ap, const char*); |
146 } | 145 } |
147 | 146 |
148 if (!server_config_id) { | 147 if (!server_config_id) { |
149 break; | 148 break; |
150 } | 149 } |
151 | 150 |
152 // varargs will promote the value to an int so we have to read that from | 151 // varargs will promote the value to an int so we have to read that from |
153 // the stack and cast down. | 152 // the stack and cast down. |
154 const bool is_primary = static_cast<bool>(va_arg(ap, int)); | 153 const bool is_primary = static_cast<bool>(va_arg(ap, int)); |
155 expected.push_back(make_pair(server_config_id, is_primary)); | 154 expected.push_back(std::make_pair(server_config_id, is_primary)); |
156 } | 155 } |
157 | 156 |
158 va_end(ap); | 157 va_end(ap); |
159 | 158 |
160 base::AutoLock locked(server_config_->configs_lock_); | 159 base::AutoLock locked(server_config_->configs_lock_); |
161 | 160 |
162 ASSERT_EQ(expected.size(), server_config_->configs_.size()) | 161 ASSERT_EQ(expected.size(), server_config_->configs_.size()) |
163 << ConfigsDebug(); | 162 << ConfigsDebug(); |
164 | 163 |
165 for (QuicCryptoServerConfig::ConfigMap::const_iterator | 164 for (QuicCryptoServerConfig::ConfigMap::const_iterator |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 nullptr); | 914 nullptr); |
916 test_peer_.CheckConfigs( | 915 test_peer_.CheckConfigs( |
917 "a", false, | 916 "a", false, |
918 "b", true, | 917 "b", true, |
919 "c", false, | 918 "c", false, |
920 nullptr); | 919 nullptr); |
921 } | 920 } |
922 | 921 |
923 } // namespace test | 922 } // namespace test |
924 } // namespace net | 923 } // namespace net |
OLD | NEW |