chromium/content/browser/aggregation_service/aggregatable_report_scheduler_unittest.cc

// Copyright 2022 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/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;

// Will be used to verify the sequence of expected function calls.
Checkpoint;

// TODO(alexmt): Consider changing tests to avoid the assumption that this time
// is after `base::Time::Now()`.
constexpr auto kExampleTime =;

}  // namespace

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) {}

}  // namespace content