blob: 71cae2387dda86f0632a240eb65185c425915977 [file] [log] [blame]
# Copyright 2024 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/test.gni")
import("//third_party/protobuf/proto_library.gni")
source_set("unit_tests") {
testonly = true
deps = [
"//components/ip_protection/common:ip_protection_config_http_unittest",
"//components/ip_protection/common:ip_protection_core_impl_mojo_unittest",
"//components/ip_protection/common:ip_protection_core_impl_unittest",
"//components/ip_protection/common:ip_protection_data_types_unittest",
"//components/ip_protection/common:ip_protection_performance_hooks_unittest",
"//components/ip_protection/common:ip_protection_probabilistic_reveal_token_crypter_unittest",
"//components/ip_protection/common:ip_protection_probabilistic_reveal_token_data_storage_unittest",
"//components/ip_protection/common:ip_protection_probabilistic_reveal_token_direct_fetcher_unittest",
"//components/ip_protection/common:ip_protection_probabilistic_reveal_token_manager_unittest",
"//components/ip_protection/common:ip_protection_probabilistic_reveal_token_mojo_fetcher_unittest",
"//components/ip_protection/common:ip_protection_proxy_config_direct_fetcher_unittest",
"//components/ip_protection/common:ip_protection_proxy_config_manager_impl_unittest",
"//components/ip_protection/common:ip_protection_proxy_config_mojo_fetcher_unittest",
"//components/ip_protection/common:ip_protection_proxy_delegate_unittest",
"//components/ip_protection/common:ip_protection_token_direct_fetcher_unittest",
"//components/ip_protection/common:ip_protection_token_manager_impl_unittest",
"//components/ip_protection/common:ip_protection_token_mojo_fetcher_unittest",
"//components/ip_protection/common:ip_protection_url_request_http_job_unittest",
"//components/ip_protection/common:masked_domain_list_manager_unittest",
"//components/ip_protection/common:masked_domain_list_unittest",
"//components/ip_protection/common:mock_blind_sign_auth",
"//components/ip_protection/common:probabilistic_reveal_token_registry_unittest",
"//components/ip_protection/common:probabilistic_reveal_token_test_consumer_unittest",
"//components/ip_protection/common:probabilistic_reveal_token_test_issuer_unittest",
# Select UMA as the implementation of `ip_protection::Telemetry()`.
"//components/ip_protection/common:ip_protection_telemetry_uma",
]
# Unit tests cannot be run on iOS because they depend on Blink.
if (use_blink) {
deps +=
[ "//components/ip_protection/common:ip_protection_status_unittest" ]
}
data = [ "//components/test/data/ip_protection/" ]
}
# A unit test binary that only runs tests for this component. This is useful
# during development, but these tests are typically run as part of
# `//components:components_unittests`.
# Note: This test is not run on iOS because it depends on Blink.
if (use_blink) {
test("components_ip_protection_unittests") {
sources = [ "test/run_all_unittests.cc" ]
deps = [
"//base",
"//base/test:test_support",
"//components/ip_protection:unit_tests",
"//content/test:test_support",
"//mojo/core/embedder",
"//testing/gtest",
]
}
}
test("components_ip_protection_fuzztests") {
sources =
[ "common/ip_protection_probabilistic_reveal_token_crypter_fuzztests.cc" ]
fuzztests = [
"IpProtectionProbabilisticRevealTokenCrypterFuzzTests.CreateDoesNotCrash",
"IpProtectionProbabilisticRevealTokenCrypterFuzzTests.RandomizeDoesNotCrash",
]
deps = [
"//base",
"//components/ip_protection:get_probabilistic_reveal_token_proto",
"//components/ip_protection/common:ip_protection_probabilistic_reveal_token_crypter",
"//components/ip_protection/common:probabilistic_reveal_token_test_issuer",
"//testing/gmock",
"//third_party/abseil-cpp:absl",
"//third_party/boringssl",
"//third_party/fuzztest:fuzztest_gtest_main",
# Select UMA as the implementation of `ip_protection::Telemetry()`.
"//components/ip_protection/common:ip_protection_telemetry_uma",
]
}
proto_library("get_proxy_config_proto") {
sources = [ "get_proxy_config.proto" ]
}
proto_library("get_probabilistic_reveal_token_proto") {
sources = [ "get_probabilistic_reveal_token.proto" ]
}
if (is_android) {
import("//build/config/android/rules.gni")
proto_java_library("get_proxy_config_proto_java") {
sources = [ "get_proxy_config.proto" ]
proto_path = "./"
}
}