#include "chrome/browser/background/background_mode_manager.h"
#include <stddef.h>
#include <memory>
#include <string>
#include <utility>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_simple_task_runner.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/status_icons/status_icon_menu_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.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/keep_alive_registry/keep_alive_registry.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_service_impl.h"
#include "components/sync_preferences/pref_service_syncable.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension_builder.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/image/image.h"
#include "ui/message_center/public/cpp/notifier_id.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/login/users/chrome_user_manager_impl.h"
#include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h"
#include "components/user_manager/scoped_user_manager.h"
#endif
ManifestLocation;
_;
AtMost;
Exactly;
InSequence;
Mock;
NiceMock;
StrictMock;
namespace {
std::unique_ptr<TestingProfileManager> CreateTestingProfileManager() { … }
class TestBackgroundModeManager : public StrictMock<BackgroundModeManager> { … };
class TestStatusIcon : public StatusIcon { … };
void AssertBackgroundModeActive(const TestBackgroundModeManager& manager) { … }
void AssertBackgroundModeInactive(const TestBackgroundModeManager& manager) { … }
}
class AdvancedTestBackgroundModeManager : public TestBackgroundModeManager { … };
class BackgroundModeManagerTest : public testing::Test { … };
class BackgroundModeManagerWithExtensionsTest : public testing::Test { … };
TEST_F(BackgroundModeManagerTest, BackgroundAppLoadUnload) { … }
TEST_F(BackgroundModeManagerTest, DISABLED_BackgroundAppInstallWhileDisabled) { … }
TEST_F(BackgroundModeManagerTest, BackgroundAppInstallUninstallWhileDisabled) { … }
TEST_F(BackgroundModeManagerTest, EnableAfterBackgroundAppInstall) { … }
TEST_F(BackgroundModeManagerTest, MultiProfile) { … }
TEST_F(BackgroundModeManagerTest, ProfileAttributesStorage) { … }
TEST_F(BackgroundModeManagerTest, ProfileAttributesStorageObserver) { … }
TEST_F(BackgroundModeManagerTest, DeleteBackgroundProfile) { … }
TEST_F(BackgroundModeManagerTest, DisableBackgroundModeUnderTestFlag) { … }
TEST_F(BackgroundModeManagerTest,
BackgroundModeDisabledPreventsKeepAliveOnStartup) { … }
TEST_F(BackgroundModeManagerWithExtensionsTest, BackgroundMenuGeneration) { … }
TEST_F(BackgroundModeManagerWithExtensionsTest,
BackgroundMenuGenerationMultipleProfile) { … }
TEST_F(BackgroundModeManagerWithExtensionsTest, BalloonDisplay) { … }
TEST_F(BackgroundModeManagerTest, TransientBackgroundApp) { … }
TEST_F(BackgroundModeManagerTest, TransientBackgroundAppWithPersistent) { … }
TEST_F(BackgroundModeManagerTest,
BackgroundPersistentAppWhileTransientRunning) { … }
TEST_F(BackgroundModeManagerTest, ForceInstalledExtensionsKeepAlive) { … }
TEST_F(BackgroundModeManagerTest,
ForceInstalledExtensionsKeepAliveReleasedOnAppTerminating) { … }