#include "quiche/quic/core/qpack/qpack_decoder.h"
#include <algorithm>
#include <memory>
#include <string>
#include "absl/strings/escaping.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/qpack/qpack_decoder_test_utils.h"
#include "quiche/quic/test_tools/qpack/qpack_test_utils.h"
_;
Eq;
Invoke;
Mock;
Sequence;
StrictMock;
Values;
namespace quic {
namespace test {
namespace {
const char* const kHeaderAcknowledgement = …;
const uint64_t kMaximumDynamicTableCapacity = …;
const uint64_t kMaximumBlockedStreams = …;
class QpackDecoderTest : public QuicTestWithParam<FragmentMode> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(QpackDecoderTest, NoPrefix) { … }
TEST_P(QpackDecoderTest, InvalidPrefix) { … }
TEST_P(QpackDecoderTest, EmptyHeaderBlock) { … }
TEST_P(QpackDecoderTest, LiteralEntryEmptyName) { … }
TEST_P(QpackDecoderTest, LiteralEntryEmptyValue) { … }
TEST_P(QpackDecoderTest, LiteralEntryEmptyNameAndValue) { … }
TEST_P(QpackDecoderTest, SimpleLiteralEntry) { … }
TEST_P(QpackDecoderTest, MultipleLiteralEntries) { … }
TEST_P(QpackDecoderTest, NameLenTooLargeForVarintDecoder) { … }
TEST_P(QpackDecoderTest, NameLenExceedsLimit) { … }
TEST_P(QpackDecoderTest, ValueLenTooLargeForVarintDecoder) { … }
TEST_P(QpackDecoderTest, ValueLenExceedsLimit) { … }
TEST_P(QpackDecoderTest, LineFeedInValue) { … }
TEST_P(QpackDecoderTest, IncompleteHeaderBlock) { … }
TEST_P(QpackDecoderTest, HuffmanSimple) { … }
TEST_P(QpackDecoderTest, AlternatingHuffmanNonHuffman) { … }
TEST_P(QpackDecoderTest, HuffmanNameDoesNotHaveEOSPrefix) { … }
TEST_P(QpackDecoderTest, HuffmanValueDoesNotHaveEOSPrefix) { … }
TEST_P(QpackDecoderTest, HuffmanNameEOSPrefixTooLong) { … }
TEST_P(QpackDecoderTest, HuffmanValueEOSPrefixTooLong) { … }
TEST_P(QpackDecoderTest, StaticTable) { … }
TEST_P(QpackDecoderTest, TooHighStaticTableIndex) { … }
TEST_P(QpackDecoderTest, DynamicTable) { … }
TEST_P(QpackDecoderTest, DecreasingDynamicTableCapacityEvictsEntries) { … }
TEST_P(QpackDecoderTest, EncoderStreamErrorEntryTooLarge) { … }
TEST_P(QpackDecoderTest, EncoderStreamErrorInvalidStaticTableEntry) { … }
TEST_P(QpackDecoderTest, EncoderStreamErrorInvalidDynamicTableEntry) { … }
TEST_P(QpackDecoderTest, EncoderStreamErrorDuplicateInvalidEntry) { … }
TEST_P(QpackDecoderTest, EncoderStreamErrorTooLargeInteger) { … }
TEST_P(QpackDecoderTest, InvalidDynamicEntryWhenBaseIsZero) { … }
TEST_P(QpackDecoderTest, InvalidNegativeBase) { … }
TEST_P(QpackDecoderTest, InvalidDynamicEntryByRelativeIndex) { … }
TEST_P(QpackDecoderTest, EvictedDynamicTableEntry) { … }
TEST_P(QpackDecoderTest, TableCapacityMustNotExceedMaximum) { … }
TEST_P(QpackDecoderTest, SetDynamicTableCapacity) { … }
TEST_P(QpackDecoderTest, InvalidEncodedRequiredInsertCount) { … }
TEST_P(QpackDecoderTest, DataAfterInvalidEncodedRequiredInsertCount) { … }
TEST_P(QpackDecoderTest, WrappedRequiredInsertCount) { … }
TEST_P(QpackDecoderTest, NonZeroRequiredInsertCountButNoDynamicEntries) { … }
TEST_P(QpackDecoderTest, AddressEntryNotAllowedByRequiredInsertCount) { … }
TEST_P(QpackDecoderTest, PromisedRequiredInsertCountLargerThanActual) { … }
TEST_P(QpackDecoderTest, BlockedDecoding) { … }
TEST_P(QpackDecoderTest, BlockedDecodingUnblockedBeforeEndOfHeaderBlock) { … }
TEST_P(QpackDecoderTest,
BlockedDecodingUnblockedAndErrorBeforeEndOfHeaderBlock) { … }
TEST_P(QpackDecoderTest, BlockedDecodingAndEvictedEntries) { … }
TEST_P(QpackDecoderTest, TooManyBlockedStreams) { … }
TEST_P(QpackDecoderTest, InsertCountIncrement) { … }
}
}
}