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 <string> | 10 #include <string> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // Returns the length of a QuicPacket that is capable of holding either a | 49 // Returns the length of a QuicPacket that is capable of holding either a |
50 // stream frame or a minimal ack frame. Sets |*payload_length| to the number | 50 // stream frame or a minimal ack frame. Sets |*payload_length| to the number |
51 // of bytes of stream data that will fit in such a packet. | 51 // of bytes of stream data that will fit in such a packet. |
52 size_t GetPacketLengthForOneStream( | 52 size_t GetPacketLengthForOneStream( |
53 QuicVersion version, | 53 QuicVersion version, |
54 bool include_version, | 54 bool include_version, |
55 QuicSequenceNumberLength sequence_number_length, | 55 QuicSequenceNumberLength sequence_number_length, |
56 InFecGroup is_in_fec_group, | 56 InFecGroup is_in_fec_group, |
57 size_t* payload_length); | 57 size_t* payload_length); |
58 | 58 |
59 // Size in bytes of the stream frame fields for an arbitrary StreamID and | |
60 // offset and the last frame in a packet. | |
61 size_t GetMinStreamFrameSize(QuicVersion version); | |
62 | |
63 // Returns QuicConfig set to default values. | 59 // Returns QuicConfig set to default values. |
64 QuicConfig DefaultQuicConfig(); | 60 QuicConfig DefaultQuicConfig(); |
65 | 61 |
66 // Returns a version vector consisting of |version|. | 62 // Returns a version vector consisting of |version|. |
67 QuicVersionVector SupportedVersions(QuicVersion version); | 63 QuicVersionVector SupportedVersions(QuicVersion version); |
68 | 64 |
69 template<typename SaveType> | 65 template<typename SaveType> |
70 class ValueRestore { | 66 class ValueRestore { |
71 public: | 67 public: |
72 ValueRestore(SaveType* name, SaveType value) | 68 ValueRestore(SaveType* name, SaveType value) |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 MockAckNotifierDelegate(); | 459 MockAckNotifierDelegate(); |
464 virtual ~MockAckNotifierDelegate(); | 460 virtual ~MockAckNotifierDelegate(); |
465 | 461 |
466 MOCK_METHOD0(OnAckNotification, void()); | 462 MOCK_METHOD0(OnAckNotification, void()); |
467 }; | 463 }; |
468 | 464 |
469 } // namespace test | 465 } // namespace test |
470 } // namespace net | 466 } // namespace net |
471 | 467 |
472 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 468 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |