QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef QUICHE_QUIC_CORE_QPACK_QPACK_TEST_UTILS_H_ |
| 6 | #define QUICHE_QUIC_CORE_QPACK_QPACK_TEST_UTILS_H_ |
| 7 | |
| 8 | #include <cstddef> |
| 9 | #include <functional> |
| 10 | |
| 11 | namespace quic { |
| 12 | namespace test { |
| 13 | |
| 14 | // Called repeatedly to determine the size of each fragment when encoding or |
| 15 | // decoding. Must return a positive value. |
| 16 | using FragmentSizeGenerator = std::function<size_t()>; |
| 17 | |
| 18 | enum class FragmentMode { |
| 19 | kSingleChunk, |
| 20 | kOctetByOctet, |
| 21 | }; |
| 22 | |
| 23 | FragmentSizeGenerator FragmentModeToFragmentSizeGenerator( |
| 24 | FragmentMode fragment_mode); |
| 25 | |
| 26 | } // namespace test |
| 27 | } // namespace quic |
| 28 | |
| 29 | #endif // QUICHE_QUIC_CORE_QPACK_QPACK_TEST_UTILS_H_ |