chromium/net/third_party/quiche/src/quiche/quic/core/qpack/qpack_encoder_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_encoder.h"

#include <limits>
#include <string>

#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/qpack/qpack_instruction_encoder.h"
#include "quiche/quic/core/qpack/value_splitting_header_list.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/qpack/qpack_encoder_peer.h"
#include "quiche/quic/test_tools/qpack/qpack_test_utils.h"

_;
Eq;
Return;
StrictMock;

namespace quic {
namespace test {
namespace {

// A number larger than kMaxBytesBufferedByStream in
// qpack_encoder_stream_sender.cc.  Returning this value from NumBytesBuffered()
// will instruct QpackEncoder not to generate any instructions for the encoder
// stream.
constexpr uint64_t kTooManyBytesBuffered =;

std::string PrintToString(const testing::TestParamInfo<HuffmanEncoding>& info) {}

// Mock QpackEncoder::DecoderStreamErrorDelegate implementation.
class MockDecoderStreamErrorDelegate
    : public QpackEncoder::DecoderStreamErrorDelegate {};

class QpackEncoderTest : public QuicTestWithParam<HuffmanEncoding> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(QpackEncoderTest, Empty) {}

TEST_P(QpackEncoderTest, EmptyName) {}

TEST_P(QpackEncoderTest, EmptyValue) {}

TEST_P(QpackEncoderTest, EmptyNameAndValue) {}

TEST_P(QpackEncoderTest, Simple) {}

TEST_P(QpackEncoderTest, Multiple) {}

TEST_P(QpackEncoderTest, StaticTable) {}

TEST_P(QpackEncoderTest, DecoderStreamError) {}

TEST_P(QpackEncoderTest, SplitAlongNullCharacter) {}

TEST_P(QpackEncoderTest, ZeroInsertCountIncrement) {}

TEST_P(QpackEncoderTest, TooLargeInsertCountIncrement) {}

// Regression test for https://crbug.com/1014372.
TEST_P(QpackEncoderTest, InsertCountIncrementOverflow) {}

TEST_P(QpackEncoderTest, InvalidHeaderAcknowledgement) {}

TEST_P(QpackEncoderTest, DynamicTable) {}

// There is no room in the dynamic table after inserting the first entry.
TEST_P(QpackEncoderTest, SmallDynamicTable) {}

TEST_P(QpackEncoderTest, BlockedStream) {}

TEST_P(QpackEncoderTest, Draining) {}

TEST_P(QpackEncoderTest, DynamicTableCapacityLessThanMaximum) {}

TEST_P(QpackEncoderTest, EncoderStreamWritesDisallowedThenAllowed) {}

TEST_P(QpackEncoderTest, EncoderStreamWritesAllowedThenDisallowed) {}

// Regression test for https://crbug.com/1441880.
TEST_P(QpackEncoderTest, UnackedEntryCannotBeEvicted) {}

// Header name and value match an entry in the dynamic table, but that entry
// cannot be used. If there is an entry with matching name in the static table,
// use that.
TEST_P(QpackEncoderTest, UseStaticTableNameOnlyMatch) {}

// Header name and value match an entry in the dynamic table, but that entry
// cannot be used. If there is an entry with matching name in the dynamic table
// that can be used, do so.
TEST_P(QpackEncoderTest, UseDynamicTableNameOnlyMatch) {}

TEST_P(QpackEncoderTest, CookieCrumblingEnabledNoDynamicTable) {}

TEST_P(QpackEncoderTest, CookieCrumblingEnabledDynamicTable) {}

TEST_P(QpackEncoderTest, CookieCrumblingDisabledNoDynamicTable) {}

TEST_P(QpackEncoderTest, CookieCrumblingDisabledDynamicTable) {}

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