chromium/components/policy/core/common/policy_logger_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 "components/policy/core/common/policy_logger.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/test_mock_time_task_runner.h"
#include "components/policy/core/common/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"

_;
ElementsAre;
Eq;
Property;

namespace policy {

namespace {

void AddLogs(const std::string& message, PolicyLogger* policy_logger) {}

}  // namespace

class PolicyLoggerTest : public PlatformTest {};

// Checks that the logger is enabled by feature and that `GetAsList` returns an
// updated list of logs.
TEST_F(PolicyLoggerTest, PolicyLoggingEnabled) {}

// Checks that the deletion of expired logs works as expected.
TEST_F(PolicyLoggerTest, DeleteOldLogs) {}

// Checks that the first log  added is deleted when `PolicyLogger::kMaxLogSize`
// is exceeded.
TEST_F(PolicyLoggerTest, MaxSizeExceededDeletesOldestLog) {}

}  // namespace policy