#ifndef CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_TEST_UTILS_H_
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_TEST_UTILS_H_
#include <stdint.h>
#include <iosfwd>
#include <optional>
#include <string>
#include <vector>
#include "base/containers/flat_set.h"
#include "base/time/time.h"
#include "base/uuid.h"
#include "components/attribution_reporting/aggregatable_debug_reporting_config.h"
#include "components/attribution_reporting/aggregatable_filtering_id_max_bytes.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/filters.h"
#include "components/attribution_reporting/source_registration.h"
#include "components/attribution_reporting/source_registration_time_config.mojom.h"
#include "components/attribution_reporting/source_type.mojom.h"
#include "components/attribution_reporting/suitable_origin.h"
#include "components/attribution_reporting/test_utils.h"
#include "components/attribution_reporting/trigger_data_matching.mojom-forward.h"
#include "content/browser/attribution_reporting/attribution_info.h"
#include "content/browser/attribution_reporting/attribution_report.h"
#include "content/browser/attribution_reporting/create_report_result.h"
#include "content/browser/attribution_reporting/send_result.h"
#include "content/browser/attribution_reporting/storable_source.h"
#include "content/browser/attribution_reporting/stored_source.h"
#include "content/public/browser/attribution_data_model.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/mojom/aggregation_service/aggregatable_report.mojom-forward.h"
namespace attribution_reporting {
class AggregatableValues;
class AggregationKeys;
class AttributionScopesData;
class TriggerSpecs;
}
namespace net {
class SchemefulSite;
}
namespace content {
class AttributionTrigger;
class CommonSourceInfo;
enum class RateLimitResult : int;
base::Uuid DefaultExternalReportID();
class SourceBuilder { … };
AttributionTrigger DefaultTrigger();
class TriggerBuilder { … };
class AttributionInfoBuilder { … };
class ReportBuilder { … };
bool operator==(const StoredSource&, const StoredSource&);
bool operator==(const AttributionReport::CommonAggregatableData&,
const AttributionReport::CommonAggregatableData&);
bool operator==(const AttributionReport::AggregatableAttributionData&,
const AttributionReport::AggregatableAttributionData&);
bool operator==(const AttributionReport::NullAggregatableData&,
const AttributionReport::NullAggregatableData&);
bool operator==(const AttributionReport&, const AttributionReport&);
std::ostream& operator<<(std::ostream& out, RateLimitResult result);
std::ostream& operator<<(std::ostream& out,
const AttributionTrigger& conversion);
std::ostream& operator<<(std::ostream& out, const CommonSourceInfo& source);
std::ostream& operator<<(std::ostream& out,
const AttributionInfo& attribution_info);
std::ostream& operator<<(std::ostream& out, const StorableSource& source);
std::ostream& operator<<(std::ostream& out, const StoredSource& source);
std::ostream& operator<<(
std::ostream& out,
const blink::mojom::AggregatableReportHistogramContribution& contribution);
std::ostream& operator<<(std::ostream& out,
const AttributionReport::EventLevelData& data);
std::ostream& operator<<(std::ostream& out,
const AttributionReport::CommonAggregatableData&);
std::ostream& operator<<(
std::ostream& out,
const AttributionReport::AggregatableAttributionData& data);
std::ostream& operator<<(std::ostream& out,
const AttributionReport::NullAggregatableData&);
std::ostream& operator<<(std::ostream& out, const AttributionReport& report);
std::ostream& operator<<(std::ostream& out, SendResult::Status status);
std::ostream& operator<<(std::ostream& out, const SendResult& info);
std::ostream& operator<<(std::ostream& out,
StoredSource::AttributionLogic attribution_logic);
std::ostream& operator<<(std::ostream& out,
StoredSource::ActiveState active_state);
std::ostream& operator<<(std::ostream& out,
const AttributionDataModel::DataKey& key);
MATCHER_P(SourceRegistrationIs, matcher, "") { … }
MATCHER_P(RegistrationAttributionScopesDataIs, matcher, "") { … }
MATCHER_P(RegistrationSourceEventIdIs, matcher, "") { … }
MATCHER_P(SourceEventIdIs, matcher, "") { … }
MATCHER_P(ImpressionOriginIs, matcher, "") { … }
MATCHER_P(ReportingOriginIs, matcher, "") { … }
MATCHER_P(SourceTypeIs, matcher, "") { … }
MATCHER_P(SourceDebugKeyIs, matcher, "") { … }
MATCHER_P(SourceDebugCookieSetIs, matcher, "") { … }
MATCHER_P(SourceFilterDataIs, matcher, "") { … }
MATCHER_P(DedupKeysAre, matcher, "") { … }
MATCHER_P(AggregatableDedupKeysAre, matcher, "") { … }
MATCHER_P(AggregationKeysAre, matcher, "") { … }
MATCHER_P(RemainingAggregatableAttributionBudgetIs, matcher, "") { … }
MATCHER_P(AttributionScopesDataIs, matcher, "") { … }
MATCHER_P(AttributionScopesSetIs, matcher, "") { … }
MATCHER_P(RandomizedResponseRateIs, matcher, "") { … }
MATCHER_P(SourceActiveStateIs, matcher, "") { … }
MATCHER_P(TriggerDestinationOriginIs, matcher, "") { … }
MATCHER_P(ReportTimeIs, matcher, "") { … }
MATCHER_P(InitialReportTimeIs, matcher, "") { … }
MATCHER_P(FailedSendAttemptsIs, matcher, "") { … }
MATCHER_P(TriggerDebugKeyIs, matcher, "") { … }
MATCHER_P(ReportSourceDebugKeyIs, matcher, "") { … }
MATCHER_P(EventLevelDataIs, matcher, "") { … }
MATCHER_P(TriggerDataIs, matcher, "") { … }
MATCHER_P(TriggerPriorityIs, matcher, "") { … }
MATCHER_P(ReportURLIs, matcher, "") { … }
MATCHER_P(ReportOriginIs, matcher, "") { … }
MATCHER_P(ReportTypeIs, matcher, "") { … }
MATCHER_P(AggregatableAttributionDataIs, matcher, "") { … }
MATCHER_P(NullAggregatableDataIs, matcher, "") { … }
MATCHER_P(AggregatableHistogramContributionsAre, matcher, "") { … }
MATCHER_P(AggregationCoordinatorOriginIs, matcher, "") { … }
MATCHER_P(SourceRegistrationTimeConfigIs, matcher, "") { … }
MATCHER_P(TriggerContextIdIs, matcher, "") { … }
MATCHER_P(CreateReportEventLevelStatusIs, matcher, "") { … }
MATCHER_P(CreateReportAggregatableStatusIs, matcher, "") { … }
MATCHER_P(ReplacedEventLevelReportIs, matcher, "") { … }
MATCHER_P(DeactivatedSourceIs, matcher, "") { … }
MATCHER_P(NewEventLevelReportIs, matcher, "") { … }
MATCHER_P(NewAggregatableReportIs, matcher, "") { … }
MATCHER_P(DroppedEventLevelReportIs, matcher, "") { … }
class TestAggregatableSourceProvider { … };
TriggerBuilder DefaultAggregatableTriggerBuilder(
const std::vector<uint32_t>& histogram_values = { … };
std::vector<blink::mojom::AggregatableReportHistogramContribution>
DefaultAggregatableHistogramContributions(
const std::vector<int32_t>& histogram_values = { … };
struct OsRegistration;
bool operator==(const OsRegistration&, const OsRegistration&);
std::ostream& operator<<(std::ostream&, const OsRegistration&);
void ExpectValidAttributionReportingEligibleHeaderForEventBeacon(
const std::string& header);
void ExpectValidAttributionReportingEligibleHeaderForImg(
const std::string& header);
void ExpectValidAttributionReportingEligibleHeaderForNavigation(
const std::string& header);
void ExpectEmptyAttributionReportingEligibleHeader(const std::string& header);
void ExpectValidAttributionReportingSupportHeader(const std::string& header,
bool web_expected,
bool os_expected);
}
#endif