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 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // If channel_id_enabled is true then the client will attempt to send a | 62 // If channel_id_enabled is true then the client will attempt to send a |
63 // ChannelID. | 63 // ChannelID. |
64 bool channel_id_enabled; | 64 bool channel_id_enabled; |
65 | 65 |
66 // If channel_id_source_async is true then the client will use an async | 66 // If channel_id_source_async is true then the client will use an async |
67 // ChannelIDSource for testing. Ignored if channel_id_enabled is false. | 67 // ChannelIDSource for testing. Ignored if channel_id_enabled is false. |
68 bool channel_id_source_async; | 68 bool channel_id_source_async; |
69 }; | 69 }; |
70 | 70 |
71 // returns: the number of client hellos that the client sent. | 71 // returns: the number of client hellos that the client sent. |
72 static int HandshakeWithFakeServer(MockHelper* helper, | 72 static int HandshakeWithFakeServer(MockConnectionHelper* helper, |
73 PacketSavingConnection* client_conn, | 73 PacketSavingConnection* client_conn, |
74 QuicCryptoClientStream* client); | 74 QuicCryptoClientStream* client); |
75 | 75 |
76 // returns: the number of client hellos that the client sent. | 76 // returns: the number of client hellos that the client sent. |
77 static int HandshakeWithFakeClient(MockHelper* helper, | 77 static int HandshakeWithFakeClient(MockConnectionHelper* helper, |
78 PacketSavingConnection* server_conn, | 78 PacketSavingConnection* server_conn, |
79 QuicCryptoServerStream* server, | 79 QuicCryptoServerStream* server, |
80 const QuicServerId& server_id, | 80 const QuicServerId& server_id, |
81 const FakeClientOptions& options); | 81 const FakeClientOptions& options); |
82 | 82 |
83 // SetupCryptoServerConfigForTest configures |config| and |crypto_config| | 83 // SetupCryptoServerConfigForTest configures |config| and |crypto_config| |
84 // with sensible defaults for testing. | 84 // with sensible defaults for testing. |
85 static void SetupCryptoServerConfigForTest( | 85 static void SetupCryptoServerConfigForTest( |
86 const QuicClock* clock, | 86 const QuicClock* clock, |
87 QuicRandom* rand, | 87 QuicRandom* rand, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 QuicCryptoServerStream* server); | 176 QuicCryptoServerStream* server); |
177 | 177 |
178 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 178 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
179 }; | 179 }; |
180 | 180 |
181 } // namespace test | 181 } // namespace test |
182 | 182 |
183 } // namespace net | 183 } // namespace net |
184 | 184 |
185 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 185 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
OLD | NEW |