#include "components/policy/core/browser/url_blocklist_policy_handler.h"
#include <memory>
#include <utility>
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/policy_constants.h"
#include "components/prefs/pref_value_map.h"
#include "components/strings/grit/components_strings.h"
#include "components/url_matcher/url_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
namespace policy {
namespace {
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
const char kTestDisabledScheme[] = …;
#endif
const char kTestBlocklistValue[] = …;
}
class URLBlocklistPolicyHandlerTest : public testing::Test { … };
TEST_F(URLBlocklistPolicyHandlerTest,
CheckPolicySettings_DisabledSchemesUnspecified) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(URLBlocklistPolicyHandlerTest,
CheckPolicySettings_URLBlocklistUnspecified) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
CheckPolicySettings_DisabledSchemesWrongType) { … }
#endif
TEST_F(URLBlocklistPolicyHandlerTest,
CheckPolicySettings_URLBlocklistWrongType) { … }
TEST_F(URLBlocklistPolicyHandlerTest, ApplyPolicySettings_NothingSpecified) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_DisabledSchemesWrongType) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_DisabledSchemesEmpty) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_DisabledSchemesWrongElementType) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_DisabledSchemesSuccessful) { … }
TEST_F(URLBlocklistPolicyHandlerTest, ApplyPolicySettings_MergeSuccessful) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_CheckPolicySettingsMaxFiltersLimitExceeded_2) { … }
#endif
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_URLBlocklistWrongType) { … }
TEST_F(URLBlocklistPolicyHandlerTest, ApplyPolicySettings_URLBlocklistEmpty) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_URLBlocklistWrongElementType) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_URLBlocklistSuccessful) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_CheckPolicySettingsMaxFiltersLimitOK) { … }
TEST_F(URLBlocklistPolicyHandlerTest,
ApplyPolicySettings_CheckPolicySettingsMaxFiltersLimitExceeded_1) { … }
TEST_F(URLBlocklistPolicyHandlerTest, ValidatePolicy) { … }
TEST_F(URLBlocklistPolicyHandlerTest, CheckPolicyURLHostWithAsterik) { … }
}