chromium/net/third_party/quiche/src/quiche/http2/http2_structures_test.cc

// Copyright 2016 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/http2/http2_structures.h"

// Tests are focused on Http2FrameHeader because it has by far the most
// methods of any of the structures.
// Note that EXPECT.*DEATH tests are slow (a fork is probably involved).

// And in case you're wondering, yes, these are ridiculously thorough tests,
// but believe it or not, I've found silly bugs this way.

#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <vector>

#include "absl/strings/str_cat.h"
#include "quiche/http2/test_tools/http2_random.h"
#include "quiche/http2/test_tools/http2_structures_test_util.h"
#include "quiche/http2/test_tools/verify_macros.h"
#include "quiche/common/platform/api/quiche_test.h"

AssertionResult;
AssertionSuccess;
Combine;
HasSubstr;
MatchesRegex;
Not;
Values;
ValuesIn;

namespace http2 {
namespace test {
namespace {

template <typename E>
E IncrementEnum(E e) {}

template <class T>
AssertionResult VerifyRandomCalls() {}

#if GTEST_HAS_DEATH_TEST && !defined(NDEBUG)
std::vector<Http2FrameType> ValidFrameTypes() {}
#endif  // GTEST_HAS_DEATH_TEST && !defined(NDEBUG)

TEST(Http2FrameHeaderTest, Constructor) {}

TEST(Http2FrameHeaderTest, Eq) {}

#if GTEST_HAS_DEATH_TEST && !defined(NDEBUG)

TestParams;

std::string TestParamToString(const testing::TestParamInfo<TestParams>& info) {}

// The tests of the valid frame types include EXPECT_QUICHE_DEBUG_DEATH, which
// is quite slow, so using value parameterized tests in order to allow sharding.
class Http2FrameHeaderTypeAndFlagTest
    : public quiche::test::QuicheTestWithParam<TestParams> {};

class IsEndStreamTest : public Http2FrameHeaderTypeAndFlagTest {};
INSTANTIATE_TEST_SUITE_P();
TEST_P(IsEndStreamTest, IsEndStream) {}

class IsACKTest : public Http2FrameHeaderTypeAndFlagTest {};
INSTANTIATE_TEST_SUITE_P();
TEST_P(IsACKTest, IsAck) {}

class IsEndHeadersTest : public Http2FrameHeaderTypeAndFlagTest {};
INSTANTIATE_TEST_SUITE_P();
TEST_P(IsEndHeadersTest, IsEndHeaders) {}

class IsPaddedTest : public Http2FrameHeaderTypeAndFlagTest {};
INSTANTIATE_TEST_SUITE_P();
TEST_P(IsPaddedTest, IsPadded) {}

class HasPriorityTest : public Http2FrameHeaderTypeAndFlagTest {};
INSTANTIATE_TEST_SUITE_P();
TEST_P(HasPriorityTest, HasPriority) {}

TEST(Http2PriorityFieldsTest, Constructor) {}
#endif  // GTEST_HAS_DEATH_TEST && !defined(NDEBUG)

TEST(Http2RstStreamFieldsTest, IsSupported) {}

TEST(Http2SettingFieldsTest, Misc) {}

TEST(Http2PushPromiseTest, Misc) {}

TEST(Http2PingFieldsTest, Misc) {}

TEST(Http2GoAwayFieldsTest, Misc) {}

TEST(Http2WindowUpdateTest, Misc) {}

TEST(Http2AltSvcTest, Misc) {}

TEST(Http2PriorityUpdateFieldsTest, Eq) {}

TEST(Http2PriorityUpdateFieldsTest, Misc) {}

}  // namespace
}  // namespace test
}  // namespace http2