chromium/components/lookalikes/core/lookalike_url_util_unittest.cc

// Copyright 2020 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/lookalikes/core/lookalike_url_util.h"

#include "base/functional/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "components/lookalikes/core/safety_tip_test_utils.h"
#include "components/lookalikes/core/safety_tips_config.h"
#include "components/url_formatter/spoof_checks/common_words/common_words_util.h"
#include "components/url_formatter/spoof_checks/top_domains/test_top_bucket_domains.h"
#include "components/version_info/channel.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace test {
#include "components/url_formatter/spoof_checks/common_words/common_words_test-inc.cc"
#include "components/url_formatter/spoof_checks/top_domains/test_domains-trie-inc.cc"
}  // namespace test

ComboSquattingParams;
ComboSquattingType;
DomainInfo;
GetDomainInfo;
IsHeuristicEnabledForHostname;
LookalikeUrlMatchType;
TargetEmbeddingType;
Channel;

namespace {
// Tests lists for Combo Squatting. Some of these entries are intended to test
// for various edge cases and aren't realistic for production.
constexpr std::pair<const char*, const char*> kBrandNames[] =;
const char* const kPopularKeywords[] =;
const ComboSquattingParams kComboSquattingParams{};

}  // namespace

std::string TargetEmbeddingTypeToString(TargetEmbeddingType type) {}

// These tests do not use the production top domain list. This is to avoid
// having to adjust the tests when the top domain list is updated. Instead,
// these tests use the data in `test_domains.list` and `common_words_test.gpref`
// files.
class LookalikeUrlUtilTest : public testing::Test {};

TEST_F(LookalikeUrlUtilTest, IsEditDistanceAtMostOne) {}

TEST_F(LookalikeUrlUtilTest, EditDistanceExcludesCommonFalsePositives) {}

TEST_F(LookalikeUrlUtilTest, CharacterSwapExcludesCommonFalsePositives) {}

bool IsGoogleScholar(const std::string& hostname) {}

struct TargetEmbeddingHeuristicTestCase {};

TEST_F(LookalikeUrlUtilTest, ShouldBlockBySpoofCheckResult) {}

TEST_F(LookalikeUrlUtilTest, TargetEmbeddingTest) {}

TEST_F(LookalikeUrlUtilTest, TargetEmbeddingIgnoresComponentWordlist) {}

TEST_F(LookalikeUrlUtilTest, GetETLDPlusOneHandlesSpecialRegistries) {}

// Tests for the character swap heuristic.
TEST_F(LookalikeUrlUtilTest, HasOneCharacterSwap) {}

TEST_F(LookalikeUrlUtilTest, GetSuggestedURL) {}

TEST_F(LookalikeUrlUtilTest, IsHeuristicEnabledForHostname) {}

class ComboSquattingTest : public testing::Test {};

// Test for Combo Squatting check of domains.
TEST_F(ComboSquattingTest, IsComboSquatting) {}