chromium/components/policy/core/browser/url_scheme_list_policy_handler_unittest.cc

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

#include "components/policy/core/browser/url_scheme_list_policy_handler.h"

#include <memory>
#include <utility>

#include "base/strings/string_number_conversions.h"
#include "base/values.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 {

const char kTestPolicyName[] =;
const char kTestPrefName[] =;
const char kTestUrl[] =;
const char kNotAUrl[] =;

}  // namespace

class URLSchemeListPolicyHandlerTest : public testing::Test {};

TEST_F(URLSchemeListPolicyHandlerTest, CheckPolicySettings_EmptyPolicy) {}

TEST_F(URLSchemeListPolicyHandlerTest, CheckPolicySettings_WrongType) {}

TEST_F(URLSchemeListPolicyHandlerTest, CheckPolicySettings_NoPolicy) {}

TEST_F(URLSchemeListPolicyHandlerTest, CheckPolicySettings_OneBadValue) {}

TEST_F(URLSchemeListPolicyHandlerTest, CheckPolicySettings_SingleBadValue) {}

TEST_F(URLSchemeListPolicyHandlerTest, ApplyPolicySettings_NothingSpecified) {}

TEST_F(URLSchemeListPolicyHandlerTest, ApplyPolicySettings_WrongType) {}

TEST_F(URLSchemeListPolicyHandlerTest, ApplyPolicySettings_Empty) {}

TEST_F(URLSchemeListPolicyHandlerTest, ApplyPolicySettings_WrongElementType) {}

TEST_F(URLSchemeListPolicyHandlerTest, ApplyPolicySettings_BadUrl) {}

TEST_F(URLSchemeListPolicyHandlerTest, ApplyPolicySettings_Successful) {}

TEST_F(URLSchemeListPolicyHandlerTest,
       ApplyPolicySettings_CheckPolicySettingsMaxFiltersLimitOK) {}

// Test that the warning message, mapped to
// |IDS_POLICY_URL_ALLOW_BLOCK_LIST_MAX_FILTERS_LIMIT_WARNING|, is added to
// |errors_| when URLBlocklist entries exceed the max filters per policy limit.
TEST_F(URLSchemeListPolicyHandlerTest,
       ApplyPolicySettings_CheckPolicySettingsMaxFiltersLimitExceeded) {}

TEST_F(URLSchemeListPolicyHandlerTest, ValidatePolicyEntry) {}

}  // namespace policy