chromium/third_party/blink/renderer/platform/network/http_parsers_test.cc

// Copyright 2014 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/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/platform/network/http_parsers.h"

#include <string_view>

#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "net/base/features.h"
#include "services/network/public/mojom/content_security_policy.mojom-blink-forward.h"
#include "services/network/public/mojom/content_security_policy.mojom-blink.h"
#include "services/network/public/mojom/parsed_headers.mojom-blink.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
#include "third_party/blink/renderer/platform/network/http_names.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"

namespace blink {

TEST(HTTPParsersTest, ParseCacheControl) {}

TEST(HTTPParsersTest, CommaDelimitedHeaderSet) {}

TEST(HTTPParsersTest, HTTPToken) {}

TEST(HTTPParsersTest, ExtractMIMETypeFromMediaType) {}

TEST(HTTPParsersTest, MinimizedMIMEType) {}

TEST(HTTPParsersTest, ExtractMIMETypeFromMediaTypeInvalidInput) {}

TEST(HTTPParsersTest, ParseHTTPRefresh) {}

TEST(HTTPParsersTest, ParseMultipartHeadersResult) {}

TEST(HTTPParsersTest, ParseMultipartHeaders) {}

TEST(HTTPParsersTest, ParseMultipartHeadersContentCharset) {}

void testServerTimingHeader(const char* headerValue,
                            Vector<Vector<String>> expectedResults) {}

TEST(HTTPParsersTest, ParseServerTimingHeader) {}

TEST(HTTPParsersTest, ParseContentTypeOptionsTest) {}

// -----------------------------------------------------------------------------
// Blink's HTTP parser is reusing:
// services/network/public/cpp/content_security_policy/, which is already tested
// and fuzzed.
// What needs to be tested is the basic conversion from/to blink types.
// -----------------------------------------------------------------------------

TEST(HTTPParsersTest, ParseContentSecurityPoliciesmpty) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesMultiple) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesSingle) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesMeta) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesReportOnly) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesDirectiveName) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesReportTo) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesReportUri) {}

TEST(HTTPParsersTest, ParseContentSecurityPoliciesSourceBasic) {}

TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsDefaultURLVariance) {}

struct NoVarySearchTestData {};

class NoVarySearchPrefetchEnabledTest
    : public ::testing::Test,
      public ::testing::WithParamInterface<NoVarySearchTestData> {};

TEST_P(NoVarySearchPrefetchEnabledTest, ParsingSuccess) {}

TEST(NoVarySearchHeaderValueParsingTest, ParsingSuccessForParseNoVarySearch) {}

TEST(NoVarySearchHeaderValueParsingTest, ParsingFailureForParseNoVarySearch) {}

Vector<NoVarySearchTestData> GetNoVarySearchParsingSuccessTestData() {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace blink