| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // ChannelIDSource for testing. Ignored if channel_id_enabled is false. | 79 // ChannelIDSource for testing. Ignored if channel_id_enabled is false. |
| 80 bool channel_id_source_async; | 80 bool channel_id_source_async; |
| 81 | 81 |
| 82 // If token_binding_enabled is true, then the client will attempt to | 82 // If token_binding_enabled is true, then the client will attempt to |
| 83 // negotiate Token Binding. | 83 // negotiate Token Binding. |
| 84 bool token_binding_enabled; | 84 bool token_binding_enabled; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 // returns: the number of client hellos that the client sent. | 87 // returns: the number of client hellos that the client sent. |
| 88 static int HandshakeWithFakeServer(MockConnectionHelper* helper, | 88 static int HandshakeWithFakeServer(MockConnectionHelper* helper, |
| 89 MockAlarmFactory* alarm_factory, |
| 89 PacketSavingConnection* client_conn, | 90 PacketSavingConnection* client_conn, |
| 90 QuicCryptoClientStream* client, | 91 QuicCryptoClientStream* client, |
| 91 const FakeServerOptions& options); | 92 const FakeServerOptions& options); |
| 92 | 93 |
| 93 // returns: the number of client hellos that the client sent. | 94 // returns: the number of client hellos that the client sent. |
| 94 static int HandshakeWithFakeClient(MockConnectionHelper* helper, | 95 static int HandshakeWithFakeClient(MockConnectionHelper* helper, |
| 96 |
| 97 MockAlarmFactory* alarm_factory, |
| 98 |
| 95 PacketSavingConnection* server_conn, | 99 PacketSavingConnection* server_conn, |
| 96 QuicCryptoServerStream* server, | 100 QuicCryptoServerStream* server, |
| 97 const QuicServerId& server_id, | 101 const QuicServerId& server_id, |
| 98 const FakeClientOptions& options); | 102 const FakeClientOptions& options); |
| 99 | 103 |
| 100 // SetupCryptoServerConfigForTest configures |config| and |crypto_config| | 104 // SetupCryptoServerConfigForTest configures |config| and |crypto_config| |
| 101 // with sensible defaults for testing. | 105 // with sensible defaults for testing. |
| 102 static void SetupCryptoServerConfigForTest( | 106 static void SetupCryptoServerConfigForTest( |
| 103 const QuicClock* clock, | 107 const QuicClock* clock, |
| 104 QuicRandom* rand, | 108 QuicRandom* rand, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 QuicCryptoServerStream* server); | 207 QuicCryptoServerStream* server); |
| 204 | 208 |
| 205 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 209 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
| 206 }; | 210 }; |
| 207 | 211 |
| 208 } // namespace test | 212 } // namespace test |
| 209 | 213 |
| 210 } // namespace net | 214 } // namespace net |
| 211 | 215 |
| 212 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 216 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| OLD | NEW |