chromium/chrome/common/net/x509_certificate_model_unittest.cc

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

#include "chrome/common/net/x509_certificate_model.h"

#include <string_view>

#include "net/cert/x509_util.h"
#include "net/test/cert_builder.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/boringssl/src/pki/parse_certificate.h"

class X509CertificateModel : public testing::TestWithParam<std::string> {};

Error;
NotPresent;
OptionalStringOrError;

namespace {

std::optional<std::string> FindExtension(
    const std::vector<x509_certificate_model::Extension>& extensions,
    std::string_view name) {}

}  // namespace

TEST_P(X509CertificateModel, InvalidCert) {}

TEST_P(X509CertificateModel, GetGoogleCertFields) {}

TEST_P(X509CertificateModel, GetSCTField) {}

TEST_P(X509CertificateModel, GetNDNCertFields) {}

TEST_P(X509CertificateModel, PunyCodeCert) {}

TEST_P(X509CertificateModel, SubjectAltNameSanityTest) {}

TEST_P(X509CertificateModel, CertificatePoliciesSanityTest) {}

TEST_P(X509CertificateModel, CertificatePoliciesInvalidUtf8UserNotice) {}

TEST_P(X509CertificateModel, GlobalsignComCert) {}

TEST_P(X509CertificateModel, NSCertComment) {}

TEST_P(X509CertificateModel, DiginotarCert) {}

TEST_P(X509CertificateModel, AuthorityKeyIdentifierAllFields) {}

TEST_P(X509CertificateModel, CrlDpCrlIssuerAndRelativeName) {}

TEST_P(X509CertificateModel, CrlDpReasons) {}

TEST_P(X509CertificateModel, AuthorityInfoAccessNonstandardOidAndLocationType) {}

TEST_P(X509CertificateModel, SubjectIA5StringInvalidCharacters) {}

TEST_P(X509CertificateModel, SubjectInvalid) {}

TEST_P(X509CertificateModel, SubjectEmptySequence) {}

INSTANTIATE_TEST_SUITE_P();

// TODO(crbug.com/41453265): This test suite has "2" at the end of the
// name to avoid conflicting with x509_certificate_model_nss_unittest. Should
// rename the test suite in that file to X509CertificateModelNSSTest and remove
// the 2 from here.
TEST(X509CertificateModelTest2, ProcessRawSubjectPublicKeyInfo) {}