#include <string>
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/power_monitor_test_utils.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/feedback/system_logs/log_sources/performance_log_source.h"
#include "chrome/browser/performance_manager/public/user_tuning/user_performance_tuning_manager.h"
#include "chrome/browser/performance_manager/test_support/fake_power_monitor_source.h"
#include "chrome/browser/performance_manager/test_support/test_user_performance_tuning_manager_environment.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
#include "components/performance_manager/public/features.h"
#include "components/performance_manager/public/user_tuning/prefs.h"
class QuitRunLoopOnPowerStateChangeObserver
: public performance_manager::user_tuning::BatterySaverModeManager::
Observer { … };
namespace {
constexpr char kMemorySaverModeActiveKey[] = …;
#if !BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kBatterySaverModeStateKey[] = …;
constexpr char kBatterySaverModeActiveKey[] = …;
constexpr char kBatterySaverModeDisabledForSessionKey[] = …;
constexpr char kHasBatteryKey[] = …;
constexpr char kUsingBatteryPowerKey[] = …;
constexpr char kBatteryPercentage[] = …;
#endif
class PerformanceLogSourceTest : public BrowserWithTestWindowTest { … };
TEST_F(PerformanceLogSourceTest, CheckMemorySaverModeLogs) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(PerformanceLogSourceTest, CheckBatterySaverModeLogs) { … }
TEST_F(PerformanceLogSourceTest, CheckBatteryDetailLogs) { … }
#endif
}