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)14FragmentSizeGenerator 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