#include "content/browser/aggregation_service/aggregatable_report_scheduler.h"
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/containers/flat_set.h"
#include "base/metrics/histogram_base.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/threading/sequence_bound.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "content/browser/aggregation_service/aggregatable_report.h"
#include "content/browser/aggregation_service/aggregation_service.h"
#include "content/browser/aggregation_service/aggregation_service_storage.h"
#include "content/browser/aggregation_service/aggregation_service_test_utils.h"
#include "content/public/common/content_switches.h"
#include "services/network/public/mojom/network_change_manager.mojom.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
_;
Field;
Invoke;
Property;
Checkpoint;
constexpr auto kExampleTime = …;
}
class AggregatableReportSchedulerTest : public testing::Test { … };
TEST_F(AggregatableReportSchedulerTest,
ScheduleRequest_RetrievedAtAppropriateTime) { … }
TEST_F(AggregatableReportSchedulerTest,
InProgressRequestCompleted_DeletedFromStorage) { … }
TEST_F(AggregatableReportSchedulerTest,
FinalSendAttemptFailed_DeletedFromStorage) { … }
TEST_F(AggregatableReportSchedulerTest,
InProgressRequestFailed_UpdateStorageAndReschedule) { … }
TEST_F(AggregatableReportSchedulerTest,
MultipleRequests_RetrievedAtAppropriateTime) { … }
TEST_F(AggregatableReportSchedulerTest,
MultipleRequestsReturned_OrderedByReportTime) { … }
TEST_F(AggregatableReportSchedulerTest,
NetworkOffline_ReportsAreNotRetrievedUntilOnline) { … }
TEST_F(AggregatableReportSchedulerTest,
OnlineConnectionChanges_ReportsAreNotRetrieved) { … }
TEST_F(AggregatableReportSchedulerTest,
StorageLimitReached_ReportSilentlyDropped) { … }
class AggregatableReportSchedulerDeveloperModeTest
: public AggregatableReportSchedulerTest { … };
TEST_F(AggregatableReportSchedulerDeveloperModeTest,
NetworkOffline_ReportsAreSentImmediatelyWhenOnline) { … }
}