xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/test_tools/qpack/qpack_test_utils.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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 #include "quiche/quic/test_tools/qpack/qpack_test_utils.h"
6 
7 #include <limits>
8 
9 #include "quiche/quic/platform/api/quic_bug_tracker.h"
10 
11 namespace quic {
12 namespace test {
13 
FragmentModeToFragmentSizeGenerator(FragmentMode fragment_mode)14 FragmentSizeGenerator FragmentModeToFragmentSizeGenerator(
15     FragmentMode fragment_mode) {
16   switch (fragment_mode) {
17     case FragmentMode::kSingleChunk:
18       return []() { return std::numeric_limits<size_t>::max(); };
19     case FragmentMode::kOctetByOctet:
20       return []() { return 1; };
21   }
22   QUIC_BUG(quic_bug_10259_1)
23       << "Unknown FragmentMode " << static_cast<int>(fragment_mode);
24   return []() { return 0; };
25 }
26 
27 }  // namespace test
28 }  // namespace quic
29