#include "chrome/browser/content_settings/generated_notification_pref.h"
#include "base/ranges/algorithm.h"
#include "chrome/browser/content_settings/generated_permission_prompting_behavior_pref.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/extensions/api/settings_private/generated_pref_test_base.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/content_settings/core/test/content_settings_mock_provider.h"
#include "components/content_settings/core/test/content_settings_test_utils.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "testing/gtest/include/gtest/gtest.h"
settings_api;
settings_private;
namespace content_settings {
namespace {
void ValidateGeneratedPrefSetting(
HostContentSettingsMap* map,
sync_preferences::TestingPrefServiceSyncable* prefs,
GeneratedNotificationPref* generated_pref,
SettingsState pref_value,
ContentSetting expected_content_setting,
bool expected_quieter_ui) { … }
const SettingsState kNoRecommendedValue = …;
struct NotificationSettingManagedTestCase { … };
static const std::vector<NotificationSettingManagedTestCase> managed_test_cases{ … };
void SetupManagedTestConditions(
HostContentSettingsMap* map,
sync_preferences::TestingPrefServiceSyncable* prefs,
const NotificationSettingManagedTestCase& test_case) { … }
void ValidateManagedPreference(
settings_api::PrefObject& pref,
const NotificationSettingManagedTestCase& test_case) { … }
}
GeneratedNotificationPrefTest;
TEST_F(GeneratedNotificationPrefTest, UpdatePreference) { … }
TEST_F(GeneratedNotificationPrefTest, UpdatePreferenceInvalidAction) { … }
TEST_F(GeneratedNotificationPrefTest, NotifyPrefUpdates) { … }
TEST_F(GeneratedNotificationPrefTest, ManagedState) { … }
}