#include "components/segmentation_platform/internal/database/database_maintenance_impl.h"
#include <cstdint>
#include <memory>
#include <utility>
#include <vector>
#include "base/metrics/metrics_hashes.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/prefs/testing_pref_service.h"
#include "components/segmentation_platform/internal/constants.h"
#include "components/segmentation_platform/internal/database/mock_signal_database.h"
#include "components/segmentation_platform/internal/database/mock_signal_storage_config.h"
#include "components/segmentation_platform/internal/database/signal_storage_config.h"
#include "components/segmentation_platform/internal/database/test_segment_info_database.h"
#include "components/segmentation_platform/public/config.h"
#include "components/segmentation_platform/public/proto/aggregation.pb.h"
#include "components/segmentation_platform/public/proto/segmentation_platform.pb.h"
#include "components/segmentation_platform/public/proto/types.pb.h"
#include "components/segmentation_platform/public/segmentation_platform_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
RunOnceCallback;
_;
SetArgReferee;
namespace segmentation_platform {
SegmentId;
SignalType;
Aggregation;
SignalIdentifier;
namespace {
constexpr uint64_t kLatestCompactionDaysAgo = …;
constexpr uint64_t kEarliestCompactionDaysAgo = …;
static const uint64_t kNonUkmEventHash = …;
std::string kTestSegmentationKey = …;
struct SignalData { … };
}
std::set<DatabaseMaintenanceImpl::SignalIdentifier> GetSignalIds(
std::vector<SignalData> signal_datas) { … }
std::vector<CleanupItem> GetCleanupItems(std::vector<SignalData> signal_datas) { … }
class DatabaseMaintenanceImplTest : public testing::Test { … };
TEST_F(DatabaseMaintenanceImplTest, ExecuteMaintenanceTasks) { … }
TEST_F(DatabaseMaintenanceImplTest, NoCompactionForDataAlreadyCompacted) { … }
}