#include "content/browser/aggregation_service/aggregatable_report_assembler.h"
#include <stddef.h>
#include <memory>
#include <optional>
#include <string_view>
#include <utility>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/gmock_move_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "content/browser/aggregation_service/aggregatable_report.h"
#include "content/browser/aggregation_service/aggregation_service_key_fetcher.h"
#include "content/browser/aggregation_service/aggregation_service_test_utils.h"
#include "content/browser/aggregation_service/public_key.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/aggregation_service/aggregatable_report.mojom.h"
#include "third_party/distributed_point_functions/shim/buildflags.h"
#include "url/gurl.h"
namespace content {
namespace {
_;
Eq;
Invoke;
Return;
Checkpoint;
FetchCallback;
AssemblyCallback;
PublicKeyFetchStatus;
AssemblyStatus;
constexpr std::string_view kReportAssemblerStatusHistogramName = …;
auto CloneRequestAndReturnReport(std::optional<AggregatableReportRequest>* out,
AggregatableReport report) { … }
class MockAggregationServiceKeyFetcher : public AggregationServiceKeyFetcher { … };
class MockAggregatableReportProvider : public AggregatableReport::Provider { … };
}
class AggregatableReportAssemblerTest : public testing::Test { … };
TEST_F(AggregatableReportAssemblerTest, BothKeyFetchesFail_ErrorReturned) { … }
TEST_F(AggregatableReportAssemblerTest, FirstKeyFetchFails_ErrorReturned) { … }
TEST_F(AggregatableReportAssemblerTest, SecondKeyFetchFails_ErrorReturned) { … }
TEST_F(AggregatableReportAssemblerTest,
BothKeyFetchesSucceed_ValidReportReturned) { … }
TEST_F(AggregatableReportAssemblerTest,
OnlyKeyFetchSucceeds_ValidReportReturned) { … }
TEST_F(AggregatableReportAssemblerTest, OnlyKeyFetchFails_ErrorReturned) { … }
TEST_F(AggregatableReportAssemblerTest,
TwoKeyFetchesReturnInSwappedOrder_ValidReportReturned) { … }
TEST_F(AggregatableReportAssemblerTest,
AssemblerDeleted_PendingRequestsNotRun) { … }
TEST_F(AggregatableReportAssemblerTest,
MultipleSimultaneousRequests_BothSucceed) { … }
TEST_F(AggregatableReportAssemblerTest,
TooManySimultaneousRequests_ErrorCausedForNewRequests) { … }
}