build: Remove tests and minimize

This commit is contained in:
klzgrad 2021-05-16 21:03:12 +08:00
parent f67be9364c
commit e9d65a446d
18 changed files with 8 additions and 9427 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -57,16 +57,6 @@ buildflag_header("chromeos_buildflags") {
]
}
if (build_with_chromium) {
group("gold_common_pytype") {
testonly = true
data = [ "//build/skia_gold_common/" ]
data_deps = [ "//testing:pytype_dependencies" ]
}
}
if (is_chromeos) {
process_version("version_metadata") {
sources = [ "//chrome/VERSION" ]

View File

@ -9,15 +9,14 @@ import("//build/util/process_version.gni")
import("//chrome/version.gni")
import("//components/cronet/native/include/headers.gni")
import("//components/grpc_support/include/headers.gni")
import("//testing/test.gni")
declare_args() {
# If set to true, this will remove histogram manager to reduce binary size.
disable_histogram_support = is_mac || is_win
disable_histogram_support = true
}
# Disable histogram support is not allowed on Android.
assert(!disable_histogram_support || !is_android)
#assert(!disable_histogram_support || !is_android)
buildflag_header("cronet_buildflags") {
header = "cronet_buildflags.h"
@ -74,24 +73,6 @@ source_set("metrics_util") {
deps = [ "//base" ]
}
# Unit tests for Cronet common implementation.
source_set("cronet_common_unittests") {
testonly = true
deps = [
":cronet_common",
"//components/prefs:test_support",
"//net:test_support",
]
sources = [
"host_cache_persistence_manager_unittest.cc",
"network_tasks_unittest.cc",
"stale_host_resolver_unittest.cc",
"url_request_context_config_unittest.cc",
]
}
# For platforms on which the native Cronet library is used, build the library,
# a cronet_tests binary that exercises it, and a unit-tests binary.
# Android and iOS have their own platform-specific rules to build Cronet.
@ -138,50 +119,6 @@ if (is_android) {
}
}
test("cronet_tests") {
deps = [
":cronet_common",
"//base",
"//base/test:test_support",
"//components/cronet/native:cronet_native_impl",
"//components/cronet/native/test:cronet_native_tests",
"//net",
]
sources = [
"cronet_global_state_stubs.cc",
"run_all_unittests.cc",
]
defines = [ "CRONET_TESTS_IMPLEMENTATION" ]
if ((is_linux || is_chromeos) && !is_component_build) {
public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_fuchsia) {
use_cfv1 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/network.shard.test-cml" ]
}
}
test("cronet_unittests") {
deps = [
":cronet_common",
":cronet_common_unittests",
"//base",
"//base/test:test_support",
"//components/cronet/native:cronet_native_unittests",
"//net",
]
sources = [
"cronet_global_state_stubs.cc",
"run_all_unittests.cc",
]
}
_package_dir = "$root_out_dir/cronet"
# Generate LICENSE file by recursively joining all dependent licenses.
@ -227,22 +164,6 @@ if (is_android) {
]
}
executable("cronet_native_perf_test") {
testonly = true
sources = [
"native/perftest/main.cc",
"native/perftest/perf_test.cc",
]
deps = [
"//base",
"//components/cronet",
"//components/cronet/native:cronet_native_headers",
"//components/cronet/native/test:cronet_native_tests",
"//components/cronet/native/test:cronet_native_testutil",
"//net:test_support",
]
}
executable("cronet_sample") {
testonly = true
sources = [
@ -260,12 +181,4 @@ if (is_android) {
public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
}
test("cronet_sample_test") {
sources = [ "native/sample/test/sample_test.cc" ]
deps = [
":cronet_sample",
"//testing/gtest:gtest",
]
}
}

View File

@ -4,7 +4,6 @@
import("//components/cronet/native/include/headers.gni")
import("//components/grpc_support/include/headers.gni")
import("//testing/test.gni")
config("cronet_native_include_config") {
include_dirs = [
@ -70,29 +69,3 @@ source_set("cronet_native_impl") {
"generated/cronet.idl_impl_struct.cc",
]
}
# Unit tests for Cronet native API. Depends on cronet_native_impl to test
# implementation details.
source_set("cronet_native_unittests") {
testonly = true
deps = [
":cronet_native_impl",
"//base/test:test_support",
"//components/cronet/native/test:cronet_native_testutil",
"//net:test_support",
"//testing/gtest",
]
configs += [ ":cronet_native_include_config" ]
sources = [
"engine_unittest.cc",
"native_metrics_util_test.cc",
"runnables_unittest.cc",
# Generated from cronet.idl.
"generated/cronet.idl_impl_interface_unittest.cc",
"generated/cronet.idl_impl_struct_unittest.cc",
]
}

View File

@ -17,33 +17,3 @@ source_set("grpc_support") {
"//url",
]
}
# Depends on ":grpc_support" implementation.
source_set("bidirectional_stream_unittest") {
testonly = true
sources = [ "bidirectional_stream_unittest.cc" ]
deps = [
":grpc_support",
"//base",
"//net",
"//net:test_support",
]
public_deps = [ "//components/grpc_support/test:get_stream_engine_header" ]
}
# Depends on ":headers" to avoid ":grpc_support" implementation.
source_set("bidirectional_stream_test") {
testonly = true
sources = [ "bidirectional_stream_unittest.cc" ]
deps = [
":headers",
"//base",
"//net",
"//net:test_support",
]
public_deps = [ "//components/grpc_support/test:get_stream_engine_header" ]
}

View File

@ -66,55 +66,3 @@ component("prefs") {
deps += [ "android:jni_headers" ]
}
}
static_library("test_support") {
testonly = true
sources = [
"mock_pref_change_callback.cc",
"mock_pref_change_callback.h",
"pref_store_observer_mock.cc",
"pref_store_observer_mock.h",
"pref_test_utils.cc",
"pref_test_utils.h",
"testing_pref_service.cc",
"testing_pref_service.h",
"testing_pref_store.cc",
"testing_pref_store.h",
]
public_deps = [ ":prefs" ]
deps = [
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"default_pref_store_unittest.cc",
"in_memory_pref_store_unittest.cc",
"json_pref_store_unittest.cc",
"overlay_user_pref_store_unittest.cc",
"persistent_pref_store_unittest.cc",
"persistent_pref_store_unittest.h",
"pref_change_registrar_unittest.cc",
"pref_member_unittest.cc",
"pref_notifier_impl_unittest.cc",
"pref_service_unittest.cc",
"pref_value_map_unittest.cc",
"pref_value_store_unittest.cc",
"scoped_user_pref_update_unittest.cc",
"segregated_pref_store_unittest.cc",
]
deps = [
":test_support",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}

View File

@ -29,24 +29,6 @@ static_library("version_info") {
]
}
# Isolate the //ui/base dependency in this target.
static_library("version_string") {
sources = [
"version_string.cc",
"version_string.h",
]
deps = [
":version_info",
"//components/strings",
]
if (use_unofficial_version_number) {
defines = [ "USE_UNOFFICIAL_VERSION_NUMBER" ]
deps += [ "//ui/base" ]
}
}
source_set("channel") {
sources = [ "channel.h" ]
}

View File

@ -5,7 +5,6 @@
import("//build/buildflag_header.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//crypto/features.gni")
import("//testing/test.gni")
buildflag_header("buildflags") {
header = "crypto_buildflags.h"
@ -144,70 +143,10 @@ component("crypto") {
defines = [ "CRYPTO_IMPLEMENTATION" ]
}
test("crypto_unittests") {
sources = [
"aead_unittest.cc",
"ec_private_key_unittest.cc",
"ec_signature_creator_unittest.cc",
"encryptor_unittest.cc",
"hmac_unittest.cc",
"p224_spake_unittest.cc",
"random_unittest.cc",
"rsa_private_key_unittest.cc",
"secure_hash_unittest.cc",
"sha2_unittest.cc",
"signature_creator_unittest.cc",
"signature_verifier_unittest.cc",
"symmetric_key_unittest.cc",
"unexportable_key_unittest.cc",
]
# Some files are built when NSS is used for the platform certificate library.
if (use_nss_certs) {
sources += [
"nss_key_util_unittest.cc",
"nss_util_unittest.cc",
]
configs += [ "//build/config/linux/nss" ]
config("platform_config") {
if (use_nss_certs && is_clang) {
# There is a broken header guard in /usr/include/nss/secmod.h:
# https://bugzilla.mozilla.org/show_bug.cgi?id=884072
cflags = [ "-Wno-header-guard" ]
}
deps = [
":crypto",
":test_support",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}
static_library("test_support") {
testonly = true
sources = [
"scoped_mock_unexportable_key_provider.cc",
"scoped_mock_unexportable_key_provider.h",
]
if (use_nss_certs) {
sources += [
"scoped_test_nss_db.cc",
"scoped_test_nss_db.h",
]
configs += [ "//build/config/linux/nss" ]
}
if (is_chromeos_ash) {
sources += [
"scoped_test_nss_chromeos_user.cc",
"scoped_test_nss_chromeos_user.h",
"scoped_test_system_nss_key_slot.cc",
"scoped_test_system_nss_key_slot.h",
]
}
deps = [
":crypto",
"//base",
]
}

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,6 @@
# found in the LICENSE file.
import("//net/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/protobuf/proto_library.gni")
enable_built_in_dns = !is_ios
@ -17,12 +15,7 @@ source_set("dns") {
# Internals only intended for use inside network stack (and tests).
friend = [
"//chrome/browser:test_support",
"//chrome/test/*",
"//components/certificate_transparency:unit_tests",
"//components/cronet/*",
"//net/*",
"//services/network/*",
]
public = []
@ -186,30 +179,7 @@ source_set("host_resolver") {
# Restricted access so we can keep track of all usage external to the
# network stack and network service.
friend = [
# chromecast/browser/url_request_context_factory.cc
# URLRequestContext creation for chromecast.
"//chromecast/browser",
# URLRequestContext and HttpNetworkSession::Context creation for iOS.
"//ios/components/io_thread",
"//ios/web/shell",
"//ios/web_view:*",
# Tests and test support.
"//chrome/browser:test_support",
"//chrome/test/*",
"//components/grpc_support/test:unit_tests",
"//content/shell:content_shell_lib",
"//content/test:*",
# Stand-alone tools.
"//google_apis/gcm:mcs_probe",
# Network stack/service.
"//components/certificate_transparency/*",
"//components/cronet/*",
"//net/*",
"//services/network/*",
]
sources = [
@ -249,16 +219,7 @@ source_set("host_resolver_manager") {
# Restricted access so we can keep track of all usage external to the
# network stack and network service.
friend = [
# chromecast/browser/url_request_context_factory.cc
# URLRequestContext creation for chromecast.
"//chromecast/browser",
# Tests and test support.
"//components/cronet:cronet_common_unittests",
# Network stack/service.
"//net/*",
"//services/network/*",
]
sources = [ "host_resolver_manager.h" ]
@ -288,24 +249,7 @@ source_set("dns_client") {
# Restricted access so we can keep track of all usage external to the
# network stack.
friend = [
# chrome/browser/local_discovery/service_discovery_client_impl.cc
# Result parsing utilities for parsing results read through MdnsClient.
# TODO(crbug.com/874662): Remove once migrated to network service.
"//chrome/browser",
# chrome/browser/ash/smb_client/discovery/mdns_host_locator.cc
# Result parsing for results read through MdnsClient.
# TODO(crbug.com/902531): Remove once migrated to network service.
"//chrome/browser/chromeos",
# Tests and test support
"//chrome/browser:test_support",
"//chrome/test/*",
# Network stack/service
"//components/certificate_transparency/*",
"//net/*",
"//services/network/*",
]
sources = [
@ -342,29 +286,7 @@ source_set("mdns_client") {
# Restricted access so we can keep track of all usage external to the
# network stack.
friend = [
# chrome/browser/local_discovery/service_discovery_client_mdns.h
# chrome/browser/local_discovery/service_discovery_client_impl.h
# Makes MDNS queries using MDnsClient.
# TODO(crbug.com/874662): Remove once migrated to network service.
"//chrome/browser",
# chrome/tools/service_discovery_sniffer/service_discovery_sniffer.cc
# Creates MDnsClient instance and passes to ServiceDiscoveryClientImpl.
# TODO(crbug.com/874662): Remove once discovery client migrated.
"//chrome/tools/service_discovery_sniffer",
# chrome/browser/ash/smb_client/discovery/mdns_host_locator.h
# chrome/browser/ash/smb_client/discovery/mdns_host_locator.cc
# Makes MDNS queries using MDnsClient.
# TODO(crbug.com/902531): Remove once migrated to network service.
"//chrome/browser/chromeos",
# Tests and test support
"//chrome/browser:test_support",
# Network stack/service
"//net/*",
"//services/network/*",
]
public = []
@ -381,232 +303,3 @@ source_set("mdns_client") {
]
public_deps = [ "//net:net_public_deps" ]
}
source_set("tests") {
testonly = true
sources = [
"address_info_unittest.cc",
"context_host_resolver_unittest.cc",
"dns_alias_utility_unittest.cc",
"dns_config_service_unittest.cc",
"dns_hosts_unittest.cc",
"dns_query_unittest.cc",
"dns_response_result_extractor_unittest.cc",
"dns_response_unittest.cc",
"dns_transaction_unittest.cc",
"dns_udp_tracker_unittest.cc",
"dns_util_unittest.cc",
"host_cache_unittest.cc",
"host_resolver_manager_unittest.cc",
"https_record_rdata_unittest.cc",
"httpssvc_metrics_unittest.cc",
"mapped_host_resolver_unittest.cc",
"nsswitch_reader_unittest.cc",
"opt_record_rdata_unittest.cc",
"record_parsed_unittest.cc",
"record_rdata_unittest.cc",
"resolve_context_unittest.cc",
"serial_worker_unittest.cc",
"system_dns_config_change_notifier_unittest.cc",
]
if (is_win) {
sources += [ "dns_config_service_win_unittest.cc" ]
}
if (is_android) {
sources += [ "dns_config_service_android_unittest.cc" ]
} else if (is_linux) {
sources += [ "dns_config_service_linux_unittest.cc" ]
} else if (is_posix) {
sources += [ "dns_config_service_posix_unittest.cc" ]
}
if (enable_built_in_dns) {
sources += [
"address_sorter_unittest.cc",
"dns_client_unittest.cc",
]
if (is_posix || is_fuchsia) {
sources += [ "address_sorter_posix_unittest.cc" ]
}
}
if (enable_mdns) {
sources += [
"mdns_cache_unittest.cc",
"mdns_client_unittest.cc",
]
}
deps = [
"//base",
"//net",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
]
}
source_set("test_support") {
visibility = [ "//net:test_support" ]
testonly = true
sources = [
"dns_test_util.cc",
"host_resolver_results_test_util.cc",
"mock_host_resolver.cc",
]
public = [
"dns_test_util.h",
"host_resolver_results_test_util.h",
"mock_host_resolver.h",
]
if (enable_mdns) {
sources += [
"mock_mdns_client.cc",
"mock_mdns_socket_factory.cc",
]
public += [
"mock_mdns_client.h",
"mock_mdns_socket_factory.h",
]
}
deps = [
"//base",
"//net",
"//testing/gmock",
"//testing/gtest",
]
}
if (use_fuzzing_engine) {
# fuzzer_test targets are no-op when |use_fuzzing_engine| is false. Fuzzer
# support targets should be disabled too.
source_set("fuzzer_test_support") {
testonly = true
sources = [
"fuzzed_host_resolver_util.cc",
"fuzzed_host_resolver_util.h",
]
deps = [
"//base",
"//base/test:test_support",
"//net",
]
}
}
proto_library("host_cache_fuzzer_proto") {
proto_in_dir = "//"
sources = [ "host_cache_fuzzer.proto" ]
deps = [ "//testing/libfuzzer/proto:json_proto" ]
}
fuzzer_test("net_dns_host_cache_fuzzer") {
sources = [ "host_cache_fuzzer.cc" ]
deps = [
":host_cache_fuzzer_proto",
"//base",
"//net",
"//net:net_fuzzer_test_support",
"//testing/libfuzzer/proto:json_proto",
"//testing/libfuzzer/proto:json_proto_converter",
"//third_party/libprotobuf-mutator",
]
dict = "//testing/libfuzzer/fuzzers/dicts/json.dict"
}
fuzzer_test("net_dns_hosts_parse_fuzzer") {
sources = [ "dns_hosts_parse_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_dns_hosts_parse_fuzzer.dict"
}
fuzzer_test("net_dns_https_record_rdata_fuzzer") {
sources = [ "https_record_rdata_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
}
fuzzer_test("net_dns_integrity_record_fuzzer") {
sources = [ "integrity_record_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
}
fuzzer_test("net_dns_nsswitch_reader_fuzzer") {
sources = [ "nsswitch_reader_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_dns_nsswitch_reader_fuzzer.dict"
}
fuzzer_test("net_dns_record_fuzzer") {
sources = [ "dns_record_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
}
fuzzer_test("net_dns_query_parse_fuzzer") {
sources = [ "dns_query_parse_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
}
fuzzer_test("net_dns_response_fuzzer") {
sources = [ "dns_response_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
}
fuzzer_test("net_host_resolver_manager_fuzzer") {
sources = [ "host_resolver_manager_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
"//net:test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_host_resolver_manager_fuzzer.dict"
}
if (is_win) {
fuzzer_test("net_dns_parse_domain_ascii_win_fuzzer") {
sources = [ "dns_parse_domain_ascii_win_fuzzer.cc" ]
deps = [
"//base",
"//net",
"//net:net_fuzzer_test_support",
]
dict = "//net/data/fuzzer_dictionaries/net_dns_hosts_parse_fuzzer.dict"
seed_corpus = "//net/data/fuzzer_data/dns_parse_domain_ascii_win_fuzzer"
}
}

View File

@ -59,32 +59,3 @@ source_set("public") {
public_deps = [ "//net:net_public_deps" ]
}
if (is_android) {
java_cpp_enum("secure_dns_mode_generated_enum") {
sources = [ "secure_dns_mode.h" ]
}
}
source_set("tests") {
testonly = true
sources = [
"dns_over_https_config_unittest.cc",
"dns_over_https_server_config_unittest.cc",
"doh_provider_entry_unittest.cc",
]
if (is_posix && !is_android) {
sources += [ "resolv_reader_unittest.cc" ]
}
if (is_win) {
sources += [ "win_dns_system_settings_unittest.cc" ]
}
deps = [
"//net",
"//testing/gmock",
"//testing/gtest",
]
}

File diff suppressed because it is too large Load Diff

View File

@ -17,19 +17,3 @@ source_set("huffman_trie_generator_sources") {
]
deps = [ "//base" ]
}
source_set("huffman_trie_generator_test_sources") {
testonly = true
sources = [
"bit_writer_unittest.cc",
"huffman/huffman_builder_unittest.cc",
"trie/trie_bit_buffer_unittest.cc",
]
deps = [
":huffman_trie_generator_sources",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}

View File

@ -28,23 +28,6 @@ source_set("transport_security_state_generator_sources") {
]
}
source_set("transport_security_state_generator_test_sources") {
testonly = true
sources = [
"cert_util_unittest.cc",
"input_file_parsers_unittest.cc",
"spki_hash_unittest.cc",
]
deps = [
":transport_security_state_generator_sources",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/boringssl",
]
}
executable("transport_security_state_generator") {
sources = [ "transport_security_state_generator.cc" ]
deps = [

View File

@ -7,7 +7,6 @@ import("//build/config/arm.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("BUILD.generated.gni")
import("BUILD.generated_tests.gni")

View File

@ -2,8 +2,6 @@
# 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")
if (is_win) {
import("//build/config/win/visual_studio_version.gni")
}
@ -193,9 +191,3 @@ if (current_toolchain == host_toolchain) {
}
}
}
fuzzer_test("brotli_fuzzer") {
sources = [ "fuzz/decode_fuzzer.cc" ]
deps = [ ":dec" ]
libfuzzer_options = [ "max_len=1280" ]
}

View File

@ -3,8 +3,6 @@
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("features.gni")
if (is_android) {
@ -62,7 +60,6 @@ component("url") {
deps = [
"//base/third_party/dynamic_annotations",
"//ipc:param_traits",
]
if (is_win) {
@ -100,266 +97,3 @@ component("url") {
]
}
}
if (is_android) {
source_set("gurl_android") {
sources = [
"android/gurl_android.cc",
"android/gurl_android.h",
"android/parsed_android.cc",
"android/parsed_android.h",
]
deps = [
":gurl_jni_headers",
":url",
"//base:base",
]
}
static_library("origin_android") {
sources = [ "android/origin_android.cc" ]
deps = [
":url",
":url_jni_headers",
"//base",
"//url/mojom:url_mojom_origin",
]
}
android_library("url_java") {
sources = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ]
deps = [ "//base:jni_java" ]
}
android_library("gurl_java") {
sources = [
"android/java/src/org/chromium/url/GURL.java",
"android/java/src/org/chromium/url/Parsed.java",
"android/java/src/org/chromium/url/URI.java",
]
deps = [
"//base:base_java",
"//base:jni_java",
"//build/android:build_java",
"//third_party/android_deps:com_google_errorprone_error_prone_annotations_java",
"//third_party/androidx:androidx_annotation_annotation_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
android_library("origin_java") {
sources = [ "android/java/src/org/chromium/url/Origin.java" ]
deps = [
"//base:jni_java",
"//mojo/public/java:bindings_java",
"//mojo/public/mojom/base:base_java",
"//url/mojom:url_mojom_origin_java",
]
}
generate_jni("url_jni_headers") {
sources = [
"android/java/src/org/chromium/url/IDNStringUtil.java",
"android/java/src/org/chromium/url/Origin.java",
]
}
generate_jni("gurl_jni_headers") {
sources = [
"android/java/src/org/chromium/url/GURL.java",
"android/java/src/org/chromium/url/Parsed.java",
]
}
}
source_set("url_test_support") {
testonly = true
sources = [
"gurl_abstract_tests.h",
"origin_abstract_tests.cc",
"origin_abstract_tests.h",
]
public_deps = [
":url",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}
test("url_unittests") {
sources = [
"gurl_unittest.cc",
"origin_unittest.cc",
"run_all_unittests.cc",
"scheme_host_port_unittest.cc",
"url_canon_icu_unittest.cc",
"url_canon_unittest.cc",
"url_parse_unittest.cc",
"url_test_utils.h",
"url_util_unittest.cc",
]
deps = [
":url",
":url_test_support",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
if (use_platform_icu_alternatives) {
# Unit tests that are not supported by the current ICU alternatives on Android.
if (is_android) {
sources -= [
"url_canon_icu_unittest.cc",
"url_canon_unittest.cc",
]
deps += [ ":url_java" ]
}
# Unit tests that are not supported by the current ICU alternatives on iOS.
if (is_ios) {
sources -= [
"origin_unittest.cc",
"scheme_host_port_unittest.cc",
"url_canon_icu_unittest.cc",
"url_canon_unittest.cc",
]
}
} else { # !use_platform_icu_alternatives
deps += [ "//third_party/icu:icuuc" ]
}
if (!is_ios) {
sources += [
"mojom/scheme_host_port_mojom_traits_unittest.cc",
"mojom/url_gurl_mojom_traits_unittest.cc",
]
deps += [
"//mojo/core/embedder",
"//mojo/public/cpp/test_support:test_utils",
"//url/ipc:url_ipc_unittests",
"//url/mojom:mojom_traits",
"//url/mojom:test_url_mojom_gurl",
]
}
}
test("url_perftests") {
sources = [
"run_all_perftests.cc",
"url_parse_perftest.cc",
]
deps = [
":url",
"//base",
"//base/test:test_support",
"//testing/gtest",
]
}
fuzzer_test("gurl_fuzzer") {
sources = [ "gurl_fuzzer.cc" ]
deps = [
":url",
"//base",
"//base:i18n",
]
dict = "gurl_fuzzer.dict"
}
if (is_android) {
source_set("gurl_android_test_helper") {
testonly = true
sources = [ "android/gurl_java_test_helper.cc" ]
deps = [
":gurl_android",
":gurl_j_test_jni_headers",
":url",
"//base/test:test_support",
"//testing/gtest",
]
}
android_library("gurl_android_test_helper_java") {
testonly = true
sources =
[ "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java" ]
deps = [
":gurl_java",
"//base:base_java_test_support",
"//base:jni_java",
]
}
# Targets depending on gurl_junit_test_support do not need to bypass platform
# checks.
android_library("gurl_junit_test_support") {
testonly = true
sources = [ "android/test/java/src/org/chromium/url/JUnitTestGURLs.java" ]
deps = [ ":gurl_java" ]
}
# Unlike gurl_junit_test_support targets depending on gurl_junit_shadows must
# bypass platform checks.
robolectric_library("gurl_junit_shadows") {
sources = [ "android/test/java/src/org/chromium/url/ShadowGURL.java" ]
deps = [
":gurl_java",
":gurl_junit_test_support",
]
}
android_library("gurl_java_unit_tests") {
testonly = true
sources = [
"android/javatests/src/org/chromium/url/GURLJavaTest.java",
"android/javatests/src/org/chromium/url/JUnitTestGURLsTest.java",
]
deps = [
":gurl_android_test_helper_java",
":gurl_java",
":gurl_junit_test_support",
"//base:base_java",
"//base:base_java_test_support",
"//base:jni_java",
"//content/public/test/android:content_java_test_support",
"//third_party/android_support_test_runner:rules_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/androidx:androidx_core_core_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
# See https://bugs.chromium.org/p/chromium/issues/detail?id=908819 for why we
# can't put 'java' in the name here.
generate_jni("gurl_j_test_jni_headers") {
testonly = true
sources =
[ "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java" ]
}
robolectric_library("gurl_junit_tests") {
sources = [ "android/junit/src/org/chromium/url/ShadowGURLTest.java" ]
deps = [
":gurl_java",
":gurl_junit_shadows",
":gurl_junit_test_support",
"//base:base_java_test_support",
"//base:base_junit_test_support",
"//base/test:test_support_java",
"//third_party/junit",
]
}
}