| # 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. |
| |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| static_library("core") { |
| sources = [ |
| "lookalike_url_ui_util.cc", |
| "lookalike_url_ui_util.h", |
| "lookalike_url_util.cc", |
| "lookalike_url_util.h", |
| ] |
| configs += [ |
| "//build/config/compiler:wexit_time_destructors", |
| "//build/config/compiler:wglobal_constructors", |
| ] |
| deps = [ |
| ":proto", |
| ":safety_tips", |
| "//base", |
| "//components/pref_registry", |
| "//components/prefs", |
| "//components/security_interstitials/core", |
| "//components/strings", |
| "//components/url_formatter", |
| "//components/url_formatter/spoof_checks/common_words:common", |
| "//components/url_formatter/spoof_checks/top_domains:common", |
| "//components/url_formatter/spoof_checks/top_domains:top_bucket_domains", |
| "//components/url_formatter/spoof_checks/top_domains:top_bucket_domains_header", |
| "//components/version_info:channel", |
| "//net", |
| "//services/metrics/public/cpp:metrics_cpp", |
| "//services/metrics/public/cpp:ukm_builders", |
| "//ui/base", |
| ] |
| } |
| |
| static_library("safety_tips") { |
| sources = [ |
| "safety_tip_test_utils.cc", |
| "safety_tip_test_utils.h", |
| "safety_tips_config.cc", |
| "safety_tips_config.h", |
| ] |
| configs += [ |
| "//build/config/compiler:wexit_time_destructors", |
| "//build/config/compiler:wglobal_constructors", |
| ] |
| deps = [ |
| ":proto", |
| "//components/safe_browsing/core/browser/db:v4_protocol_manager_util", |
| "//components/security_state/core", |
| "//third_party/re2", |
| "//url", |
| ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ |
| "lookalike_url_util_unittest.cc", |
| "safety_tips_config_unittest.cc", |
| ] |
| |
| deps = [ |
| ":core", |
| ":proto", |
| ":safety_tips", |
| "//components/url_formatter", |
| "//components/url_formatter/spoof_checks/common_words:common", |
| "//components/url_formatter/spoof_checks/common_words:common_words_test_dafsa", |
| "//components/url_formatter/spoof_checks/top_domains:generate_top_domains_test_trie", |
| "//components/url_formatter/spoof_checks/top_domains:test_top_bucket_domains", |
| "//components/url_formatter/spoof_checks/top_domains:test_top_bucket_domains_header", |
| "//components/version_info:channel", |
| "//net:test_support", |
| "//testing/gtest", |
| ] |
| |
| # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and |
| # enable the diagnostic by removing this line. |
| configs += [ "//build/config/compiler:no_exit_time_destructors" ] |
| } |
| |
| proto_library("proto") { |
| sources = [ "safety_tips.proto" ] |
| } |
| |
| fuzzer_test("lookalike_url_util_fuzzer") { |
| sources = [ "lookalike_url_util_fuzzer.cc" ] |
| deps = [ |
| ":core", |
| ":proto", |
| "//base:i18n", |
| "//third_party/abseil-cpp:absl", |
| "//third_party/icu", |
| ] |
| } |