chromium/net/spdy/alps_decoder_test.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/spdy/alps_decoder.h"

#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "net/base/features.h"
#include "net/base/hex_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

AcceptChOriginValuePair;
ElementsAre;
IsEmpty;
Pair;

namespace net {
namespace {

TEST(AlpsDecoderTest, EmptyInput) {}

TEST(AlpsDecoderTest, EmptyAcceptChFrame) {}

TEST(AlpsDecoderTest, EmptySettingsFrame) {}

TEST(AlpsDecoderTest, ParseSettingsAndAcceptChFrames) {}

TEST(AlpsDecoderTest, ParseLargeAcceptChFrame) {}

TEST(AlpsDecoderTest, DisableAlpsParsing) {}

TEST(AlpsDecoderTest, DisableAlpsClientHintParsing) {}

TEST(AlpsDecoderTest, IncompleteFrame) {}

TEST(AlpsDecoderTest, TwoSettingsFrames) {}

TEST(AlpsDecoderTest, AcceptChOnInvalidStream) {}

// According to
// https://davidben.github.io/http-client-hint-reliability/ \
// draft-davidben-http-client-hint-reliability.html#name-http-2-accept_ch-frame
// "If a user agent receives an ACCEPT_CH frame whose stream [...] flags
// field is non-zero, it MUST respond with a connection error [...]."
TEST(AlpsDecoderTest, AcceptChWithInvalidFlags) {}

TEST(AlpsDecoderTest, SettingsOnInvalidStream) {}

TEST(AlpsDecoderTest, SettingsAck) {}

// According to https://httpwg.org/specs/rfc7540.html#FrameHeader:
// "Flags that have no defined semantics for a particular frame type MUST be
// ignored [...]"
TEST(AlpsDecoderTest, SettingsWithInvalidFlags) {}

TEST(AlpsDecoderTest, ForbiddenFrame) {}

TEST(AlpsDecoderTest, UnknownFrame) {}

class AlpsDecoderTestWithFeature : public ::testing::TestWithParam<bool> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(AlpsDecoderTestWithFeature, MalformedAcceptChFrame) {}

}  // namespace
}  // namespace net