chromium/content/browser/aggregation_service/aggregation_service_impl_unittest.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/aggregation_service/aggregation_service_impl.h"

#include <memory>
#include <optional>
#include <utility>
#include <vector>

#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_base.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "content/browser/aggregation_service/aggregatable_report.h"
#include "content/browser/aggregation_service/aggregatable_report_assembler.h"
#include "content/browser/aggregation_service/aggregatable_report_scheduler.h"
#include "content/browser/aggregation_service/aggregatable_report_sender.h"
#include "content/browser/aggregation_service/aggregation_service_observer.h"
#include "content/browser/aggregation_service/aggregation_service_storage.h"
#include "content/browser/aggregation_service/aggregation_service_test_utils.h"
#include "content/public/test/browser_task_environment.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace content {

namespace {

RequestIdIs;
_;
ElementsAre;
Eq;
Optional;
SizeIs;
StrictMock;

auto InvokeCallback(std::optional<AggregatableReport> report,
                    AggregationService::AssemblyStatus status) {}

AggregatableReport CreateExampleAggregatableReport() {}

}  // namespace

class MockAggregatableReportAssembler : public AggregatableReportAssembler {};

class MockAggregatableReportSender : public AggregatableReportSender {};

class MockAggregatableReportScheduler : public AggregatableReportScheduler {};

class MockAggregationServiceObserver : public AggregationServiceObserver {};

class AggregationServiceImplTest : public testing::Test {};

TEST_F(AggregationServiceImplTest, AssembleReport_Succeed) {}

TEST_F(AggregationServiceImplTest, AssembleReport_Fail) {}

TEST_F(AggregationServiceImplTest, SendReport) {}

TEST_F(AggregationServiceImplTest, ScheduleReport_Success) {}

TEST_F(AggregationServiceImplTest, ScheduleReport_FailedAssembly) {}

TEST_F(AggregationServiceImplTest, ScheduleReport_FailedSending) {}

TEST_F(AggregationServiceImplTest,
       MultipleReportsReturnedFromScheduler_Success) {}

TEST_F(AggregationServiceImplTest, AssembleAndSendReport_Success) {}

TEST_F(AggregationServiceImplTest, AssembleAndSendReport_FailedAssembly) {}

TEST_F(AggregationServiceImplTest, AssembleAndSendReport_FailedSender) {}

TEST_F(AggregationServiceImplTest, GetPendingReportRequestsForWebUI) {}

TEST_F(AggregationServiceImplTest, SendReportsForWebUI) {}

TEST_F(AggregationServiceImplTest, ClearData_NotifyObservers) {}

}  // namespace content