| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 static CryptoHandshakeMessage Message(const char* message_tag, ...); | 126 static CryptoHandshakeMessage Message(const char* message_tag, ...); |
| 127 | 127 |
| 128 // BuildMessage is the same as |Message|, but takes the variable arguments | 128 // BuildMessage is the same as |Message|, but takes the variable arguments |
| 129 // explicitly. TODO(rtenneti): Investigate whether it'd be better for | 129 // explicitly. TODO(rtenneti): Investigate whether it'd be better for |
| 130 // Message() and BuildMessage() to return a CryptoHandshakeMessage* pointer | 130 // Message() and BuildMessage() to return a CryptoHandshakeMessage* pointer |
| 131 // instead, to avoid copying the return value. | 131 // instead, to avoid copying the return value. |
| 132 static CryptoHandshakeMessage BuildMessage(const char* message_tag, | 132 static CryptoHandshakeMessage BuildMessage(const char* message_tag, |
| 133 va_list ap); | 133 va_list ap); |
| 134 | 134 |
| 135 // ChannelIDSourceForTesting returns a ChannelIDSource that generates keys | 135 // ChannelIDSourceForTesting returns a ChannelIDSource that generates keys |
| 136 // deterministically based on the hostname given in the GetChannelID call. | 136 // deterministically based on the hostname given in the GetChannelIDKey call. |
| 137 // This ChannelIDSource works in synchronous mode, i.e., its GetChannelIDKey |
| 138 // method never returns QUIC_PENDING. |
| 137 static ChannelIDSource* ChannelIDSourceForTesting(); | 139 static ChannelIDSource* ChannelIDSourceForTesting(); |
| 138 | 140 |
| 139 private: | 141 private: |
| 140 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, | 142 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, |
| 141 QuicCryptoServerStream* server); | 143 QuicCryptoServerStream* server); |
| 142 | 144 |
| 143 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 145 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 } // namespace test | 148 } // namespace test |
| 147 | 149 |
| 148 } // namespace net | 150 } // namespace net |
| 149 | 151 |
| 150 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 152 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| OLD | NEW |