chromium/chrome/browser/ui/performance_controls/performance_controls_hats_service_unittest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/performance_controls/performance_controls_hats_service.h"
#include <memory>

#include "base/memory/raw_ptr.h"
#include "base/test/power_monitor_test_utils.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/performance_manager/test_support/test_user_performance_tuning_manager_environment.h"
#include "chrome/browser/ui/hats/hats_service_factory.h"
#include "chrome/browser/ui/hats/mock_hats_service.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/performance_manager/public/features.h"
#include "components/performance_manager/public/user_tuning/prefs.h"
#include "components/prefs/testing_pref_service.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#endif

_;

class PerformanceControlsHatsServiceTest : public testing::Test {};

class PerformanceControlsHatsServiceHasBatteryTest
    : public PerformanceControlsHatsServiceTest {};

class PerformanceControlsHatsServiceMemorySaverOptOutTest
    : public PerformanceControlsHatsServiceTest {};

class PerformanceControlsHatsServiceBatterySaverOptOutTest
    : public PerformanceControlsHatsServiceTest {};

TEST_F(PerformanceControlsHatsServiceTest, LaunchesPerformanceSurvey) {}

// Battery Saver is controlled by the OS on ChromeOS
#if !BUILDFLAG(IS_CHROMEOS_ASH)

TEST_F(PerformanceControlsHatsServiceHasBatteryTest,
       LaunchesBatteryPerformanceSurvey) {}

#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)

TEST_F(PerformanceControlsHatsServiceMemorySaverOptOutTest,
       LaunchesMemorySaverOptOutSurvey) {}

// Battery Saver is controlled by the OS on ChromeOS
#if !BUILDFLAG(IS_CHROMEOS_ASH)

TEST_F(PerformanceControlsHatsServiceBatterySaverOptOutTest,
       LaunchesBatterySaverOptOutSurvey) {}

#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)

class PerformanceControlsHatsServiceDestructorTest : public testing::Test {};

TEST_F(PerformanceControlsHatsServiceDestructorTest,
       HandlesBatterySaverModeManagerDestruction) {}