#include "services/network/sct_auditing/sct_auditing_reporter.h"
#include "base/base64.h"
#include "base/functional/callback_helpers.h"
#include "base/i18n/time_formatting.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/time/clock.h"
#include "base/time/time.h"
#include "net/base/hash_value.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/network_context.h"
#include "services/network/network_service.h"
#include "services/network/public/mojom/network_service.mojom.h"
#include "services/network/public/proto/sct_audit_report.pb.h"
#include "services/network/test/fake_test_cert_verifier_params_factory.h"
#include "services/network/test/test_network_context_client.h"
#include "services/network/test/test_url_loader_factory.h"
#include "services/network/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/utility/utility.h"
namespace network {
namespace {
constexpr char kLeafHashBase64[] = …;
constexpr char kIssuedSerialized[] = …;
constexpr char kLogIdBase64[] = …;
constexpr char kLogMMDSerialized[] = …;
constexpr char kCertExpirySerialized[] = …;
constexpr char kTestReportURL[] = …;
constexpr char kTestLookupURL[] = …;
constexpr char kTestLookupDomain[] = …;
constexpr base::TimeDelta kExpectedIngestionDelay = …;
constexpr base::TimeDelta kMaxIngestionRandomDelay = …;
std::string ExtractRESTURLParameter(std::string url, std::string param) { … }
}
class SCTAuditingReporterTest : public testing::Test { … };
TEST_F(SCTAuditingReporterTest, SCTHashdanceMetadataFromValue) { … }
TEST_F(SCTAuditingReporterTest, SCTHashdanceMetadataToValue) { … }
TEST_F(SCTAuditingReporterTest, HashdanceLookupNotFound) { … }
TEST_F(SCTAuditingReporterTest, HashdanceLookupFound) { … }
TEST_F(SCTAuditingReporterTest, HashdanceLookupServerError) { … }
TEST_F(SCTAuditingReporterTest, HashdanceLookupHTTPError) { … }
TEST_F(SCTAuditingReporterTest, HashdanceLookupCertificateExpired) { … }
TEST_F(SCTAuditingReporterTest, HashdanceLookupUnknownLog) { … }
TEST_F(SCTAuditingReporterTest, HashdanceLookupLogNotIngested) { … }
TEST_F(SCTAuditingReporterTest, HashdanceSCTSuspectedNotYetIngested) { … }
}