#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/reporting/reporting_delivery_agent.h"
#include <optional>
#include <vector>
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/values_test_util.h"
#include "base/time/time.h"
#include "base/timer/mock_timer.h"
#include "base/unguessable_token.h"
#include "base/values.h"
#include "net/base/backoff_entry.h"
#include "net/base/features.h"
#include "net/base/isolation_info.h"
#include "net/base/network_anonymization_key.h"
#include "net/base/schemeful_site.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_report.h"
#include "net/reporting/reporting_test_util.h"
#include "net/reporting/reporting_uploader.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace net {
namespace {
constexpr char kReportingUploadHeaderTypeHistogram[] = …;
}
class ReportingDeliveryAgentTest : public ReportingTestBase { … };
TEST_F(ReportingDeliveryAgentTest, SuccessfulImmediateUpload) { … }
TEST_F(ReportingDeliveryAgentTest, ReportToHeaderCountedCorrectly) { … }
TEST_F(ReportingDeliveryAgentTest, SuccessfulImmediateUploadDocumentReport) { … }
TEST_F(ReportingDeliveryAgentTest, UploadHeaderTypeEnumCountPerReport) { … }
TEST_F(ReportingDeliveryAgentTest, SuccessfulImmediateSubdomainUpload) { … }
TEST_F(ReportingDeliveryAgentTest,
SuccessfulImmediateSubdomainUploadWithOverwrittenEndpoint) { … }
TEST_F(ReportingDeliveryAgentTest, SuccessfulDelayedUpload) { … }
TEST_F(ReportingDeliveryAgentTest, FailedUpload) { … }
TEST_F(ReportingDeliveryAgentTest, DisallowedUpload) { … }
TEST_F(ReportingDeliveryAgentTest, RemoveEndpointUpload) { … }
TEST_F(ReportingDeliveryAgentTest, ConcurrentRemove) { … }
TEST_F(ReportingDeliveryAgentTest, ConcurrentRemoveDuringPermissionsCheck) { … }
TEST_F(ReportingDeliveryAgentTest, OnlyBatchSameNakAndOrigin) { … }
TEST_F(ReportingDeliveryAgentTest, SerializeUploadsToGroup) { … }
TEST_F(ReportingDeliveryAgentTest, ParallelizeUploadsAcrossGroups) { … }
TEST_F(ReportingDeliveryAgentTest, BatchReportsAcrossGroups) { … }
TEST_F(ReportingDeliveryAgentTest, SendDeveloperReportsForSource) { … }
TEST_F(ReportingDeliveryAgentTest, SendEnterpriseReports) { … }
TEST_F(ReportingDeliveryAgentTest, SendEnterpriseReportsBatched) { … }
TEST_F(ReportingDeliveryAgentTest, SendDeveloperAndEnterpriseReports) { … }
TEST_F(ReportingDeliveryAgentTest, SendReportsForMultipleSources) { … }
}