chromium/net/third_party/quiche/src/quiche/quic/core/qpack/qpack_decoder_test.cc

// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Header Acknowledgement decoder stream instruction with stream_id = 1.
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) {}

// Regression test for https://1025209: QpackProgressiveDecoder must not crash
// in Decode() if it is destroyed by handler_.OnDecodingErrorDetected().
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) {}

// Name Length value is too large for varint decoder to decode.
TEST_P(QpackDecoderTest, NameLenTooLargeForVarintDecoder) {}

// Name Length value can be decoded by varint decoder but exceeds 1 MB limit.
TEST_P(QpackDecoderTest, NameLenExceedsLimit) {}

// Value Length value is too large for varint decoder to decode.
TEST_P(QpackDecoderTest, ValueLenTooLargeForVarintDecoder) {}

// Value Length value can be decoded by varint decoder but exceeds 1 MB limit.
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) {}

// Regression test for https://crbug.com/970218:  Decoder must stop processing
// after a Header Block Prefix with an invalid Encoded Required Insert Count.
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) {}

// Regression test for https://crbug.com/1024263.
TEST_P(QpackDecoderTest,
       BlockedDecodingUnblockedAndErrorBeforeEndOfHeaderBlock) {}

// Make sure that Required Insert Count is compared to Insert Count,
// not size of dynamic table.
TEST_P(QpackDecoderTest, BlockedDecodingAndEvictedEntries) {}

TEST_P(QpackDecoderTest, TooManyBlockedStreams) {}

TEST_P(QpackDecoderTest, InsertCountIncrement) {}

}  // namespace
}  // namespace test
}  // namespace quic