OLD | NEW |
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 #ifndef NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
6 #define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 6 #define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
7 | 7 |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 const FakeServerOptions& options); | 93 const FakeServerOptions& options); |
94 | 94 |
95 // returns: the number of client hellos that the client sent. | 95 // returns: the number of client hellos that the client sent. |
96 static int HandshakeWithFakeClient(MockQuicConnectionHelper* helper, | 96 static int HandshakeWithFakeClient(MockQuicConnectionHelper* helper, |
97 MockAlarmFactory* alarm_factory, | 97 MockAlarmFactory* alarm_factory, |
98 PacketSavingConnection* server_conn, | 98 PacketSavingConnection* server_conn, |
99 QuicCryptoServerStream* server, | 99 QuicCryptoServerStream* server, |
100 const QuicServerId& server_id, | 100 const QuicServerId& server_id, |
101 const FakeClientOptions& options); | 101 const FakeClientOptions& options); |
102 | 102 |
103 // SetupCryptoServerConfigForTest configures |config| and |crypto_config| | 103 // SetupCryptoServerConfigForTest configures |crypto_config| |
104 // with sensible defaults for testing. | 104 // with sensible defaults for testing. |
105 static void SetupCryptoServerConfigForTest( | 105 static void SetupCryptoServerConfigForTest( |
106 const QuicClock* clock, | 106 const QuicClock* clock, |
107 QuicRandom* rand, | 107 QuicRandom* rand, |
108 QuicConfig* config, | |
109 QuicCryptoServerConfig* crypto_config, | 108 QuicCryptoServerConfig* crypto_config, |
110 const FakeServerOptions& options); | 109 const FakeServerOptions& options); |
111 | 110 |
112 // CommunicateHandshakeMessages moves messages from |client| to |server| and | 111 // CommunicateHandshakeMessages moves messages from |client| to |server| and |
113 // back until |clients|'s handshake has completed. | 112 // back until |clients|'s handshake has completed. |
114 static void CommunicateHandshakeMessages(PacketSavingConnection* client_conn, | 113 static void CommunicateHandshakeMessages(PacketSavingConnection* client_conn, |
115 QuicCryptoStream* client, | 114 QuicCryptoStream* client, |
116 PacketSavingConnection* server_conn, | 115 PacketSavingConnection* server_conn, |
117 QuicCryptoStream* server); | 116 QuicCryptoStream* server); |
118 | 117 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 static std::string GenerateClientPublicValuesHex(); | 235 static std::string GenerateClientPublicValuesHex(); |
237 | 236 |
238 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 237 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
239 }; | 238 }; |
240 | 239 |
241 } // namespace test | 240 } // namespace test |
242 | 241 |
243 } // namespace net | 242 } // namespace net |
244 | 243 |
245 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 244 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
OLD | NEW |