#include "content/browser/interest_group/test_interest_group_private_aggregation_manager.h"
#include <stddef.h>
#include <map>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/time/time.h"
#include "content/browser/interest_group/interest_group_auction_reporter.h"
#include "content/browser/private_aggregation/private_aggregation_budget_key.h"
#include "content/browser/private_aggregation/private_aggregation_manager.h"
#include "content/public/browser/storage_partition.h"
#include "content/services/auction_worklet/public/mojom/private_aggregation_request.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/aggregation_service/aggregatable_report.mojom.h"
#include "third_party/blink/public/mojom/private_aggregation/private_aggregation_host.mojom.h"
#include "url/origin.h"
namespace content {
TestInterestGroupPrivateAggregationManager::
TestInterestGroupPrivateAggregationManager(
const url::Origin& expected_top_frame_origin)
: … { … }
TestInterestGroupPrivateAggregationManager::
~TestInterestGroupPrivateAggregationManager() = default;
bool TestInterestGroupPrivateAggregationManager::BindNewReceiver(
url::Origin worklet_origin,
url::Origin top_frame_origin,
PrivateAggregationBudgetKey::Api api_for_budgeting,
std::optional<std::string> context_id,
std::optional<base::TimeDelta> timeout,
std::optional<url::Origin> aggregation_coordinator_origin,
size_t filtering_id_max_bytes,
mojo::PendingReceiver<blink::mojom::PrivateAggregationHost>
pending_receiver) { … }
void TestInterestGroupPrivateAggregationManager::ClearBudgetData(
base::Time delete_begin,
base::Time delete_end,
StoragePartition::StorageKeyMatcherFunction filter,
base::OnceClosure done) { … }
bool TestInterestGroupPrivateAggregationManager::IsDebugModeAllowed(
const url::Origin& top_frame_origin,
const url::Origin& reporting_origin) { … }
void TestInterestGroupPrivateAggregationManager::ContributeToHistogram(
std::vector<blink::mojom::AggregatableReportHistogramContributionPtr>
contribution_ptrs) { … }
void TestInterestGroupPrivateAggregationManager::EnableDebugMode(
blink::mojom::DebugKeyPtr debug_key) { … }
InterestGroupAuctionReporter::LogPrivateAggregationRequestsCallback
TestInterestGroupPrivateAggregationManager::
GetLogPrivateAggregationRequestsCallback() { … }
std::map<url::Origin, InterestGroupAuctionReporter::PrivateAggregationRequests>
TestInterestGroupPrivateAggregationManager::TakePrivateAggregationRequests() { … }
std::vector<auction_worklet::mojom::PrivateAggregationRequestPtr>
TestInterestGroupPrivateAggregationManager::
TakeLoggedPrivateAggregationRequests() { … }
void TestInterestGroupPrivateAggregationManager::LogPrivateAggregationRequests(
const std::vector<auction_worklet::mojom::PrivateAggregationRequestPtr>&
private_aggregation_requests) { … }
void TestInterestGroupPrivateAggregationManager::Reset() { … }
}