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 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
6 | 6 |
7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 QuicPacketNumberLength packet_number_length, | 160 QuicPacketNumberLength packet_number_length, |
161 QuicVersionVector* versions, | 161 QuicVersionVector* versions, |
162 Perspective perspective); | 162 Perspective perspective); |
163 | 163 |
164 void CompareCharArraysWithHexError(const std::string& description, | 164 void CompareCharArraysWithHexError(const std::string& description, |
165 const char* actual, | 165 const char* actual, |
166 const int actual_len, | 166 const int actual_len, |
167 const char* expected, | 167 const char* expected, |
168 const int expected_len); | 168 const int expected_len); |
169 | 169 |
170 bool DecodeHexString(const StringPiece& hex, std::string* bytes); | |
171 | |
172 // Returns the length of a QuicPacket that is capable of holding either a | 170 // Returns the length of a QuicPacket that is capable of holding either a |
173 // stream frame or a minimal ack frame. Sets |*payload_length| to the number | 171 // stream frame or a minimal ack frame. Sets |*payload_length| to the number |
174 // of bytes of stream data that will fit in such a packet. | 172 // of bytes of stream data that will fit in such a packet. |
175 size_t GetPacketLengthForOneStream(QuicVersion version, | 173 size_t GetPacketLengthForOneStream(QuicVersion version, |
176 bool include_version, | 174 bool include_version, |
177 bool include_path_id, | 175 bool include_path_id, |
178 bool include_diversification_nonce, | 176 bool include_diversification_nonce, |
179 QuicConnectionIdLength connection_id_length, | 177 QuicConnectionIdLength connection_id_length, |
180 QuicPacketNumberLength packet_number_length, | 178 QuicPacketNumberLength packet_number_length, |
181 size_t* payload_length); | 179 size_t* payload_length); |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 iov->iov_base = const_cast<char*>(str.data()); | 1058 iov->iov_base = const_cast<char*>(str.data()); |
1061 iov->iov_len = static_cast<size_t>(str.size()); | 1059 iov->iov_len = static_cast<size_t>(str.size()); |
1062 QuicIOVector quic_iov(iov, 1, str.size()); | 1060 QuicIOVector quic_iov(iov, 1, str.size()); |
1063 return quic_iov; | 1061 return quic_iov; |
1064 } | 1062 } |
1065 | 1063 |
1066 } // namespace test | 1064 } // namespace test |
1067 } // namespace net | 1065 } // namespace net |
1068 | 1066 |
1069 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 1067 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |