chromium/components/supervised_user/core/browser/supervised_user_url_filter_unittest.cc

// Copyright 2014 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/supervised_user/core/browser/supervised_user_url_filter.h"

#include <cstddef>
#include <map>
#include <memory>
#include <optional>

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "components/prefs/testing_pref_service.h"
#include "components/safe_search_api/fake_url_checker_client.h"
#include "components/supervised_user/core/browser/supervised_user_preferences.h"
#include "components/supervised_user/core/browser/supervised_user_utils.h"
#include "components/supervised_user/test_support/supervised_user_url_filter_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace supervised_user {

class SupervisedUserURLFilterTest : public ::testing::Test,
                                    public SupervisedUserURLFilter::Observer {};

TEST_F(SupervisedUserURLFilterTest, Basic) {}

TEST_F(SupervisedUserURLFilterTest, EffectiveURL) {}

TEST_F(SupervisedUserURLFilterTest, Inactive) {}

TEST_F(SupervisedUserURLFilterTest, IPAddress) {}

TEST_F(SupervisedUserURLFilterTest, Canonicalization) {}

TEST_F(SupervisedUserURLFilterTest, UrlWithNonStandardUrlSchemeAllowed) {}

TEST_F(SupervisedUserURLFilterTest, HostMatchesPattern) {}

TEST_F(SupervisedUserURLFilterTest, PatternsWithoutConflicts) {}

TEST_F(SupervisedUserURLFilterTest, PatternsWithConflicts) {}

TEST_F(SupervisedUserURLFilterTest, Reason) {}

TEST_F(SupervisedUserURLFilterTest, UrlsNotRequiringGuardianApprovalAllowed) {}

TEST_F(SupervisedUserURLFilterTest, PlayTermsAlwaysAllowed) {}

class SupervisedUserURLFilteringWithConflictsTest
    : public testing::TestWithParam<std::tuple<
          std::map<std::string, bool>,
          std::optional<
              SupervisedUserURLFilter::FilteringSubdomainConflictType>>> {};

// Tests that the new histogram that records www-subdomain conflicts
// increases only when the corresponding conflict types occurs.
TEST_P(SupervisedUserURLFilteringWithConflictsTest,
       PatternsWithSubdomainConflicts) {}

// Tests that conflict tracking histogram records a result for no conflicts
// even for paths that determine a result and exit early.
TEST_F(SupervisedUserURLFilteringWithConflictsTest,
       PatterWithoutConflictOnEarlyExit) {}

INSTANTIATE_TEST_SUITE_P();
}  // namespace supervised_user