#include "components/media_router/common/providers/cast/certificate/cast_crl.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/time/time.h"
#include "components/media_router/common/providers/cast/certificate/cast_cert_reader.h"
#include "components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.h"
#include "components/media_router/common/providers/cast/certificate/cast_cert_validator.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/boringssl/src/pki/cert_errors.h"
#include "third_party/boringssl/src/pki/trust_store_in_memory.h"
#include "third_party/openscreen/src/cast/common/certificate/proto/test_suite.pb.h"
using openscreen::cast::proto::DeviceCertTest;
using openscreen::cast::proto::DeviceCertTestSuite;
namespace cast_certificate {
namespace {
enum TestStepResult { … };
bool TestVerifyCertificate(TestStepResult expected_result,
const std::vector<std::string>& certificate_chain,
const base::Time& time) { … }
bool TestVerifyCRL(TestStepResult expected_result,
const std::string& crl_bundle,
const base::Time& time,
bssl::TrustStore* crl_trust_store) { … }
bool TestVerifyRevocation(CastCertError expected_result,
const std::vector<std::string>& certificate_chain,
const std::string& crl_bundle,
const base::Time& crl_time,
const base::Time& cert_time,
CRLPolicy crl_policy,
bssl::TrustStore* crl_trust_store) { … }
bool RunTest(const DeviceCertTest& test_case) { … }
void RunTestSuite(const std::string& test_suite_file_name) { … }
TEST(CastCertificateTest, TestSuite1) { … }
}
}