chromium/net/spdy/spdy_http_utils_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "net/spdy/spdy_http_utils.h"

#include <stdint.h>

#include <limits>

#include "base/test/gmock_expected_support.h"
#include "base/test/scoped_feature_list.h"
#include "net/base/features.h"
#include "net/base/ip_endpoint.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_headers_test_util.h"
#include "net/http/http_response_info.h"
#include "net/third_party/quiche/src/quiche/common/http/http_header_block.h"
#include "net/third_party/quiche/src/quiche/http2/test_tools/spdy_test_utils.h"
#include "net/third_party/quiche/src/quiche/spdy/core/spdy_framer.h"
#include "net/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace net {

namespace {

Values;

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

INSTANTIATE_TEST_SUITE_P();

// Check that the headers are ordered correctly, with pseudo-headers
// preceding HTTP headers per
// https://datatracker.ietf.org/doc/html/rfc9114#section-4.3
void CheckOrdering(const quiche::HttpHeaderBlock& headers) {}

TEST(SpdyHttpUtilsTest, ConvertRequestPriorityToSpdy3Priority) {}

TEST(SpdyHttpUtilsTest, ConvertSpdy3PriorityToRequestPriority) {}

TEST_P(SpdyHttpUtilsTestParam, CreateSpdyHeadersFromHttpRequestHTTP2) {}

TEST_P(SpdyHttpUtilsTestParam,
       CreateSpdyHeadersFromHttpRequestForExtendedConnect) {}

TEST_P(SpdyHttpUtilsTestParam, CreateSpdyHeadersWithDefaultPriority) {}

TEST_P(SpdyHttpUtilsTestParam, CreateSpdyHeadersWithExistingPriority) {}

TEST(SpdyHttpUtilsTest, CreateSpdyHeadersFromHttpRequestConnectHTTP2) {}

constexpr auto ToSimpleString =;

enum class SpdyHeadersToHttpResponseHeadersFeatureConfig {};

std::string PrintToString(
    SpdyHeadersToHttpResponseHeadersFeatureConfig config) {}

class SpdyHeadersToHttpResponseTest
    : public ::testing::TestWithParam<
          SpdyHeadersToHttpResponseHeadersFeatureConfig> {};

// This test behaves the same regardless of which features are enabled.
TEST_P(SpdyHeadersToHttpResponseTest, SpdyHeadersToHttpResponse) {}

INSTANTIATE_TEST_SUITE_P();

// TODO(ricea): Once SpdyHeadersToHttpResponseHeadersUsingRawString has been
// removed, remove the parameterization and make these into
// SpdyHeadersToHttpResponse tests.

SpdyHeadersToHttpResponseHeadersFunctionPtrType;

class SpdyHeadersToHttpResponseHeadersTest
    : public testing::TestWithParam<
          SpdyHeadersToHttpResponseHeadersFunctionPtrType> {};

TEST_P(SpdyHeadersToHttpResponseHeadersTest, NoStatus) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, EmptyStatus) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, Plain200) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, MultipleLocation) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, SpacesAmongValues) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, RepeatedHeader) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, EmptyValue) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, PseudoHeadersAreDropped) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest, DoubleEmptyLocationHeader) {}

TEST_P(SpdyHeadersToHttpResponseHeadersTest,
       DifferentLocationHeaderTriggersError) {}

// TODO(ricea): Ensure that QUICHE will never send us header values with leading
// or trailing whitespace and remove this test.
TEST_P(SpdyHeadersToHttpResponseHeadersTest,
       LocationEquivalenceIgnoresSurroundingSpace) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace

}  // namespace net