#include "base/power_monitor/battery_state_sampler.h"
#include <queue>
#include <utility>
#include "base/power_monitor/power_monitor_buildflags.h"
#include "base/power_monitor/sampling_event_source.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/power_monitor_test_utils.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
class TestBatteryLevelProvider : public BatteryLevelProvider { … };
class TestBatteryLevelProviderAsync : public TestBatteryLevelProvider { … };
class TestObserver : public BatteryStateSampler::Observer { … };
const std::optional<BatteryLevelProvider::BatteryState> kTestBatteryState1 = …;
const std::optional<BatteryLevelProvider::BatteryState> kTestBatteryState2 = …;
const std::optional<BatteryLevelProvider::BatteryState> kTestBatteryState3 = …;
bool operator==(const BatteryLevelProvider::BatteryState& lhs,
const BatteryLevelProvider::BatteryState& rhs) { … }
bool operator!=(const BatteryLevelProvider::BatteryState& lhs,
const BatteryLevelProvider::BatteryState& rhs) { … }
TEST(BatteryStateSamplerTest, GlobalInstance) { … }
TEST(BatteryStateSamplerTest, InitialSample) { … }
TEST(BatteryStateSamplerTest, MultipleSamples) { … }
TEST(BatteryStateSamplerTest, MultipleObservers) { … }
TEST(BatteryStateSamplerTest, InitialSample_Async) { … }
}