#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/reporting/metrics/periodic_collector.h"
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/reporting/metrics/fakes/fake_metric_report_queue.h"
#include "components/reporting/metrics/fakes/fake_reporting_settings.h"
#include "components/reporting/metrics/fakes/fake_sampler.h"
#include "components/reporting/metrics/metric_report_queue.h"
#include "components/reporting/proto/synced/metric_data.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
Eq;
namespace reporting {
namespace {
constexpr char kEnableSettingPath[] = …;
constexpr char kRateSettingPath[] = …;
constexpr base::TimeDelta interval = …;
class PeriodicCollectorTest : public ::testing::Test { … };
TEST_F(PeriodicCollectorTest, InitiallyEnabled) { … }
TEST_F(PeriodicCollectorTest, InitiallyEnabled_Delayed) { … }
TEST_F(PeriodicCollectorTest, NoMetricData) { … }
TEST_F(PeriodicCollectorTest, InitiallyDisabled) { … }
TEST_F(PeriodicCollectorTest, DefaultEnabled) { … }
TEST_F(PeriodicCollectorTest, DefaultDisabled) { … }
}
}