From 61e89ce08efe416509a1c7ab18658d8fba708260 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sun, 16 May 2021 21:03:12 +0800 Subject: [PATCH] build: Remove tests and minimize --- src/BUILD.gn | 1757 +---------- src/base/BUILD.gn | 2781 +---------------- src/base/numerics/BUILD.gn | 10 - .../miracle_parameter/common/BUILD.gn | 14 - .../network_time/time_tracker/BUILD.gn | 12 - src/crypto/BUILD.gn | 125 - src/net/BUILD.gn | 2191 ------------- src/net/dns/BUILD.gn | 326 -- src/net/dns/public/BUILD.gn | 29 - src/net/third_party/quiche/BUILD.gn | 827 ----- src/net/third_party/uri_template/BUILD.gn | 22 - src/net/tools/huffman_trie/BUILD.gn | 16 - .../BUILD.gn | 17 - src/third_party/brotli/BUILD.gn | 8 - src/third_party/googletest/BUILD.gn | 1 - src/url/BUILD.gn | 279 -- 16 files changed, 3 insertions(+), 8412 deletions(-) diff --git a/src/BUILD.gn b/src/BUILD.gn index b1a8b7eaab..0fbf313d29 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -8,8 +8,6 @@ # you add a new build file, there must be some path of dependencies from this # file to your new one or GN won't know about it. -import("//build/config/cast.gni") -import("//build/config/chromeos/ui_mode.gni") import("//build/config/compiler/compiler.gni") import("//build/config/cronet/config.gni") import("//build/config/dcheck_always_on.gni") @@ -19,46 +17,11 @@ import("//build/config/rust.gni") import("//build/config/sanitizers/sanitizers.gni") import("//build/config/ui.gni") import("//build/gn_logs.gni") -import("//build/util/generate_wrapper.gni") -import("//chrome/enterprise_companion/buildflags.gni") -import("//components/enterprise/buildflags/buildflags.gni") -import("//components/nacl/features.gni") -import("//device/vr/buildflags/buildflags.gni") -import("//extensions/buildflags/buildflags.gni") -import("//gpu/vulkan/features.gni") -import("//media/gpu/args.gni") -import("//media/media_options.gni") -import("//pdf/features.gni") -import("//ppapi/buildflags/buildflags.gni") -import("//printing/buildflags/buildflags.gni") -import("//remoting/remoting_enable.gni") -import("//services/on_device_model/on_device_model.gni") -import("//third_party/closure_compiler/compile_js.gni") -import("//tools/ipc_fuzzer/ipc_fuzzer.gni") -import("//ui/base/ui_features.gni") -import("//ui/gl/features.gni") -import("//v8/gni/v8.gni") if (is_android) { import("//build/config/android/config.gni") } -if (is_fuchsia) { - import("//build/config/fuchsia/generate_runner_scripts.gni") - import("//third_party/fuchsia-gn-sdk/src/component.gni") - import("//third_party/fuchsia-gn-sdk/src/package.gni") -} else { - import("//chrome/browser/buildflags.gni") -} - -if (is_linux) { - import("build/config/linux/gtk/gtk.gni") -} - -if (use_blink) { - import("//v8/gni/snapshot_toolchain.gni") -} - declare_args() { # A list of extra dependencies to add to the root target. This allows a # checkout to add additional targets without explicitly changing any checked- @@ -85,1712 +48,9 @@ if (is_official_build) { group("gn_all") { testonly = true - if (is_cronet_build) { - if (is_android) { - deps = [ "//components/cronet/android:cronet_package_android" ] - } else { - deps = [] - } - } else { - deps = [ - "//base:base_perftests", - "//base:base_unittests", - "//codelabs", - "//components:components_unittests", - "//components/gwp_asan:gwp_asan_unittests", - "//infra/orchestrator:orchestrator_all", - "//net:net_unittests", - "//sandbox:sandbox_unittests", - "//services:services_unittests", - "//services/service_manager/public/cpp", - "//skia:skia_unittests", - "//sql:sql_unittests", - "//testing/libfuzzer/tests", - "//third_party/angle/src/tests:angle_end2end_tests", - "//third_party/angle/src/tests:angle_unittests", - "//third_party/angle/src/tests:angle_white_box_tests", - "//third_party/distributed_point_functions/shim:distributed_point_functions_shim_unittests", - "//third_party/flatbuffers:flatbuffers_unittests", - "//third_party/liburlpattern:liburlpattern_unittests", - "//third_party/rapidhash:rapidhash_fuzztests", - "//tools/binary_size:binary_size_trybot_py", - "//tools/ipc_fuzzer:ipc_fuzzer_all", - "//tools/metrics:metrics_metadata", - "//ui/base:ui_base_unittests", - "//ui/gfx:gfx_unittests", - "//ui/tests:ui_unittests", - "//url:url_unittests", - ] - - if (current_cpu == "arm64" && is_android && host_os == "linux") { - deps += [ - "//components/allocation_recorder/tools:dump_allocation_recorder_data", - ] - } - - if (!is_component_build) { - deps += [ "//third_party/abseil-cpp:absl_tests" ] - } - - if (is_chromeos_ash && enable_js_type_check) { - deps += [ ":webui_closure_compile" ] - } - - if (!is_android && !is_castos) { - deps += [ - "//crypto:crypto_unittests", - "//google_apis/gcm:gcm_unit_tests", - ] - } - - if (!is_ios && !is_android && !is_castos) { - if (!is_fuchsia) { - deps += [ - "//chrome", - "//chrome/browser/ui/actions:dump_actions", - "//chrome/browser/ui/color:dump_colors", - "//chrome/test:browser_tests", - ] - } - deps += [ - "//components/subresource_filter/tools:subresource_filter_tools", - "//components/zucchini:zucchini", - "//net:hpack_example_generator", - "//third_party/spirv-tools/src:SPIRV-Tools", - "//tools/aggregation_service:aggregation_service_tool", - "//tools/perf/clear_system_cache", - "//tools/polymer:polymer_tools_python_unittests", - "//tools/privacy_budget:privacy_budget_tools", - "//ui/accessibility/extensions:extensions", - ] - } - - if (!is_castos && !is_fuchsia) { - deps += [ "//chrome/installer" ] - } - - if (!is_fuchsia && enable_updater) { - deps += [ "//chrome/updater" ] - } - - if (enable_enterprise_companion) { - deps += [ "//chrome/enterprise_companion" ] - } - - if (enable_ppapi) { - deps += [ - "//ppapi:ppapi_unittests", - "//ppapi/examples", - ] - } - - if (!is_ios && !is_castos) { - if (!is_fuchsia) { - deps += [ "//chrome/test:unit_tests" ] - } - deps += [ "//ui/accessibility:accessibility_unittests" ] - } - - if (use_blink) { - deps += [ - "//cc:cc_unittests", - "//components/policy:policy_templates", - "//components/url_formatter/tools:format_url", - "//components/viz:viz_perftests", - "//components/viz:viz_unittests", - "//content/shell:content_shell", - "//content/test:content_browsertests", - "//content/test:content_unittests", - "//device:device_unittests", - "//gpu:gpu_benchmark", - "//gpu:gpu_unittests", - "//media:media_unittests", - "//media/capture:capture_unittests", - "//media/cast:cast_unittests", - "//media/midi:midi_unittests", - "//media/mojo:media_mojo_unittests", - "//mojo", - "//mojo:mojo_unittests", - "//storage:storage_unittests", - "//third_party/blink/common:blink_common_unittests", - "//third_party/blink/renderer/controller:blink_unittests", - "//third_party/blink/renderer/platform:blink_platform_unittests", - "//third_party/blink/renderer/platform/heap:blink_heap_unittests", - "//third_party/blink/renderer/platform/wtf:wtf_unittests", - "//third_party/libjingle_xmpp:libjingle_xmpp_unittests", - "//tools/imagediff", - "//tools/memory:all", - "//ui/display:display_unittests", - "//ui/gl:gl_unittests", - "//ui/latency:latency_unittests", - "//ui/native_theme:native_theme_unittests", - "//ui/touch_selection:ui_touch_selection_unittests", - "//v8:gn_all", - ] - - if (!v8_use_external_startup_data) { - deps += [ "//v8:v8_snapshot" ] - } - } - - if (!is_ios) { - deps += [ - ":chromedriver_group", - "//components:components_browsertests", - "//ipc:ipc_tests", - "//net:net_perftests", - "//ui/events:events_unittests", - "//url/ipc:url_ipc_unittests", - ] - } - - if (!is_ios && !is_android) { - deps += [ "//components/viz/demo:viz_demo" ] - } - - if (!is_ios) { - deps += [ - "//google_apis/gcm:mcs_probe", - "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", - ] - if (!is_android) { - if (!is_castos && !is_fuchsia) { - deps += [ "//chrome/test:telemetry_perf_unittests" ] - } - } else { - import("//tools/perf/chrome_telemetry_build/android_browser_types.gni") - foreach(_target_suffix, telemetry_android_browser_target_suffixes) { - deps += [ "//chrome/test:telemetry_perf_unittests${_target_suffix}" ] - } - } - } else { - deps += [ - "//ios:all", - "//third_party/crashpad/crashpad:crashpad_tests", - ] - } - - if (is_fuchsia) { - # Add targets that only exist on Fuchsia. - deps += [ - ":d8_fuchsia", - "//build/fuchsia/cipd", - "//fuchsia_web:gn_all", - "//tools/fuchsia/size_tests:fuchsia_sizes", - - # Ensure this target continues to build. - "//chromecast/bindings:bindings_manager_fuchsia", - ] - } - - deps += root_extra_deps - - if (enable_printing || enable_printing_tests) { - deps += [ "//printing:printing_unittests" ] - } - - if (enable_extensions) { - deps += [ - "//extensions:extensions_browsertests", - "//extensions:extensions_unittests", - "//extensions/browser/api/declarative_net_request/filter_list_converter", - "//extensions/shell:app_shell_unittests", - ] - } - - if (enable_ml_internal) { - deps += - [ "//components/optimization_guide/internal:ondevice_model_example" ] - } - - if (enable_pdf) { - deps += [ - "//pdf/pdfium/fuzzers", - "//third_party/pdfium/testing:pdfium_test", - ] - } - - if (enable_remoting) { - deps += [ "//remoting:remoting_all" ] - } - - if (toolkit_views) { - deps += [ - "//ui/views:views_unittests", - "//ui/views/examples:views_examples", - "//ui/views/examples:views_examples_unittests", - "//ui/views/examples:views_examples_with_content", - ] - } - - if (enterprise_watermark) { - deps += [ "//chrome/browser/enterprise/watermark:watermark_app" ] - } - - if (use_aura) { - deps += [ - "//ui/aura:aura_demo", - "//ui/aura:aura_unittests", - "//ui/wm:wm_unittests", - ] - } - - if (use_aura || is_mac) { - deps += [ "//ui/webui/examples:webui_examples" ] - } - - if (use_ozone) { - deps += [ - "//ui/ozone", - "//ui/ozone:unittests", - ] - if (!is_fuchsia) { - deps += [ "//ui/ozone/demo" ] - } - } - - if (is_win) { - deps += [ - "//chrome/credential_provider", - "//chrome/credential_provider/test:gcp_unittests", - ] - - if (enable_platform_experience) { - deps += [ - "//chrome/browser/platform_experience/win:platform_experience_helper", - ] - } - } - - if (is_mac) { - deps += [ - "//chrome/installer/gcapi_mac:gcapi_example", - "//tools/mac", - ] - } - - # Allow building md5sum tool for other OSes (android is added below). - # For Windows, see: crbug.com/1090428. - # TODO(cavalcantii): move it out of 'android' folder. - if (!is_win) { - deps += [ "//tools/android/md5sum" ] - } - - if (is_android) { - deps += [ - "//base:base_junit_tests", - "//base/android/linker:chromium_android_linker", - "//build/android/gyp/test:hello_world", - "//build/android/stacktrace:java_deobfuscate", - "//build/config/android/test/proto:test_build_protos", - "//build/private_code_test:private_paths", - "//chrome/android/monochrome:monochrome_public_apk_checker", - "//chrome/android/webapk/shell_apk:webapk", - "//chrome/android/webapk/shell_apk/prepare_upload_dir:prepare_webapk_shell_upload_dir", - "//chrome/test:android_browsertests", - "//components:components_junit_tests", - "//content/public/android:content_junit_tests", - "//content/shell/android:content_shell_apk", - "//device:device_junit_tests", - "//media/gpu:video_decode_accelerator_unittest", - "//net/android:net_junit_tests", - "//services:services_junit_tests", - "//testing/android/junit:junit_unit_tests", - "//third_party/android_build_tools/lint:custom_lint_java", - "//third_party/androidx_javascriptengine", - "//third_party/catapult/devil", - "//third_party/jni_zero:jni_zero_tests", - "//third_party/r8:custom_d8_java", - "//tools/android:android_tools", - "//tools/android:memconsumer", - "//tools/android:push_apps_to_background", - "//tools/android/audio_focus_grabber:audio_focus_grabber_apk", - "//tools/android/customtabs_benchmark:customtabs_benchmark_apk", - "//tools/android/kerberos/SpnegoAuthenticator:spnego_authenticator_apk", - "//ui:ui_junit_tests", - ] - deps -= [ - "//net:net_perftests", - "//url:url_unittests", - ] - - if (!is_cast_android) { - deps += [ - "//android_webview:empty_group", - "//android_webview/test", - "//android_webview/tools/automated_ui_tests:webview_ui_test_app_test_apk", - "//android_webview/tools/captured_sites_tests:captured_sites_test_app", - "//android_webview/tools/sdk_sandbox", - "//android_webview/tools/system_webview_shell", - "//chrome/android:chrome_junit_tests", - "//chrome/android:chrome_public_apk", - "//chrome/android:chrome_public_test_apk", - "//chrome/android:chrome_public_unit_test_apk", - "//chrome/browser/android/examples/custom_tabs_client:custom_tabs_client_example_apk", - "//chrome/browser/android/examples/partner_browser_customizations_provider:partner_browser_customizations_example_apk", - "//content/shell/android:content_shell_test_apk", - ] - } - - if (enable_chrome_android_internal) { - deps += [ "//clank" ] - } - } - - if (is_linux || is_chromeos || is_android) { - deps += [ - "//third_party/breakpad:breakpad_unittests", - "//third_party/breakpad:core-2-minidump", - "//third_party/breakpad:generate_test_dump", - "//third_party/breakpad:minidump-2-core", - "//tools/dump_process_memory:dump_process", - ] - } - - if (is_chromeos_ash) { - deps += [ - "//ash:ash_unittests", - "//ash/components:ash_components_unittests", - "//ash/keyboard/ui:keyboard_unittests", - "//ash/webui:ash_webui_unittests", - "//chrome/browser/ash/child_accounts/time_limit_consistency_test:usage_time_limit_unittests", - "//chrome/browser/metrics/perf:profile_provider_unittest", - "//chrome/test:ash_crosapi_tests", - "//chromeos/ash/components/proximity_auth:proximity_auth_unittests", - "//chromeos/components:chromeos_components_unittests", - "//components/exo/wayland:wayland_client_compatibility_tests", - "//components/session_manager/core", - "//third_party/shell-encryption:shell_encryption_unittests", - "//ui/chromeos:ui_chromeos_unittests", - ] - } - - if (is_chromeos) { - deps += [ "//chromeos:chromeos_unittests" ] - } - - if (is_chromeos_ash || is_mac || is_win) { - deps += [ - "//rlz:rlz_id", - "//rlz:rlz_lib", - "//rlz:rlz_unittests", - ] - } - - if (is_linux || is_chromeos) { - # The following are definitely linux-only. - deps += [ - "//net:disk_cache_memory_test", - "//net:quic_client", - "//net:quic_server", - "//sandbox/linux:chrome_sandbox", - "//sandbox/linux:sandbox_linux_unittests", - ] - if (!is_clang) { - deps += [ "//testing:empty_main" ] - } - - if (!is_castos) { - deps += [ "//chrome:xdg_mime" ] - } - - if (use_dbus) { - deps += [ - "//dbus:dbus_test_server", - "//dbus:dbus_unittests", - ] - } - - if (is_chrome_branded && is_official_build) { - # TODO(dpranke): add the linux_dump_symbols flag? - deps += [ "//chrome:linux_symbols" ] - } - } - - if (is_ios || is_win || is_linux || is_chromeos_lacros || is_fuchsia) { - deps += [ - "//base:base_i18n_perftests", - "//google_apis:google_apis_unittests", - ] - } - - if ((is_win || is_mac || is_linux || is_chromeos || is_fuchsia) && - (target_cpu == "x86" || target_cpu == "x64")) { - deps += [ - "//third_party/swiftshader/src/Vulkan:icd_file", - "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan", - ] - } - - # TODO(GYP): Figure out which of these should (and can) build - # for Chrome OS and iOS (without blink). - if (!is_chromeos_ash && use_blink) { - deps += [ - "//cc:cc_perftests", - "//device:device_unittests", - "//gin:gin_shell", - "//gin:gin_unittests", - "//gpu:command_buffer_perftests", - "//gpu:gl_tests", - "//gpu:gpu_perftests", - "//media:media_perftests", - "//third_party/libphonenumber:libphonenumber_unittests", - "//ui/compositor:compositor_unittests", - ] - - if (!is_ios) { - deps += [ - "//base:build_utf8_validator_tables", - "//base:check_example", - "//components:components_perftests", - "//ipc:ipc_perftests", - "//net:dump_cache", - ] - } - - if (!is_android && !is_castos && !is_ios && !is_fuchsia) { - deps += [ - "//chrome/test:load_library_perf_tests", - "//chrome/test:sync_performance_tests", - ] - } - - if (!is_android && !is_ios) { - deps += [ - "//net:crash_cache", - "//net:net_watcher", # TODO(GYP): This should be conditional on - # use_v8_in_net - "//net:run_testserver", - "//net:stress_cache", - "//net:tld_cleanup", - "//third_party/leveldatabase:env_chromium_unittests", - "//third_party/libaddressinput:libaddressinput_unittests", - ] - } - - if (enable_extensions) { - deps += [ "//extensions/shell:app_shell" ] - } - - # TODO(https://crbug.com/1299021): These dependencies might be - # redundant given that we were able to disable them, apparently without - # negative consequences, for the ARM32-NaCl-on-ARM64 case. - if (enable_nacl) { - if (target_cpu != "arm64") { - deps += [ "//components/nacl/loader:nacl_loader_unittests" ] - } - - if (is_linux || is_chromeos) { - # TODO(dpranke): Figure out what platforms should actually have this. - deps += [ "//components/nacl/loader:nacl_helper" ] - } - } - - if (media_use_ffmpeg && !is_android) { - deps += [ "//media:ffmpeg_regression_tests" ] - } - } - - if (enable_ppapi) { - deps += [ - "//ppapi:pepper_hash_for_uma", - "//ppapi:ppapi_perftests", - ] - } - - if (is_android || is_linux || is_chromeos_lacros) { - deps += [ - "//components/network_hints/browser", - "//content/public/app", - "//mojo:mojo_perftests", - "//services/service_manager/public/cpp", - "//testing/gmock:gmock_main", - "//third_party/breakpad:dump_syms($host_system_allocator_toolchain)", - "//third_party/breakpad:microdump_stackwalk($host_system_allocator_toolchain)", - "//third_party/breakpad:minidump_dump($host_system_allocator_toolchain)", - "//third_party/breakpad:minidump_stackwalk($host_system_allocator_toolchain)", - ] - } - - if (is_linux || is_chromeos_lacros) { - deps += [ - "//skia:filter_fuzz_stub", - "//skia:image_operations_bench", - "//ui/snapshot:snapshot_unittests", - ] - - if (!is_castos) { - deps += [ "//chrome/test:chrome_app_unittests" ] - } - - if (!is_debug && !is_component_build && !is_castos) { - deps += [ "//chrome/tools/service_discovery_sniffer" ] - } - } - - if (is_mac) { - deps += [ - "//third_party/breakpad:dump_syms($host_system_allocator_toolchain)", - - # The following are accessibility API tools. - "//tools/accessibility/inspect:ax_dump_events", - "//tools/accessibility/inspect:ax_dump_tree", - ] - deps -= [ - # Mojo in GN contains some things which are never compiled in GYP on Mac, - # so compilation fails on Mac. They need porting. - "//mojo", - ] - } - - if (is_win) { - deps += [ - "//base:pe_image_test", - "//chrome/chrome_elf:chrome_elf_unittests", - "//chrome/chrome_elf:dll_hash_main", - "//chrome/elevation_service:elevation_service_unittests", - "//chrome/install_static:install_static_unittests", - "//chrome/installer/gcapi", - "//chrome/installer/setup:setup_unittests", - "//chrome/notification_helper:notification_helper_unittests", - "//chrome/test:delayloads_unittests", - "//components/wifi:wifi_test", - "//components/zucchini", - "//net:quic_client", - "//net:quic_server", - "//sandbox/win:sbox_integration_tests", - "//sandbox/win:sbox_unittests", - "//sandbox/win:sbox_validation_tests", - "//testing/gtest:gtest_main", - - # The following two are accessibility API debugging tools. - "//tools/accessibility/inspect:ax_dump_events", - "//tools/accessibility/inspect:ax_dump_tree", - "//tools/win/chromeexts:chromeexts", - ] - - # TODO(thakis): Enable this in cross builds, https://crbug.com/799827 - if (!(is_component_build && is_debug && target_cpu == "x86") && - host_os == "win") { - deps += [ "//chrome/test/mini_installer:mini_installer_tests" ] - } - } - - if (!is_fuchsia) { - # The official builders use this binary from the default toolchain's - # output directory after building in order to upload the symbols of that - # binary. They build the binary like `ninja symupload` which requires the - # target to be a dependency in the default_toolchain from `gn_all` for the - # name to resolve. - deps += [ "//third_party/breakpad:symupload" ] - } - if (is_mac && host_cpu == "arm64") { - # TODO(crbug.com/349268750): This alias exists because the official Mac - # arm64 builders (which cross-build the x64 binaries) use the hardcoded - # path of the `$host_toolchain/symupload` to build and run the symupload - # binary. And the same recipes are used on all branches!! So we would break - # the stable branch builders by changing the recipe to build and run the - # binary from the root_build_dir. - # - # Once this code is in stable, we can land the following CLs to change how - # symupload is built and run on Mac arm64 official builders, and then this - # alias can be removed. - # Build: https://chrome-internal-review.googlesource.com/c/chrome/src-internal/+/7430844 - # Run: https://chrome-internal-review.googlesource.com/c/chrome/tools/release/scripts/+/7430843 - deps += [ "//third_party/breakpad:symupload($host_toolchain)" ] - } - - if (is_cast_android || is_castos || (is_fuchsia && enable_cast_receiver)) { - deps += [ "//chromecast:cast_test_lists" ] - } - - if (is_cast_android || is_castos) { - deps += [ - "//chromecast:cast_shell", - "//chromecast/cast_core:core_runtime_simple", - ] - } - - if (is_mac || is_win || is_android || is_linux || is_chromeos) { - deps += [ - "//third_party/crashpad/crashpad:crashpad_tests", - "//third_party/crashpad/crashpad/handler:crashpad_handler", - "//third_party/crashpad/crashpad/tools:crashpad_database_util", - ] - } - - if (enable_message_center) { - deps += [ "//ui/message_center:message_center_unittests" ] - } - - if (!is_android && !is_ios) { - deps += [ "//content/browser/bluetooth/tools:bluetooth_metrics_hash" ] - } - - if (is_win || is_linux || is_chromeos) { - deps += [ "//mojo" ] - } - - if (is_mac || is_linux || is_chromeos || is_android || is_fuchsia) { - deps += [ "//third_party/perfetto:all" ] - } - - if (is_win || is_mac || is_linux || is_chromeos) { - deps += [ "//third_party/sqlite:sqlite_shell" ] - } - - if ((is_linux && !is_castos) || is_chromeos_lacros || is_fuchsia) { - # TODO(https://crbug.com/1329673): Figure out if this should be in gn_all - # and how cross-platform this is. - deps += - [ "//components/services/filesystem:filesystem_service_unittests" ] - } - - if ((is_linux && !is_castos) || is_chromeos_lacros) { - # TODO(https://crbug.com/1329673): Figure out if any of these should be in - # gn_all and figure out how cross-platform they are. - deps += [ - "//chrome/installer/util:strings", - "//chrome/tools/convert_dict", - "//components/constrained_window:unit_tests", - "//components/metrics:serialization", - "//components/sessions:unit_tests", - "//storage/browser:dump_file_system", - "//third_party/angle:libANGLE", - "//third_party/angle:libEGL", - "//third_party/angle:libGLESv2", - "//third_party/leveldatabase:leveldb_test_targets", - "//third_party/libjpeg_turbo:simd", - "//third_party/opus:opus_compare", - "//third_party/opus:opus_demo", - "//third_party/opus:test_opus_api", - "//third_party/opus:test_opus_decode", - "//third_party/opus:test_opus_encode", - "//third_party/opus:test_opus_padding", - "//ui/display/types", - "//ui/shell_dialogs:shell_dialogs_unittests", - ] - - if (target_cpu == "x86" || target_cpu == "x64") { - if (!is_android) { - deps += [ "//chrome/test:load_library_perf_tests" ] - } - deps += [ "//third_party/libjpeg_turbo:simd_asm" ] - } - if ((is_linux || is_chromeos) && current_toolchain == host_toolchain) { - deps += [ "//v8:v8_shell" ] - } - } - - if ((is_linux && !is_castos) || is_chromeos || - ((is_win || is_mac) && use_fuzzing_engine)) { - deps += [ - "//testing/libfuzzer/fuzzers", - "//third_party/freetype-testing:fuzzers", - "//third_party/grpc:fuzzers", - "//third_party/icu/fuzzers", - "//third_party/qcms:fuzzers", - "//third_party/ukey2/fuzzers", - "//third_party/zlib/contrib/tests/fuzzers", - ] - - if (is_chromeos_ash) { - deps += [ "//chrome/services/ipp_parser/public/cpp:fuzzers" ] - } - } - - # TODO(https://crbug.com/1299021): Remove the special case for arm64. - if (enable_nacl && target_cpu != "arm64") { - deps += [ "//native_client_sdk/src:nacl_core_sdk" ] - } - - if (((is_linux || is_chromeos) && use_ozone) || is_fuchsia) { - deps += [ - "//headless:headless_non_renderer", - "//headless:headless_tests", - ] - } - - if (enable_vr) { - deps += [ - "//chrome/browser/vr:vr_common_perftests", - "//chrome/browser/vr:vr_common_unittests", - ] - if (!is_android) { - deps += [ "//tools/perf/contrib/vr_benchmarks:vr_perf_tests" ] - } else { - deps += [ "//chrome/browser/android/vr:vr_android_unittests" ] - import("//tools/perf/chrome_telemetry_build/android_browser_types.gni") - foreach(_target_suffix, telemetry_android_browser_target_suffixes) { - deps += [ - "//tools/perf/contrib/vr_benchmarks:vr_perf_tests${_target_suffix}", - ] - } - } - } - - if (use_atk) { - deps += [ - "//tools/accessibility/inspect:ax_dump_events", - "//tools/accessibility/inspect:ax_dump_tree", - ] - } - - if (build_dawn_tests) { - deps += [ - "//third_party/dawn/src/dawn/fuzzers:fuzzers", - "//third_party/dawn/src/dawn/tests:dawn_end2end_tests", - "//third_party/dawn/src/dawn/tests:dawn_unittests", - "//third_party/dawn/src/tint:fuzzers", - "//third_party/dawn/src/tint:tests", - ] - } - - # PFFFT. - deps += [ - "//third_party/pffft:fuzzers", - "//third_party/pffft:pffft_benchmark", - "//third_party/pffft:pffft_unittest", - ] - - # Rust build targets. - if (enable_rust) { - deps += [ ":all_rust" ] - } - - if (!is_android && !is_ios) { - deps += [ "//components/cronet:cronet_tests" ] - } - } - - if (is_chrome_for_testing) { - deps += [ "//chrome/browser/chrome_for_testing:chrome_for_testing" ] - } -} - -# All Rust targets. This is provided for convenience while developing Rust to -# e.g. test build config or toolchain changes. -group("all_rust") { - testonly = true - - deps = [ ":rust_build_tests" ] - - # There is rust stuff behind flags in here. - deps += [ "//base:base_unittests" ] - - if (enable_rust_mojo) { - deps += [ - "//mojo/public/rust:mojo_rust", - "//mojo/public/rust:mojo_rust_integration_unittests", - "//mojo/public/rust:mojo_rust_unittests", - ] - } - if (enable_rust_gtest_interop) { - deps += [ "//testing/rust_gtest_interop:rust_gtest_interop_unittests" ] - } -} - -# This group exists to give targets for the waterfall to refer to. -group("rust_build_tests") { - testonly = true - deps = [ "//build/rust/tests" ] -} - -# TODO(https://crbug.com/1112776): ensure remoting is functional on Linux builds with -# other than X11 Ozone backends. -if (enable_remoting && ((is_linux && ozone_platform_x11) || - ((is_chromeos || is_win) && !use_ozone))) { - # On CQ, run the Traffic Annotation Auditor when a change affects one of these - # targets. - group("traffic_annotation_auditor_dependencies") { - deps = [ - "//chrome:chrome", - "//remoting/client", - "//remoting/host:host", - "//tools/traffic_annotation:annotations_xml", - ] - if (enable_enterprise_companion) { - deps += [ "//chrome/enterprise_companion" ] - } - } -} - -if (is_chromeos_ash) { - group("traffic_annotation_auditor_dependencies") { - deps = [ - "//chrome", - "//chromeos", - "//tools/traffic_annotation:annotations_xml", - ] - } -} - -if (is_android && !is_cronet_build) { - # On CQ, run the Traffic Annotation Auditor when a change affects one of these - # targets. - group("traffic_annotation_auditor_dependencies") { - deps = [ - "//chrome/android:chrome_public_apk", - "//tools/traffic_annotation:annotations_xml", - ] - } -} - -if (is_fuchsia) { - # TODO(https://crbug.com/731217): This can't practically be in //v8 without - # duplicating all the Fuchsia running infrastructure there. - fuchsia_component("d8_component") { - testonly = true - manifest = "//v8/gni/v8.cml" - data_deps = [ "//v8:d8" ] - } - fuchsia_package("d8_pkg") { - testonly = true - package_name = "d8" - deps = [ ":d8_component" ] - } - fuchsia_package_installer("d8_fuchsia") { - testonly = true - package = ":d8_pkg" - package_name = "d8" - } -} - -# TODO(GYP_GONE): Figure out if we really need this target or if there's -# some better way to specify things. -if (is_win) { - group("chrome_official_builder_no_unittests") { - deps = [ - "//chrome/common/win:eventlog_provider", - "//chrome/credential_provider", - "//chrome/enterprise_companion:enterprise_companion_zip", - "//chrome/installer/gcapi", - "//chrome/installer/mini_installer", - "//chrome/updater/win:updater_zip", - "//components/policy:pack_policy_templates", - "//components/zucchini", - "//components/zucchini:zucchini64", - "//third_party/hyphenation-patterns", - "//tools/metrics:metrics_metadata", - ] - - if (is_chrome_branded) { - deps += [ "//remoting/host:remoting_host_installation" ] - } - if (enable_platform_experience) { - deps += [ - "//chrome/browser/platform_experience/win:platform_experience_helper", - ] - } - } - - group("chrome_official_builder") { - testonly = true - - deps = [ - ":blink_wpt_tests", - ":chrome_official_builder_no_unittests", - "//base:base_unittests", - "//chrome/test:browser_tests", - "//chrome/test:interactive_ui_tests", - "//ipc:ipc_tests", - "//media:media_unittests", - "//media/midi:midi_unittests", - "//net:net_unittests", - "//sql:sql_unittests", - "//third_party/breakpad:symupload", - "//ui/base:ui_base_unittests", - "//ui/gfx:gfx_unittests", - "//ui/touch_selection:ui_touch_selection_unittests", - "//ui/views:views_unittests", - "//url:url_unittests", - ] - - if (enable_printing || enable_printing_tests) { - deps += [ "//printing:printing_unittests" ] - } - } -} - -if (is_chromeos_ash) { - # This group is used to collect all targets used when verifying a new version - # of Chrome for Chrome OS. - group("chromiumos_preflight") { - testonly = true - data_deps = [ - "//chrome", - "//chrome/test/chromedriver:chromedriver_server", - "//components/chromeos_camera:jpeg_decode_accelerator_unittest", - "//components/exo/wayland:wayland_client_integration_tests", - "//components/exo/wayland:wayland_client_perftests", - "//components/exo/wayland:wayland_client_tests", - "//components/exo/wayland:wayland_hdr_client", - "//components/policy/test_support:fake_dmserver", - "//media:media_unittests", - "//media/capture:capture_unittests", - "//sandbox/linux:chrome_sandbox", - "//sandbox/linux:sandbox_linux_unittests", - "//services/screen_ai:screen_ai_ocr_perf_test", - "//third_party/breakpad:minidump_stackwalk($host_system_allocator_toolchain)", - "//third_party/dawn/src/dawn/tests:dawn_end2end_tests", - "//third_party/dawn/src/dawn/tests:dawn_unittests", - "//ui/ozone:ozone_integration_tests", - - # Blocked on https://github.com/catapult-project/catapult/issues/2297 - #"//third_party/catapult/telemetry:bitmaptools", - "//tools/perf/clear_system_cache", - "//ui/ozone/gl:ozone_gl_unittests", - ] - - if (enable_ppapi) { - data_deps += [ "//ppapi/examples/video_decode" ] - } - - if (use_v4l2_codec || use_vaapi) { - data_deps += [ - "//components/chromeos_camera:jpeg_encode_accelerator_unittest", - "//media/gpu/chromeos:image_processor_test", - "//media/gpu/test/:video_decode_accelerator_perf_tests", - "//media/gpu/test/:video_decode_accelerator_tests", - "//media/gpu/test/:video_encode_accelerator_perf_tests", - "//media/gpu/test/:video_encode_accelerator_tests", - ] - if (use_vaapi) { - data_deps += [ - "//media/gpu/vaapi:decode_test", - "//media/gpu/vaapi:vaapi_unittest", - "//media/gpu/vaapi/test/fake_libva_driver:fake_libva_driver_unittest", - ] - } - if (use_v4l2_codec) { - data_deps += [ - "//media/gpu/chromeos:image_processor_perf_test", - "//media/gpu/v4l2:v4l2_stateless_decoder", - "//media/gpu/v4l2:v4l2_unittest", - ] - } - } - } -} - -if (use_blink && !is_cronet_build) { - group("chromedriver_group") { - testonly = true - - if (is_fuchsia || is_android) { - # On Fuchsia and non-Cast Android, ChromeDriver runs on the host, not the - # device. - if (!is_cast_android) { - deps = [ - "//chrome/test/chromedriver:chromedriver_server($host_toolchain)", - ] - } - if (is_android && !is_cast_android) { - deps += [ "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk" ] - } - } else if (!is_castos && !is_ios) { - deps = [ - "//chrome/test/chromedriver:chromedriver_server", - "//chrome/test/chromedriver:chromedriver_unittests", - "//chrome/test/chromedriver:copy_license", - "//chrome/test/chromedriver:generate_chromedriver_notices", - ] - } - } - - # This group includes all of the targets needed to build and test Blink, - # including running web tests (see below). This target is defined here because - # previously //third_party/WebKit, now //third_party/blink, couldn't depend on - # //content/shell. This might not longer be true, see - # https://crbug.com/1018659. - group("blink_tests") { - testonly = true - - deps = [ - ":blink_web_tests", - ":blink_wpt_tests", - "//third_party/blink/public:all_blink", - ] - } - - # Options shared by all script test targets that call `run_web_tests.py` or - # `run_wpt_tests.py`. - _common_web_test_options = [ - "--no-show-results", - "--zero-tests-executed-ok", + deps = [ + "//net", ] - if (is_debug) { - _common_web_test_options += [ "--debug" ] - } else { - _common_web_test_options += [ "--release" ] - } - if (is_asan) { - _common_web_test_options += [ - "--enable-sanitizer", - "--additional-expectations", - "@WrappedPath(" + - rebase_path("//third_party/blink/web_tests/ASANExpectations", - root_out_dir) + ")", - ] - } - if (is_msan) { - _common_web_test_options += [ - "--enable-sanitizer", - "--additional-expectations", - "@WrappedPath(" + - rebase_path("//third_party/blink/web_tests/MSANExpectations", - root_out_dir) + ")", - ] - } - if (is_fuchsia) { - _common_web_test_options += [ - "--out-dir", - "@WrappedPath(.)", - ] - } else { - base_out_dir = rebase_path(get_path_info(root_build_dir, "dir"), ".") - out_dir = get_path_info(root_build_dir, "name") - _common_web_test_options += [ - "--build-directory", - base_out_dir, - "--target", - out_dir, - ] - } - - if (!is_chromeos_ash && !is_ios && !is_fuchsia && !is_android && !is_castos) { - script_test("chrome_wpt_tests") { - script = "//third_party/blink/tools/run_wpt_tests.py" - args = _common_web_test_options + [ "--product=chrome" ] - if (dcheck_always_on) { - args += [ "--timeout-multiplier=2" ] - } else { - args += [ "--timeout-multiplier=1" ] - } - if (is_chrome_branded) { - args += [ - "--driver-name", - "Google Chrome", - ] - } - data_deps = [ - ":blink_web_tests_expectations", - ":blink_web_tests_support_data", - "//chrome:chrome", - "//chrome/test/chromedriver:chromedriver_server", - "//third_party/blink/tools:wpt_tests_isolate", - ] - } - script_test("headless_shell_wpt") { - script = "//third_party/blink/tools/run_wpt_tests.py" - args = _common_web_test_options + [ - "--product=headless_shell", - "--no-wpt-internal", - ] - data_deps = [ - ":blink_web_tests_expectations", - ":blink_web_tests_support_data", - "//chrome/test/chromedriver:chromedriver_server", - "//headless:headless_shell", - "//third_party/blink/tools:wpt_tests_isolate", - ] - if (is_mac || is_linux) { - data_deps += [ "//third_party/hyphenation-patterns:bundle_hyphen_data" ] - } - } - } - - group("blink_web_tests_support_data") { - testonly = true - data_deps = [ - ":layout_test_data_mojo_bindings", - ":layout_test_data_mojo_bindings_lite", - "//content/shell:content_shell", - "//content/test:mojo_bindings_web_test_mojom_js_data_deps", - "//content/test:mojo_web_test_bindings_js_data_deps", - "//device/bluetooth/public/mojom:fake_bluetooth_interfaces_js_data_deps", - "//device/vr/public/mojom:vr_service_js_data_deps", - "//media/capture/mojom:image_capture_js_data_deps", - "//media/midi:mojo_js_data_deps", - "//media/mojo/mojom:web_speech_recognition_js_data_deps", - "//mojo/public/interfaces/bindings/tests:test_data_deps", - "//mojo/public/js/ts/bindings/tests:test_interfaces_js_data_deps", - "//mojo/public/mojom/base:base_js_data_deps", - "//services/device/public/mojom:generic_sensor_js_data_deps", - "//services/device/public/mojom:mojom_js_data_deps", - "//services/device/public/mojom:usb_js_data_deps", - "//services/shape_detection/public/mojom:mojom_js_data_deps", - "//skia/public/mojom:mojom_js_data_deps", - "//testing/buildbot/filters:blink_web_tests_filter", - "//third_party/angle:includes", - "//third_party/blink/public:blink_devtools_frontend_resources_files", - "//third_party/blink/public:blink_devtools_inspector_resources", - "//third_party/blink/public/mojom:mojom_platform_js_data_deps", - "//third_party/blink/renderer/core:gen_files_for_web_tests", - "//third_party/catapult/third_party/typ", - "//third_party/hyphenation-patterns:test_data", - "//tools/imagediff", - "//ui/base:goldctl", - ] - - if (is_android) { - data_deps += [ - "//third_party/breakpad:breakpad_unittests", - "//tools/android/forwarder2", - - # Using the target toolchain for this tool, as it's run during tests not - # during the build. This places a symlink in the root_build_dir for - # scrips to use. - "//third_party/breakpad:dump_syms", - "//third_party/breakpad:microdump_stackwalk", - "//third_party/breakpad:minidump_dump", - "//third_party/breakpad:minidump_stackwalk", - "//third_party/breakpad:symupload", - ] - } else { - data_deps += [ "//content/web_test:web_test_common_mojom_js_data_deps" ] - } - - if (!is_win && !is_android) { - # Using the default toolchain for this tool, as it's run during tests not - # during the build. This places a symlink in the root_build_dir for scrips - # to use. - data_deps += [ "//third_party/breakpad:minidump_stackwalk" ] - } - - if (is_mac) { - # Using the default toolchain for this tool, as it's run during tests not - # during the build, and on Mac we support cross-building from a different - # architecture. - data_deps += [ "//third_party/breakpad:dump_syms" ] - } - - if (is_linux || is_chromeos) { - # Using the default toolchain for this tool, as it's run during tests not - # during the build. This places a symlink in the root_build_dir for scrips - # to use. - data_deps += [ "//third_party/breakpad:dump_syms" ] - } - - if (is_fuchsia) { - data_deps += [ - "//build/config/fuchsia:deployment_resources", - "//content/shell:content_shell_fuchsia", - "//content/shell:content_shell_pkg__archive-manifest", - "//content/shell:content_shell_pkg__archive-metadata", - ] - } - - data = [ - "//build/skia_gold_common/", - "//testing/scripts/common.py", - "//testing/scripts/run_isolated_script_test.py", - "//testing/xvfb.py", - "//third_party/blink/tools/", - "//third_party/blink/web_tests/external/wpt/config.json", - "//third_party/blink/web_tests/resources/", - "//third_party/blink/web_tests/TestLists/", - "//third_party/pywebsocket3/src/mod_pywebsocket/", - "//third_party/test_fonts/test_fonts/", - "//third_party/wpt_tools/", - ] - - if (is_win) { - data += [ - "//third_party/apache-win32/", - "//third_party/apache-windows-arm64/", - "//third_party/perl/perl/", - ] - data_deps += [ "//build/win:copy_cdb_to_output" ] - } - - if (is_mac || (is_ios && target_environment == "simulator")) { - data += [ - "//third_party/apache-mac/", - "//third_party/apache-mac-arm64/", - ] - } - - if (is_linux || is_chromeos || is_fuchsia) { - data += [ "//third_party/apache-linux/" ] - } - - if (is_android) { - data += [ - "//third_party/catapult/", - "//build/android/", - ] - } - } - - _common_web_test_script = "//testing/scripts/run_isolated_script_test.py" - - if (is_fuchsia) { - _common_web_test_args = [ - "@WrappedPath(" + - rebase_path("//build/fuchsia/test/run_test.py", root_build_dir) + ")", - "blink", - "--platform", - "fuchsia", - "--jobs", - "1", - ] - } else { - _common_web_test_args = [ "@WrappedPath(" + rebase_path( - "//third_party/blink/tools/run_web_tests.py", - root_build_dir) + ")" ] - } - _common_web_test_args += _common_web_test_options - - if (!is_debug) { - if (dcheck_always_on) { - _common_web_test_args += [ "--timeout-ms=12000" ] - } else if (v8_enable_debugging_features) { - # In a pure release build with a debug V8, tests run slower. - _common_web_test_args += [ "--timeout-ms=30000" ] - } - } - - if (is_chrome_branded) { - _common_web_test_args += [ "--chrome-branded" ] - } - - if (is_android) { - _common_web_test_args += [ - "--platform", - "android", - ] - } - - _common_web_test_args += [ - "--seed", - "4", - "--debug-rwt-logging", - "--clobber-old-results", - ] - - # https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_tests.md - script_test("blink_web_tests") { - script = _common_web_test_script - - args = _common_web_test_args - - data_deps = [ - ":blink_web_tests_expectations", - ":blink_web_tests_support_data", - ] - data = [ - "//third_party/blink/perf_tests/", - "//third_party/blink/web_tests/VirtualTestSuites", - - # === List Test Cases folders here === - "//third_party/blink/web_tests/accessibility/", - "//third_party/blink/web_tests/android/", - "//third_party/blink/web_tests/animations/", - "//third_party/blink/web_tests/app_banner/", - "//third_party/blink/web_tests/bindings/", - "//third_party/blink/web_tests/clipboard/", - "//third_party/blink/web_tests/compositing/", - "//third_party/blink/web_tests/crypto/", - "//third_party/blink/web_tests/css-parser/", - "//third_party/blink/web_tests/css1/", - "//third_party/blink/web_tests/css2.1/", - "//third_party/blink/web_tests/css3/", - "//third_party/blink/web_tests/cssom/", - "//third_party/blink/web_tests/custom-elements/", - "//third_party/blink/web_tests/custom-properties/", - "//third_party/blink/web_tests/dark-mode/", - "//third_party/blink/web_tests/dom/", - "//third_party/blink/web_tests/editing/", - "//third_party/blink/web_tests/fast/", - "//third_party/blink/web_tests/fonts/", - "//third_party/blink/web_tests/fragmentation/", - "//third_party/blink/web_tests/fullscreen/", - "//third_party/blink/web_tests/gamepad/", - "//third_party/blink/web_tests/harness-tests/", - "//third_party/blink/web_tests/hittesting/", - "//third_party/blink/web_tests/html/", - "//third_party/blink/web_tests/html5lib/", - "//third_party/blink/web_tests/http/", - "//third_party/blink/web_tests/idle-callback/", - "//third_party/blink/web_tests/ietestcenter/", - "//third_party/blink/web_tests/images/", - "//third_party/blink/web_tests/inspector-protocol/", - "//third_party/blink/web_tests/intersection-observer/", - "//third_party/blink/web_tests/jquery/", - "//third_party/blink/web_tests/js/", - "//third_party/blink/web_tests/loader/", - "//third_party/blink/web_tests/media/", - "//third_party/blink/web_tests/media_capabilities/", - "//third_party/blink/web_tests/mhtml/", - "//third_party/blink/web_tests/navigator_language/", - "//third_party/blink/web_tests/navigator_webdriver/", - "//third_party/blink/web_tests/netinfo/", - "//third_party/blink/web_tests/overflow/", - "//third_party/blink/web_tests/paint/", - "//third_party/blink/web_tests/payments/", - "//third_party/blink/web_tests/performance_timeline/", - "//third_party/blink/web_tests/permissionclient/", - "//third_party/blink/web_tests/plugins/", - "//third_party/blink/web_tests/pointer-lock/", - "//third_party/blink/web_tests/ppapi/", - "//third_party/blink/web_tests/print_testharness/", - "//third_party/blink/web_tests/printing/", - "//third_party/blink/web_tests/register-protocol-handler/", - "//third_party/blink/web_tests/regress/", - "//third_party/blink/web_tests/resize-observer/", - "//third_party/blink/web_tests/resources/", - "//third_party/blink/web_tests/rootscroller/", - "//third_party/blink/web_tests/screen_orientation/", - "//third_party/blink/web_tests/scrollbars/", - "//third_party/blink/web_tests/security/", - "//third_party/blink/web_tests/handwriting/", - "//third_party/blink/web_tests/shadow-dom/", - "//third_party/blink/web_tests/storage/", - "//third_party/blink/web_tests/svg/", - "//third_party/blink/web_tests/synthetic_gestures/", - "//third_party/blink/web_tests/tables/", - "//third_party/blink/web_tests/test_runner/", - "//third_party/blink/web_tests/third_party/", - "//third_party/blink/web_tests/timezonechange/", - "//third_party/blink/web_tests/touchadjustment/", - "//third_party/blink/web_tests/transforms/", - "//third_party/blink/web_tests/transitions/", - "//third_party/blink/web_tests/traversal/", - "//third_party/blink/web_tests/typedcssom/", - "//third_party/blink/web_tests/vibration/", - "//third_party/blink/web_tests/view-transition/", - "//third_party/blink/web_tests/virtual/", - "//third_party/blink/web_tests/virtualkeyboard/", - "//third_party/blink/web_tests/wasm/", - "//third_party/blink/web_tests/webaudio/", - "//third_party/blink/web_tests/webexposed/", - "//third_party/blink/web_tests/webgpu/", - "//third_party/blink/web_tests/xmlviewer/", - - # === Test Case Folders Ends === - ] - } - - group("blink_web_tests_expectations") { - testonly = true - - data = [ - # Include virtual baselines. - "//third_party/blink/web_tests/virtual/", - - # List all test expectations here - "//third_party/blink/web_tests/LeakExpectations", - "//third_party/blink/web_tests/NeverFixTests", - "//third_party/blink/web_tests/SlowTests", - "//third_party/blink/web_tests/StaleTestExpectations", - "//third_party/blink/web_tests/TestExpectations", - ] - - if (is_asan) { - data += [ "//third_party/blink/web_tests/ASANExpectations" ] - } - if (is_msan) { - data += [ "//third_party/blink/web_tests/MSANExpectations" ] - } - - if (is_win || is_linux || is_fuchsia) { - data += [ - "//third_party/blink/web_tests/platform/win/", - "//third_party/blink/web_tests/platform/win10/", - "//third_party/blink/web_tests/platform/win11-arm64/", - ] - if (is_linux || is_fuchsia) { - data += [ "//third_party/blink/web_tests/platform/linux/" ] - } - if (is_fuchsia) { - data += [ - "//third_party/blink/web_tests/platform/fuchsia/", - "$root_gen_dir/package_metadata/content_shell.meta", - ] - } - } else if (is_mac) { - data += [ - "//third_party/blink/web_tests/platform/mac/", - "//third_party/blink/web_tests/platform/mac-mac11/", - "//third_party/blink/web_tests/platform/mac-mac11-arm64/", - "//third_party/blink/web_tests/platform/mac-mac12/", - "//third_party/blink/web_tests/platform/mac-mac12-arm64/", - "//third_party/blink/web_tests/platform/mac-mac13/", - "//third_party/blink/web_tests/platform/mac-mac13-arm64/", - "//third_party/blink/web_tests/platform/mac-mac14/", - "//third_party/blink/web_tests/platform/mac-mac14-arm64/", - "//third_party/blink/web_tests/platform/mac-mac15-arm64/", - ] - } - - # flag-specific tests only runs on linux & mac as of now - if (is_linux || is_mac) { - data += [ - "//third_party/blink/web_tests/FlagSpecificConfig", - "//third_party/blink/web_tests/FlagExpectations/", - "//third_party/blink/web_tests/flag-specific/", - ] - } - } - - script_test("blink_wpt_tests") { - script = _common_web_test_script - - args = _common_web_test_args - - # Use --wpt-only to skip tests under web_tests/virtual/ - args += [ - "--wpt-only", - "--inverted-test-launcher-filter-file", - "@WrappedPath(" + - rebase_path("//third_party/blink/web_tests/TestLists/chrome.filter", - root_out_dir) + ")", - "--inverted-test-launcher-filter-file", - "@WrappedPath(" + rebase_path( - "//third_party/blink/web_tests/TestLists/headless_shell.filter", - root_out_dir) + ")", - ] - - data_deps = [ - ":blink_web_tests_expectations", - ":blink_web_tests_support_data", - ] - data = [ - "//third_party/blink/perf_tests/", - "//third_party/blink/web_tests/VirtualTestSuites", - - # === List Test Cases folders here === - "//third_party/blink/web_tests/external/", - "//third_party/blink/web_tests/wpt_internal/", - - # === Test Case Folders Ends === - ] - } - - script_test("devtools_web_tests") { - # This target differs from :blink_web_tests in that it uses the - # same test harness but runs an entirely different set of tests - # and doesn't have a dependency on the web_test directory at all. - script = _common_web_test_script - - args = _common_web_test_args + [ - "--layout-tests-directory=@WrappedPath(" + rebase_path( - "//third_party/devtools-frontend/src/test/webtests", - root_out_dir) + ")", - "http/tests/devtools", - ] - - data_deps = [ ":blink_web_tests_support_data" ] - data = [ "//third_party/devtools-frontend/src/test/webtests/" ] - } - - script_test("webgpu_blink_web_tests") { - # This target differs from :blink_web_tests in that it uses the same - # test harness and a few additional flags but, more importantly, only runs - # the web_tests/wpt_internal/webgpu tests, so it doesn't have a data - # dependency on the whole web_test directory. - script = _common_web_test_script - - args = _common_web_test_args - if (is_asan) { - args += [ "--timeout-ms=30000" ] - } - args += [ - "--ignore-default-expectations", - "--additional-expectations", - "@WrappedPath(../../third_party/blink/web_tests/WebGPUExpectations)", - "--isolated-script-test-filter=wpt_internal/webgpu/*", - ] - - data_deps = [ - ":blink_web_tests_support_data", - "//third_party/webgpu-cts", - ] - data = [ - "//third_party/blink/web_tests/external/wpt/common/", - "//third_party/blink/web_tests/external/wpt/resources/", - "//third_party/blink/web_tests/FlagSpecificConfig", - "//third_party/blink/web_tests/VirtualTestSuites", - "//third_party/blink/web_tests/WebGPUExpectations", - "//third_party/blink/web_tests/wpt_internal/", - "//third_party/webgpu-cts/scripts/", - ] - } - - copy("layout_test_data_mojo_bindings") { - testonly = true - - sources = [ "$root_gen_dir/mojo/public/js/mojo_bindings.js" ] - - outputs = - [ "$root_gen_dir/layout_test_data/mojo/public/js/mojo_bindings.js" ] - - deps = [ "//mojo/public/js:bindings" ] - } - - copy("layout_test_data_mojo_bindings_lite") { - testonly = true - - sources = [ "$root_gen_dir/mojo/public/js/mojo_bindings_lite.js" ] - - outputs = [ - "$root_gen_dir/layout_test_data/mojo/public/js/mojo_bindings_lite.js", - ] - - deps = [ "//mojo/public/js:bindings_lite" ] - } - - script_test("blink_python_tests") { - script = "//testing/scripts/run_isolated_script_test.py" - args = [ - "@WrappedPath(" + - rebase_path("//third_party/blink/tools/run_blinkpy_tests.py", - root_build_dir) + ")", - "-v", - "-t", - ] - - data = [ - # These tests use //build/android/devil_chromium.py even when !is_android, - # so cannot use the helpers in //build/android (they assert(is_android)). - "//build/android/", - "//build/gn_helpers.py", - "//build/config/gclient_args.gni", - "//build/skia_gold_common/", - "//components/crash/content/tools/generate_breakpad_symbols.py", - "//testing/unexpected_passes_common/", - "//testing/flake_suppressor_common/", - "//third_party/blink/renderer/bindings/scripts/", - "//third_party/blink/renderer/build/scripts/", - "//third_party/blink/tools/", - "//third_party/blink/web_tests/ASANExpectations", - "//third_party/blink/web_tests/FlagExpectations/", - "//third_party/blink/web_tests/LeakExpectations", - "//third_party/blink/web_tests/MSANExpectations", - "//third_party/blink/web_tests/NeverFixTests", - "//third_party/blink/web_tests/SlowTests", - "//third_party/blink/web_tests/StaleTestExpectations", - "//third_party/blink/web_tests/TestExpectations", - "//third_party/blink/web_tests/VirtualTestSuites", - "//third_party/blink/web_tests/W3CImportExpectations", - "//third_party/blink/web_tests/paint/invalidation/repaint-overlay/", - "//third_party/catapult/common/py_utils/", - "//third_party/catapult/devil/", - "//third_party/catapult/dependency_manager/", - "//third_party/catapult/third_party/typ/", - "//third_party/depot_tools/pylint-2.7", - "//third_party/depot_tools/pylint_main.py", - "//third_party/depot_tools/pylintrc", - "//third_party/ply/", - "//third_party/pyjson5/", - "//third_party/wpt_tools/", - "//tools/idl_parser/", - ] - - if (is_ios) { - data += [ "//third_party/blink/web_tests/IOSTestExpectations" ] - } - - data_deps = [ "//ui/base:goldctl" ] - } -} - -# TODO(cassew): Add more OS's that don't support x86. -is_valid_x86_target = - target_os != "ios" && target_os != "mac" && - (target_os != "linux" || use_libfuzzer || !build_with_chromium) - -# Note: v8_target_cpu == arm allows using the V8 arm simulator on x86 for fuzzing. -assert( - is_valid_x86_target || target_cpu != "x86" || v8_target_cpu == "arm", - "'target_cpu=x86' is not supported for 'target_os=$target_os'. Consider omitting 'target_cpu' (default) or using 'target_cpu=x64' instead.") - -group("chromium_builder_perf") { - testonly = true - - if (!is_ios && !is_android && !is_castos && !is_cronet_build) { - data_deps = [ - "//components/tracing:tracing_perftests", - "//gpu:command_buffer_perftests", - "//gpu:gpu_perftests", - "//media:media_perftests", - "//tools/perf/chrome_telemetry_build:telemetry_chrome_test", - ] - - if (!is_fuchsia) { - data_deps += [ - "//chrome/test:load_library_perf_tests", - "//chrome/test:performance_test_suite", - ] - } - - if (!is_chromeos_ash && !is_fuchsia) { - data_deps += [ "//chrome/test:performance_browser_tests" ] - } - - if (!is_win) { - data_deps += [ "//third_party/breakpad:minidump_stackwalk($host_system_allocator_toolchain)" ] - } - } - - if ((is_linux && !is_castos) || is_chromeos_lacros) { - if (is_official_build) { - # In GN builds, this is controlled by the 'linux_dump_symbols' - # flag, which defaults to 1 for official builds. For now, - # we skip the separate flag and just key off of is_official_build. - data_deps += [ "//chrome:linux_symbols" ] - } - - data_deps += [ "//tools/perf/clear_system_cache" ] - } - - if (is_win) { - data_deps += [ - "//chrome/installer/mini_installer:mini_installer", - "//components:components_perftests", - "//third_party/angle/src/tests:angle_perftests", - ] - } -} - -if (!is_ios && !is_android && !is_castos && !is_cronet_build) { - group("chromium_builder_asan") { - testonly = true - - deps = [ - "//content/shell:content_shell", - "//third_party/blink/public/mojom:mojom_modules_js", - "//v8:d8", - ] - if (!is_fuchsia) { - deps += [ "//chrome:chrome" ] - } - if (!is_win) { - deps += [ "//skia:filter_fuzz_stub" ] - } - if (enable_ipc_fuzzer && !is_component_build) { - deps += [ "//tools/ipc_fuzzer:ipc_fuzzer_all" ] - } - if (!is_chromeos_ash) { - deps += [ "//v8:v8_shell($v8_snapshot_toolchain)" ] - if (enable_pdf) { - deps += [ "//third_party/pdfium/testing:pdfium_test" ] - } - } - - if (!is_component_build) { - # See https://bugs.chromium.org/p/chromium/issues/detail?id=942546#c11. - deps += [ - "//third_party/webrtc/rtc_tools:rtp_generator", - "//third_party/webrtc/rtc_tools:video_replay", - ] - } - - if (build_dawn_tests) { - deps += [ "//third_party/dawn/src/tint:fuzzers" ] - } - } } if (is_android && !is_cronet_build) { @@ -1811,19 +71,6 @@ if (is_android && !is_cronet_build) { } } -if (is_chromeos_ash && enable_js_type_check) { - group("webui_closure_compile") { - testonly = true - data_deps = [ - "ash/webui:closure_compile", - "chrome/browser/resources:closure_compile", - "chrome/test/data/webui:closure_compile", - "mojo/public/tools/bindings/generators/js_templates/lite/test:closure_compile", - "mojo/public/tools/bindings/generators/js_templates/lite/test:closure_compile_modules", - ] - } -} - # Write debug logs to gn_logs.txt. _lines = [ "Generated during 'gn gen' by //BUILD.gn.", diff --git a/src/base/BUILD.gn b/src/base/BUILD.gn index 9247e9b3f4..7ff32f0cf6 100644 --- a/src/base/BUILD.gn +++ b/src/base/BUILD.gn @@ -29,6 +29,7 @@ import("//build/config/chromeos/ui_mode.gni") import("//build/config/compiler/compiler.gni") import("//build/config/cronet/config.gni") import("//build/config/dcheck_always_on.gni") +import("//build/config/features.gni") import("//build/config/ios/config.gni") import("//build/config/logging.gni") import("//build/config/nacl/config.gni") @@ -37,12 +38,9 @@ import("//build/config/rust.gni") import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sysroot.gni") import("//build/config/ui.gni") -import("//build/nocompile.gni") import("//build/timestamp.gni") import("//build/util/process_version.gni") import("//build_overrides/build.gni") -import("//testing/libfuzzer/fuzzer_test.gni") -import("//testing/test.gni") if (is_ios) { # Used to access ios_is_app_extension variable definition. @@ -1247,18 +1245,6 @@ component("base") { ] deps += [ - ":base_jni", - ":base_shared_preferences_jni", - ":callback_jni", - ":command_line_jni", - ":content_uri_utils_jni", - ":jank_tracker_jni", - ":library_loader_jni", - ":memory_jni", - ":metrics_jni", - ":process_launcher_jni", - ":sys_utils_jni", - ":tasks_jni", "//third_party/ashmem", "//third_party/cpu_features:ndk_compat", ] @@ -2692,1444 +2678,6 @@ static_library("base_static") { } } -component("i18n") { - output_name = "base_i18n" - sources = [ - "i18n/base_i18n_export.h", - "i18n/base_i18n_switches.cc", - "i18n/base_i18n_switches.h", - "i18n/break_iterator.cc", - "i18n/break_iterator.h", - "i18n/case_conversion.cc", - "i18n/case_conversion.h", - "i18n/char_iterator.cc", - "i18n/char_iterator.h", - "i18n/character_encoding.cc", - "i18n/character_encoding.h", - "i18n/encoding_detection.cc", - "i18n/encoding_detection.h", - "i18n/file_util_icu.cc", - "i18n/file_util_icu.h", - "i18n/i18n_constants.cc", - "i18n/i18n_constants.h", - "i18n/icu_string_conversions.cc", - "i18n/icu_string_conversions.h", - "i18n/icu_util.cc", - "i18n/icu_util.h", - "i18n/message_formatter.cc", - "i18n/message_formatter.h", - "i18n/number_formatting.cc", - "i18n/number_formatting.h", - "i18n/rtl.cc", - "i18n/rtl.h", - "i18n/streaming_utf8_validator.cc", - "i18n/streaming_utf8_validator.h", - "i18n/string_compare.cc", - "i18n/string_compare.h", - "i18n/string_search.cc", - "i18n/string_search.h", - "i18n/time_formatting.cc", - "i18n/time_formatting.h", - "i18n/timezone.cc", - "i18n/timezone.h", - "i18n/unicodestring.h", - "i18n/utf8_validator_tables.cc", - "i18n/utf8_validator_tables.h", - ] - defines = [ "BASE_I18N_IMPLEMENTATION" ] - configs += [ "//build/config/compiler:wexit_time_destructors" ] - public_deps = [ - ":base", - "//third_party/ced", - "//third_party/icu", - ] - deps = [ - "//build:chromecast_buildflags", - "//build:chromeos_buildflags", - ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } - - if (is_mac) { - frameworks = [ "CoreFoundation.framework" ] - } -} - -executable("containers_memory_benchmark") { - sources = [ "containers/containers_memory_benchmark.cc" ] - deps = [ ":base" ] - testonly = true -} - -test("base_perftests") { - sources = [ - "big_endian_perftest.cc", - "hash/hash_perftest.cc", - "json/json_perftest.cc", - "message_loop/message_pump_perftest.cc", - "observer_list_perftest.cc", - "rand_util_perftest.cc", - "strings/string_util_perftest.cc", - "substring_set_matcher/substring_set_matcher_perftest.cc", - "synchronization/lock_perftest.cc", - "synchronization/waitable_event_perftest.cc", - "task/job_perftest.cc", - "task/sequence_manager/sequence_manager_perftest.cc", - "task/thread_pool/thread_pool_perftest.cc", - "threading/counter_perftest.cc", - "threading/thread_local_storage_perftest.cc", - "threading/thread_perftest.cc", - "types/expected_macros_perftest.cc", - ] - - deps = [ - ":base", - ":debugging_buildflags", - "//base/test:test_support", - "//base/test:test_support_perf", - "//testing/gtest", - "//testing/perf", - "//third_party/google_benchmark", - ] - - # TODO(crbug.com/40158212): Move partition_alloc tests into its repository. - if (use_partition_alloc) { - sources += [ - "allocator/partition_allocator/src/partition_alloc/partition_alloc_perftest.cc", - "allocator/partition_allocator/src/partition_alloc/partition_lock_perftest.cc", - ] - deps += [ "allocator/partition_allocator/src/partition_alloc:test_support" ] - } - - data_deps = [ - # Needed for isolate script to execute. - "//testing:run_perf_test", - ] - - if (is_android) { - deps += [ "//testing/android/native_test:native_test_native_code" ] - shard_timeout = 600 - } - - if (is_fuchsia) { - # Run these performance tests against the actual system. - run_as_chromium_system_test = true - } - - if (!is_official_build) { - # The extra data tables required by stack traces are turned off for official - # build, only do stack trace perftest for unofficial build - sources += [ "debug/stack_trace_perftest.cc" ] - } - - if (build_allocation_stack_trace_recorder) { - sources += [ "debug/allocation_trace_perftest.cc" ] - } -} - -test("base_i18n_perftests") { - sources = [ "i18n/streaming_utf8_validator_perftest.cc" ] - deps = [ - ":base", - ":i18n", - "//base/test:test_support", - "//base/test:test_support_perf", - "//testing/gtest", - ] -} - -if (!is_ios) { - executable("build_utf8_validator_tables") { - sources = [ "i18n/build_utf8_validator_tables.cc" ] - deps = [ - ":base", - "//build/win:default_exe_manifest", - "//third_party/icu:icuuc", - ] - } - - executable("check_example") { - sources = [ "check_example.cc" ] - deps = [ - ":base", - "//build/win:default_exe_manifest", - ] - } - - executable("json_perftest_decodebench") { - sources = [ "json/json_perftest_decodebench.cc" ] - deps = [ ":base" ] - } -} - -if (is_win) { - # Target to manually rebuild pe_image_test.dll which is checked into - # base/test/data/pe_image. - shared_library("pe_image_test") { - sources = [ "win/pe_image_test.cc" ] - ldflags = [ - "/DELAYLOAD:cfgmgr32.dll", - "/DELAYLOAD:shell32.dll", - "/SUBSYSTEM:WINDOWS", - ] - libs = [ - "cfgmgr32.lib", - "shell32.lib", - ] - } - - loadable_module("scoped_handle_test_dll") { - sources = [ "win/scoped_handle_test_dll.cc" ] - deps = [ - ":base", - "//base/win:base_win_buildflags", - ] - } -} - -if ((is_win && (current_cpu == "x64" || current_cpu == "arm64")) || is_mac || - (is_android && (current_cpu == "arm" || current_cpu == "arm64")) || - (is_chromeos && (current_cpu == "x64" || current_cpu == "arm64"))) { - # Must be a loadable module so that it can be loaded/unloaded at runtime - # during testing. - loadable_module("base_profiler_test_support_library") { - testonly = true - sources = [ "profiler/test_support_library.cc" ] - - # Don't link libc++ and libc++abi into the shared library. - # libc++abi uses `thread_local`, and that interferes with - # the ability to unload shared libraries on some systems. - no_default_deps = true - if (!toolchain_for_rust_host_build_tools) { - deps = [ "//build/config:common_deps_without_libcxx" ] - configs += [ "//build/config/sanitizers:link_shared_library" ] - } - } -} - -if (is_android && (current_cpu == "arm" || current_cpu == "arm64")) { - # Use separate library for - # |LibunwindstackUnwinderAndroidTest.ReparsesMapsOnNewDynamicLibraryLoad| - # testcase. We can't use the existing `base_profiler_test_support_library` - # library for this test since this gets loaded by other tests and unloading - # a library in Android doesn't guarantee it will actually be unloaded. - # And in the test we would like to observe the change in /proc/self/maps - # on loading a dynamic library. - loadable_module("base_profiler_reparsing_test_support_library") { - testonly = true - sources = [ "profiler/test_support_library.cc" ] - - # For consistency with base_profiler_reparsing_test_support_library. - no_default_deps = true - if (!toolchain_for_rust_host_build_tools) { - deps = [ "//build/config:common_deps_without_libcxx" ] - configs += [ "//build/config/sanitizers:link_shared_library" ] - } - } -} - -if (is_android) { - source_set("native_unwinder_android") { - # This target is intended to be used only within the stack_unwinder dynamic - # feature module, to avoid binary size increase in Chrome due to the - # libunwindstack dependency. The additional :* visibility is needed to allow - # use by base test targets. - visibility = [ - ":*", - "//chrome/android/modules/stack_unwinder/internal:*", - ] - sources = [ - "profiler/libunwindstack_unwinder_android.cc", - "profiler/libunwindstack_unwinder_android.h", - "profiler/native_unwinder_android.cc", - "profiler/native_unwinder_android.h", - "profiler/native_unwinder_android_memory_regions_map_impl.cc", - "profiler/native_unwinder_android_memory_regions_map_impl.h", - ] - - public_deps = [ - ":base", - "//third_party/libunwindstack", - ] - } -} - -source_set("base_stack_sampling_profiler_test_util") { - testonly = true - sources = [ - "profiler/stack_sampling_profiler_test_util.cc", - "profiler/stack_sampling_profiler_test_util.h", - ] - deps = [ - ":base", - "//base/test:test_support", - "//testing/gtest", - ] - if (is_android) { - sources += [ - "profiler/stack_sampling_profiler_java_test_util.cc", - "profiler/stack_sampling_profiler_java_test_util.h", - ] - deps += [ - ":base_profiler_test_support_jni", - ":native_unwinder_android", - ] - } -} - -if (is_apple) { - bundle_data("base_unittests_bundle_data") { - testonly = true - sources = [ - "//tools/metrics/actions/actions.xml", - "//tools/metrics/histograms/enums.xml", - "//tools/metrics/histograms/test_data/histograms.xml", - "test/data/file_util/binary_file.bin", - "test/data/file_util/binary_file_diff.bin", - "test/data/file_util/binary_file_same.bin", - "test/data/file_util/blank_line.txt", - "test/data/file_util/blank_line_crlf.txt", - "test/data/file_util/crlf.txt", - "test/data/file_util/different.txt", - "test/data/file_util/different_first.txt", - "test/data/file_util/different_last.txt", - "test/data/file_util/empty1.txt", - "test/data/file_util/empty2.txt", - "test/data/file_util/first1.txt", - "test/data/file_util/first2.txt", - "test/data/file_util/original.txt", - "test/data/file_util/same.txt", - "test/data/file_util/same_length.txt", - "test/data/file_util/shortened.txt", - "test/data/json/bom_feff.json", - "test/data/pe_image_reader/signed.exe", - "test/data/serializer_nested_test.json", - "test/data/serializer_test.json", - "test/data/serializer_test_nowhitespace.json", - ] - outputs = [ "{{bundle_resources_dir}}/" + - "{{source_root_relative_dir}}/{{source_file_part}}" ] - } -} - -# Generated file whose location is verified in DIR_GEN_TEST_DATA_ROOT test. -generated_file("generate_file_for_test") { - testonly = true - outputs = [ "$target_gen_dir/generated_file_for_test.txt" ] - data = [ "$target_gen_dir/generated_file_for_test.txt" ] - contents = "Hello world" -} - -if (is_ios) { - bundle_data("base_test_proto_bundle_data") { - testonly = true - public_deps = [ "//base/test:test_proto_descriptor" ] - sources = [ "$root_gen_dir/base/test/test_proto.descriptor" ] - outputs = [ "{{bundle_resources_dir}}/gen/base/test/{{source_file_part}}" ] - } - - bundle_data("base_generated_test_file_bundle_data") { - testonly = true - public_deps = [ ":generate_file_for_test" ] - sources = [ "$target_gen_dir/generated_file_for_test.txt" ] - outputs = [ "{{bundle_resources_dir}}/gen/base/{{source_file_part}}" ] - } -} - -if (is_apple) { - source_set("base_unittests_noarc") { - testonly = true - sources = [ "apple/scoped_nsobject_unittest.mm" ] - - # Do not compile with ARC because this target has tests for code that does - # not compile with ARC. - configs -= [ "//build/config/compiler:enable_arc" ] - deps = [ - ":base", - "//base/test:test_support", - "//testing/gtest", - ] - } -} - -if (!is_nacl && (is_linux || is_chromeos)) { - # This test must compile with -fstack-protector-all - source_set("stack_canary_linux_unittests") { - testonly = true - - sources = [ "stack_canary_linux_unittest.cc" ] - cflags = [ "-fstack-protector-all" ] - - deps = [ - "//base", - "//testing/gtest", - ] - } -} - -if (is_fuchsia) { - fidl_library("testfidl") { - library_name = "base.testfidl" - - sources = [ "fuchsia/test.test-fidl" ] - } - - # TODO(crbug.com/40256912): remove this once all users are migrated to natural bindings. - source_set("test_interface_impl") { - testonly = true - sources = [ - "fuchsia/test_interface_impl.cc", - "fuchsia/test_interface_impl.h", - ] - deps = [ - ":base", - "//testing/gtest", - ] - public_deps = [ - ":testfidl_hlcpp", - "//third_party/fuchsia-sdk/sdk/pkg/fidl_cpp", - "//third_party/fuchsia-sdk/sdk/pkg/zx", - ] - } - - source_set("test_interface_natural_impl") { - testonly = true - public = [ "fuchsia/test_interface_natural_impl.h" ] - sources = [ "fuchsia/test_interface_natural_impl.cc" ] - deps = [ - ":base", - "//testing/gtest", - "//third_party/fuchsia-sdk/sdk/pkg/async", - ] - public_deps = [ - ":testfidl_cpp", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.io:fuchsia.io_cpp_common", - "//third_party/fuchsia-sdk/sdk/pkg/fidl_cpp_wire", - "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp", - ] - } - - source_set("test_log_listener_safe") { - testonly = true - sources = [ - "fuchsia/test_log_listener_safe.cc", - "fuchsia/test_log_listener_safe.h", - ] - deps = [ - ":base", - "//base/test:test_support", - "//testing/gtest", - ] - public_deps = [ - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.logger:fuchsia.logger_hlcpp", - ] - } -} - -source_set("path_service_unittest") { - testonly = true - - sources = [ "path_service_unittest.cc" ] - - deps = [ - ":base", - "//base/test:test_support", - "//testing/gtest", - ] - - if (is_ios) { - deps += [ ":base_generated_test_file_bundle_data" ] - } else { - data_deps = [ ":generate_file_for_test" ] - } -} - -test("base_unittests") { - sources = [ - "allocator/dispatcher/dispatcher_unittest.cc", - "allocator/dispatcher/initializer_unittest.cc", - "allocator/dispatcher/internal/dispatcher_internal_unittest.cc", - "allocator/dispatcher/testing/dispatcher_test.cc", - "allocator/dispatcher/testing/dispatcher_test.h", - "allocator/dispatcher/testing/observer_mock.h", - "allocator/dispatcher/testing/tools.h", - "allocator/dispatcher/tls_unittest.cc", - "at_exit_unittest.cc", - "atomicops_unittest.cc", - "auto_reset_unittest.cc", - "barrier_callback_unittest.cc", - "barrier_closure_unittest.cc", - "base64_unittest.cc", - "base64url_unittest.cc", - "bit_cast_unittest.cc", - "bits_unittest.cc", - "build_time_unittest.cc", - "callback_list_unittest.cc", - "cancelable_callback_unittest.cc", - "check_is_test_unittest.cc", - "check_unittest.cc", - "command_line_unittest.cc", - "component_export_unittest.cc", - "containers/adapters_unittest.cc", - "containers/buffer_iterator_unittest.cc", - "containers/checked_iterators_unittest.cc", - "containers/circular_deque_unittest.cc", - "containers/contains_unittest.cc", - "containers/enum_set_unittest.cc", - "containers/extend_unittest.cc", - "containers/fixed_flat_map_unittest.cc", - "containers/fixed_flat_set_unittest.cc", - "containers/flat_map_unittest.cc", - "containers/flat_set_unittest.cc", - "containers/flat_tree_unittest.cc", - "containers/heap_array_unittest.cc", - "containers/id_map_unittest.cc", - "containers/intrusive_heap_unittest.cc", - "containers/linked_list_unittest.cc", - "containers/lru_cache_unittest.cc", - "containers/map_util_unittest.cc", - "containers/small_map_unittest.cc", - "containers/span_or_size_unittest.cc", - "containers/span_reader_unittest.cc", - "containers/span_unittest.cc", - "containers/span_writer_unittest.cc", - "containers/to_value_list_unittest.cc", - "containers/to_vector_unittest.cc", - "containers/unique_ptr_adapters_unittest.cc", - "containers/vector_buffer_unittest.cc", - "cpu_unittest.cc", - "debug/alias_unittest.cc", - "debug/asan_service_unittest.cc", - "debug/crash_logging_unittest.cc", - "debug/debugger_unittest.cc", - "debug/dump_without_crashing_unittest.cc", - "debug/stack_trace_unittest.cc", - "debug/task_trace_unittest.cc", - "environment_unittest.cc", - "feature_list_unittest.cc", - "files/block_tests_writing_to_special_dirs_unittest.cc", - "files/file_enumerator_unittest.cc", - "files/file_error_or_unittest.cc", - "files/file_path_unittest.cc", - "files/file_path_watcher_unittest.cc", - "files/file_proxy_unittest.cc", - "files/file_unittest.cc", - "files/file_util_unittest.cc", - "files/important_file_writer_cleaner_unittest.cc", - "files/important_file_writer_unittest.cc", - "files/memory_mapped_file_unittest.cc", - "files/safe_base_name_unittest.cc", - "files/scoped_temp_dir_unittest.cc", - "files/scoped_temp_file_unittest.cc", - "functional/bind_unittest.cc", - "functional/callback_helpers_unittest.cc", - "functional/callback_unittest.cc", - "functional/concurrent_callbacks_unittest.cc", - "functional/concurrent_closures_unittest.cc", - "functional/function_ref_unittest.cc", - "functional/overloaded_unittest.cc", - "gmock_unittest.cc", - "hash/hash_unittest.cc", - "hash/legacy_hash_unittest.cc", - "hash/md5_constexpr_unittest.cc", - "hash/md5_unittest.cc", - "hash/sha1_unittest.cc", - "i18n/break_iterator_unittest.cc", - "i18n/case_conversion_unittest.cc", - "i18n/char_iterator_unittest.cc", - "i18n/character_encoding_unittest.cc", - "i18n/file_util_icu_unittest.cc", - "i18n/icu_string_conversions_unittest.cc", - "i18n/icu_util_unittest.cc", - "i18n/message_formatter_unittest.cc", - "i18n/number_formatting_unittest.cc", - "i18n/rtl_unittest.cc", - "i18n/streaming_utf8_validator_unittest.cc", - "i18n/string_search_unittest.cc", - "i18n/time_formatting_unittest.cc", - "i18n/timezone_unittest.cc", - "i18n/transliterator_unittest.cc", - "immediate_crash_unittest.cc", - "json/json_parser_unittest.cc", - "json/json_reader_unittest.cc", - "json/json_value_converter_unittest.cc", - "json/json_value_serializer_unittest.cc", - "json/json_writer_unittest.cc", - "json/string_escape_unittest.cc", - "json/values_util_unittest.cc", - "lazy_instance_unittest.cc", - "logging_unittest.cc", - "memory/aligned_memory_unittest.cc", - "memory/discardable_memory_backing_field_trial_unittest.cc", - "memory/discardable_shared_memory_unittest.cc", - "memory/memory_pressure_listener_unittest.cc", - "memory/platform_shared_memory_region_unittest.cc", - "memory/protected_memory_unittest.cc", - "memory/ptr_util_unittest.cc", - "memory/raw_ptr_asan_unittest.cc", - "memory/raw_ptr_chromium_unittest.cc", - "memory/raw_span_unittest.cc", - "memory/ref_counted_memory_unittest.cc", - "memory/ref_counted_unittest.cc", - "memory/safe_ref_unittest.cc", - "memory/safety_checks_unittest.cc", - "memory/shared_memory_hooks_unittest.cc", - "memory/shared_memory_mapping_unittest.cc", - "memory/shared_memory_region_unittest.cc", - "memory/singleton_unittest.cc", - "memory/structured_shared_memory_unittest.cc", - "memory/unsafe_shared_memory_pool_unittest.cc", - "memory/values_equivalent_unittest.cc", - "memory/weak_auto_reset_unittest.cc", - "memory/weak_ptr_unittest.cc", - "message_loop/message_pump_glib_unittest.cc", - "message_loop/message_pump_unittest.cc", - "message_loop/work_id_provider_unittest.cc", - "metrics/bucket_ranges_unittest.cc", - "metrics/crc32_unittest.cc", - "metrics/field_trial_params_unittest.cc", - "metrics/field_trial_unittest.cc", - "metrics/histogram_base_unittest.cc", - "metrics/histogram_delta_serialization_unittest.cc", - "metrics/histogram_functions_unittest.cc", - "metrics/histogram_macros_unittest.cc", - "metrics/histogram_samples_unittest.cc", - "metrics/histogram_snapshot_manager_unittest.cc", - "metrics/histogram_threadsafe_unittest.cc", - "metrics/histogram_unittest.cc", - "metrics/metrics_hashes_unittest.cc", - "metrics/persistent_histogram_allocator_unittest.cc", - "metrics/persistent_histogram_storage_unittest.cc", - "metrics/persistent_memory_allocator_unittest.cc", - "metrics/persistent_sample_map_unittest.cc", - "metrics/ranges_manager_unittest.cc", - "metrics/sample_map_unittest.cc", - "metrics/sample_vector_unittest.cc", - "metrics/single_sample_metrics_unittest.cc", - "metrics/sparse_histogram_unittest.cc", - "metrics/statistics_recorder_starvation_unittest.cc", - "metrics/statistics_recorder_unittest.cc", - "moving_window_unittest.cc", - "native_library_unittest.cc", - "no_destructor_unittest.cc", - "observer_list_threadsafe_unittest.cc", - "observer_list_unittest.cc", - "one_shot_event_unittest.cc", - "parameter_pack_unittest.cc", - "pickle_unittest.cc", - "power_monitor/battery_level_provider_unittest.cc", - "power_monitor/battery_state_sampler_unittest.cc", - "power_monitor/power_monitor_device_source_unittest.cc", - "power_monitor/power_monitor_unittest.cc", - "power_monitor/timer_sampling_event_source_unittest.cc", - "process/environment_internal_unittest.cc", - "process/launch_unittest.cc", - "process/memory_unittest.cc", - "process/process_metrics_unittest.cc", - "process/process_unittest.cc", - "process/process_util_unittest.cc", - "profiler/metadata_recorder_unittest.cc", - "profiler/module_cache_unittest.cc", - "profiler/sample_metadata_unittest.cc", - "profiler/stack_buffer_unittest.cc", - "profiler/stack_copier_suspend_unittest.cc", - "profiler/stack_copier_unittest.cc", - "profiler/stack_sampler_unittest.cc", - "profiler/stack_sampling_profiler_unittest.cc", - "rand_util_unittest.cc", - "ranges/algorithm_unittest.cc", - "ranges/functional_unittest.cc", - "run_loop_unittest.cc", - "safe_numerics_unittest.cc", - "sampling_heap_profiler/lock_free_address_hash_set_unittest.cc", - "scoped_add_feature_flags_unittest.cc", - "scoped_clear_last_error_unittest.cc", - "scoped_generic_unittest.cc", - "scoped_multi_source_observation_unittest.cc", - "scoped_native_library_unittest.cc", - "scoped_observation_unittest.cc", - "security_unittest.cc", - "sequence_checker_unittest.cc", - "sequence_token_unittest.cc", - "state_transitions_unittest.cc", - "std_clamp_unittest.cc", - "stl_util_unittest.cc", - "strings/abseil_string_number_conversions_unittest.cc", - "strings/cstring_view_unittest.cc", - "strings/escape_unittest.cc", - "strings/levenshtein_distance_unittest.cc", - "strings/no_trigraphs_unittest.cc", - "strings/pattern_unittest.cc", - "strings/safe_sprintf_unittest.cc", - "strings/strcat_unittest.cc", - "strings/string_number_conversions_unittest.cc", - "strings/string_split_unittest.cc", - "strings/string_tokenizer_unittest.cc", - "strings/string_util_unittest.cc", - "strings/stringize_macros_unittest.cc", - "strings/stringprintf_unittest.cc", - "strings/sys_string_conversions_unittest.cc", - "strings/to_string_unittest.cc", - "strings/utf_offset_string_conversions_unittest.cc", - "strings/utf_string_conversion_utils_unittest.cc", - "strings/utf_string_conversions_unittest.cc", - "substring_set_matcher/string_pattern_unittest.cc", - "substring_set_matcher/substring_set_matcher_unittest.cc", - "supports_user_data_unittest.cc", - "sync_socket_unittest.cc", - "synchronization/atomic_flag_unittest.cc", - "synchronization/condition_variable_unittest.cc", - "synchronization/lock_unittest.cc", - "synchronization/waitable_event_unittest.cc", - "synchronization/waitable_event_watcher_unittest.cc", - "sys_byteorder_unittest.cc", - "system/sys_info_unittest.cc", - "system/system_monitor_unittest.cc", - "task/bind_post_task_unittest.cc", - "task/cancelable_task_tracker_unittest.cc", - "task/common/checked_lock_unittest.cc", - "task/common/operations_controller_unittest.cc", - "task/common/task_annotator_unittest.cc", - "task/default_delayed_task_handle_delegate_unittest.cc", - "task/deferred_sequenced_task_runner_unittest.cc", - "task/delayed_task_handle_unittest.cc", - "task/lazy_thread_pool_task_runner_unittest.cc", - "task/post_job_unittest.cc", - "task/scoped_set_task_priority_for_current_thread_unittest.cc", - "task/sequence_manager/atomic_flag_set_unittest.cc", - "task/sequence_manager/lazily_deallocated_deque_unittest.cc", - "task/sequence_manager/sequence_manager_impl_unittest.cc", - "task/sequence_manager/task_order_unittest.cc", - "task/sequence_manager/task_queue_selector_unittest.cc", - "task/sequence_manager/task_queue_unittest.cc", - "task/sequence_manager/test/mock_time_message_pump_unittest.cc", - "task/sequence_manager/thread_controller_power_monitor_unittest.cc", - "task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc", - "task/sequence_manager/wake_up_queue_unittest.cc", - "task/sequence_manager/work_deduplicator_unittest.cc", - "task/sequence_manager/work_queue_sets_unittest.cc", - "task/sequence_manager/work_queue_unittest.cc", - "task/sequence_manager/work_tracker_unittest.cc", - "task/sequenced_task_runner_unittest.cc", - "task/single_thread_task_executor_unittest.cc", - "task/single_thread_task_runner_unittest.cc", - "task/task_runner_unittest.cc", - "task/task_traits_unittest.cc", - "task/thread_pool/can_run_policy_test.h", - "task/thread_pool/delayed_priority_queue_unittest.cc", - "task/thread_pool/delayed_task_manager_unittest.cc", - "task/thread_pool/environment_config_unittest.cc", - "task/thread_pool/job_task_source_unittest.cc", - "task/thread_pool/pooled_single_thread_task_runner_manager_unittest.cc", - "task/thread_pool/priority_queue_unittest.cc", - "task/thread_pool/sequence_unittest.cc", - "task/thread_pool/service_thread_unittest.cc", - "task/thread_pool/task_source_sort_key_unittest.cc", - "task/thread_pool/task_tracker_unittest.cc", - "task/thread_pool/test_task_factory.cc", - "task/thread_pool/test_task_factory.h", - "task/thread_pool/test_utils.cc", - "task/thread_pool/test_utils.h", - "task/thread_pool/thread_group_impl_unittest.cc", - "task/thread_pool/thread_group_unittest.cc", - "task/thread_pool/thread_pool_impl_unittest.cc", - "task/thread_pool/tracked_ref_unittest.cc", - "task/thread_pool/worker_thread_set_unittest.cc", - "task/thread_pool_unittest.cc", - "test/gmock_callback_support_unittest.cc", - "test/gmock_expected_support_unittest.cc", - "test/gmock_move_support_unittest.cc", - "test/gtest_links_unittest.cc", - "test/gtest_tags_unittest.cc", - "test/gtest_xml_unittest_result_printer_unittest.cc", - "test/launcher/test_launcher_unittest.cc", - "test/launcher/test_results_tracker_unittest.cc", - "test/memory/dangling_ptr_instrumentation.cc", - "test/memory/dangling_ptr_instrumentation.h", - "test/metrics/action_suffix_reader_unittest.cc", - "test/metrics/histogram_enum_reader_unittest.cc", - "test/metrics/histogram_tester_unittest.cc", - "test/metrics/histogram_variants_reader_unittest.cc", - "test/metrics/user_action_tester_unittest.cc", - "test/mock_callback_unittest.cc", - "test/rectify_callback_unittest.cc", - "test/repeating_test_future_unittest.cc", - "test/run_until_unittest.cc", - "test/scoped_feature_list_unittest.cc", - "test/scoped_logging_settings.h", - "test/scoped_mock_clock_override_unittest.cc", - "test/scoped_mock_time_message_loop_task_runner_unittest.cc", - "test/scoped_run_loop_timeout_unittest.cc", - "test/task_environment_unittest.cc", - "test/test_future_unittest.cc", - "test/test_mock_time_task_runner_unittest.cc", - "test/test_pending_task_unittest.cc", - "test/test_proto_loader_unittest.cc", - "test/test_waitable_event_unittest.cc", - "thread_annotations_unittest.cc", - "threading/hang_watcher_unittest.cc", - "threading/platform_thread_unittest.cc", - "threading/post_task_and_reply_impl_unittest.cc", - "threading/scoped_blocking_call_unittest.cc", - "threading/scoped_thread_priority_unittest.cc", - "threading/sequence_bound_unittest.cc", - "threading/sequence_local_storage_map_unittest.cc", - "threading/sequence_local_storage_slot_unittest.cc", - "threading/simple_thread_unittest.cc", - "threading/thread_checker_unittest.cc", - "threading/thread_collision_warner_unittest.cc", - "threading/thread_id_name_manager_unittest.cc", - "threading/thread_local_storage_unittest.cc", - "threading/thread_local_unittest.cc", - "threading/thread_restrictions_unittest.cc", - "threading/thread_unittest.cc", - "threading/watchdog_unittest.cc", - "time/pr_time_unittest.cc", - "time/time_delta_from_string_unittest.cc", - "time/time_unittest.cc", - "timer/elapsed_timer_unittest.cc", - "timer/hi_res_timer_manager_unittest.cc", - "timer/lap_timer_unittest.cc", - "timer/mock_timer_unittest.cc", - "timer/timer_unittest.cc", - "timer/wall_clock_timer_unittest.cc", - "token_unittest.cc", - "tools_sanity_unittest.cc", - "traits_bag_unittest.cc", - "tuple_unittest.cc", - "types/cxx23_is_scoped_enum_unittest.cc", - "types/cxx23_to_underlying_unittest.cc", - "types/expected_macros_unittest.cc", - "types/expected_unittest.cc", - "types/fixed_array_unittest.cc", - "types/id_type_unittest.cc", - "types/is_complete_unittest.cc", - "types/is_instantiation_unittest.cc", - "types/optional_ref_unittest.cc", - "types/optional_unittest.cc", - "types/optional_util_unittest.cc", - "types/pass_key_unittest.cc", - "types/strong_alias_unittest.cc", - "types/supports_ostream_operator_unittest.cc", - "types/to_address_unittest.cc", - "types/token_type_unittest.cc", - "types/variant_util_unittest.cc", - "unguessable_token_unittest.cc", - "unsafe_buffers_unittest.cc", - "uuid_unittest.cc", - "value_iterators_unittest.cc", - "values_unittest.cc", - "version_unittest.cc", - "vlog_unittest.cc", - - # TODO(crbug.com/40158212): Move partition_alloc tests into its repository. - "allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_test_support.h", - "allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_unittest.cc", - "allocator/partition_allocator/src/partition_alloc/pointers/raw_ref_unittest.cc", - ] - - if (!is_cronet_build) { - # location_unittest.cc fails gn check for tracing-shimmed Cronet builds. - # Cronet buildbot do not run base_unittests, so exclusing this test - # instead of adding a nogncheck is preferred (crbug.com/1400235). - sources += [ "location_unittest.cc" ] - } - - if (build_rust_base_conversions) { - sources += [ - "containers/span_rust_unittest.cc", - "strings/string_piece_rust_unittest.cc", - ] - } - - if (use_safe_libcxx || use_safe_libstdcxx) { - sources += [ "libcpp_hardening_test.cc" ] - } - - defines = [] - - deps = [ - ":base", - ":base_stack_sampling_profiler_test_util", - ":check_version_internal", - ":feature_list_buildflags", - ":i18n", - ":path_service_unittest", - ":sanitizer_buildflags", - "//base/allocator:buildflags", - "//base/numerics:unittests", - "//base/test:native_library_test_utils", - "//base/test:proto_test_support", - "//base/test:run_all_unittests", - "//base/test:test_proto", - "//base/test:test_support", - "//build:blink_buildflags", - "//build:branding_buildflags", - "//build:chromecast_buildflags", - "//build:chromeos_buildflags", - "//testing/gmock", - "//testing/gtest", - "//third_party/abseil-cpp:absl", - "//third_party/icu", - "//third_party/modp_b64", - - # TODO(crbug.com/40158212): Move partition_alloc tests into its repository. - "allocator/partition_allocator/src/partition_alloc:test_support", - ] - - # TODO(crbug.com/40158212): Move partition_alloc tests into its repository. - # - # Note: This requires checking `build_with_chromium` because partition_alloc - # do not provide ":unittests" when built outside of chromium. - # "//base" is a dependency of WebRTC where `build_with_chromium` is false. - # TODO(42223878): Remove standalone WebRTC dependency on //base. - if (build_with_chromium) { - deps += [ "allocator/partition_allocator/src/partition_alloc:unittests" ] - } - - data_deps = [ - "//base/test:immediate_crash_test_helper", - "//base/test:test_child_process", - "//base/test:test_shared_library", - "//testing/buildbot/filters:base_unittests_filters", - ] - if (is_ios) { - deps += [ "//base/test:test_shared_library_ios+bundle" ] - } - - if (is_android && enable_chrome_android_internal) { - data_deps += [ "//clank/build/bot/filters:base_unittests_filters" ] - } - - # Since cpu_unittest depends on __ARM_FEATURE_MEMORY_TAGGING, needs to - # enable clang's MTE feature. - configs += [ - "//base/allocator/partition_allocator/src/partition_alloc:memory_tagging", - ] - - if (build_rust_base_conversions) { - deps += [ "//build/rust:cxx_cppdeps" ] - } - - if (is_apple) { - public_deps = [ - ":base_unittests_bundle_data", - ":base_unittests_noarc", - ] - } - - data = [ - "test/data/", - "//tools/metrics/actions/actions.xml", - "//tools/metrics/histograms/enums.xml", - "//tools/metrics/histograms/test_data/histograms.xml", - ] - - if (use_blink) { - sources += [ - "metrics/histogram_shared_memory_unittest.cc", - - # TODO(crbug.com/40158212): Move partition_alloc tests into its repository. - "allocator/partition_allocator/src/partition_alloc/tagging_unittest.cc", - ] - - if (!is_ios) { - sources += [ "memory/shared_memory_switch_unittest.cc" ] - } - - data_deps += [ "//base/test:test_proto_descriptor" ] - data += [ "$root_gen_dir/base/test/test_proto.descriptor" ] - } - - if (is_win) { - deps += [ "//base/win:base_win_buildflags" ] - - sources += [ - "debug/gdi_debug_util_win_unittest.cc", - "file_version_info_win_unittest.cc", - "process/launch_unittest_win.cc", - "test/fake_iasync_operation_win_unittest.cc", - "test/test_file_util_win_unittest.cc", - "test/test_reg_util_win_unittest.cc", - "threading/platform_thread_win_unittest.cc", - "time/time_win_unittest.cc", - "win/access_control_list_unittest.cc", - "win/access_token_unittest.cc", - "win/async_operation_unittest.cc", - "win/com_init_balancer_unittest.cc", - "win/com_init_check_hook_unittest.cc", - "win/com_init_util_unittest.cc", - "win/dark_mode_support_unittest.cc", - "win/dispatch_stub.cc", - "win/dispatch_stub.h", - "win/dllmain.cc", - "win/elevation_util_unittest.cc", - "win/embedded_i18n/language_selector_unittest.cc", - "win/enum_variant_unittest.cc", - "win/event_trace_consumer_unittest.cc", - "win/event_trace_controller_unittest.cc", - "win/event_trace_provider_unittest.cc", - "win/hstring_reference_unittest.cc", - "win/i18n_unittest.cc", - "win/map_unittest.cc", - "win/message_window_unittest.cc", - "win/object_watcher_unittest.cc", - "win/pe_image_reader_unittest.cc", - "win/pe_image_unittest.cc", - "win/post_async_results_unittest.cc", - "win/reference_unittest.cc", - "win/registry_unittest.cc", - "win/scoped_bstr_unittest.cc", - "win/scoped_handle_unittest.cc", - "win/scoped_hstring_unittest.cc", - "win/scoped_localalloc_unittest.cc", - "win/scoped_process_information_unittest.cc", - "win/scoped_safearray_unittest.cc", - "win/scoped_variant_unittest.cc", - "win/scoped_winrt_initializer_unittest.cc", - "win/security_descriptor_unittest.cc", - "win/security_util_unittest.cc", - "win/shortcut_unittest.cc", - "win/sid_unittest.cc", - "win/startup_information_unittest.cc", - "win/variant_conversions_unittest.cc", - "win/variant_vector_unittest.cc", - "win/vector_unittest.cc", - "win/win_includes_unittest.cc", - "win/win_util_unittest.cc", - "win/window_enumerator_unittest.cc", - "win/windows_version_unittest.cc", - "win/winrt_storage_util_unittest.cc", - "win/wmi_unittest.cc", - "win/wrapped_window_proc_unittest.cc", - ] - - if (enable_cet_shadow_stack) { - sources += [ "win/cet_shadow_stack_unittest.cc" ] - } - - libs = [ - "ntdll.lib", - "onecore.lib", - ] - } - - if (is_linux || is_chromeos) { - sources += [ - "debug/proc_maps_linux_unittest.cc", - "files/scoped_file_linux_unittest.cc", - "nix/mime_util_xdg_unittest.cc", - "process/set_process_title_linux_unittest.cc", - ] - - if (!is_nacl) { - deps += [ ":stack_canary_linux_unittests" ] - } - } - - if (enable_base_tracing) { - sources += [ "test/test_trace_processor_example_unittest.cc" ] - } - - if (is_posix) { - sources += [ - "files/dir_reader_posix_unittest.cc", - "files/file_descriptor_watcher_posix_unittest.cc", - "memory/madv_free_discardable_memory_allocator_posix_unittest.cc", - "memory/madv_free_discardable_memory_posix_unittest.cc", - "message_loop/fd_watch_controller_posix_unittest.cc", - "posix/file_descriptor_shuffle_unittest.cc", - "posix/unix_domain_socket_unittest.cc", - ] - if (!is_nacl && !is_apple) { - sources += [ - "profiler/stack_base_address_posix_unittest.cc", - "profiler/stack_copier_signal_unittest.cc", - "profiler/thread_delegate_posix_unittest.cc", - ] - } - } - - # Allow more direct string conversions on platforms with native utf8 - # strings - if (is_apple || is_chromeos || is_castos || is_cast_android || is_fuchsia) { - defines += [ "SYSTEM_NATIVE_UTF8" ] - } - - if (is_android) { - # Add unwind tables in base_unittests_apk test apk. The unwind tables are - # generated from debug info in the binary. Removing "default_symbols" and - # adding symbols config removes the "strip_debug" config that strips the - # debug info, on base unittests apk. - if (can_unwind_with_cfi_table || enable_arm_cfi_table) { - configs -= [ "//build/config/compiler:default_symbols" ] - if (symbol_level == 2) { - configs += [ "//build/config/compiler:symbols" ] - } else { - configs += [ "//build/config/compiler:minimal_symbols" ] - } - add_unwind_tables_in_apk = true - } - if (can_unwind_with_cfi_table) { - sources += [ "trace_event/cfi_backtrace_android_unittest.cc" ] - } - if (current_cpu == "arm") { - sources += [ - "profiler/chrome_unwind_info_android_unittest.cc", - "profiler/chrome_unwinder_android_unittest.cc", - ] - } - if (current_cpu == "arm64") { - sources += [ "profiler/frame_pointer_unwinder_unittest.cc" ] - } - if (!exclude_unwind_tables && - (current_cpu == "arm" || current_cpu == "arm64")) { - sources += [ - "profiler/libunwindstack_unwinder_android_unittest.cc", - "profiler/native_unwinder_android_unittest.cc", - ] - deps += [ - ":base_profiler_reparsing_test_support_library", - ":base_profiler_test_support_java", - ":base_profiler_test_support_jni", - ":base_profiler_test_support_library", - ":native_unwinder_android", - ] - } - - sources += [ - "android/android_input_receiver_compat_unittest.cc", - "android/application_status_listener_unittest.cc", - "android/binder_unittest.cc", - "android/child_process_unittest.cc", - "android/content_uri_utils_unittest.cc", - "android/jank_metric_uma_recorder_unittest.cc", - "android/java_handler_thread_unittest.cc", - "android/jni_android_unittest.cc", - "android/jni_array_unittest.cc", - "android/jni_bytebuffer_unittest.cc", - "android/jni_string_unittest.cc", - "android/library_loader/library_prefetcher_unittest.cc", - "android/linker/linker_jni.cc", - "android/linker/linker_jni.h", - "android/linker/linker_unittest.cc", - "android/meminfo_dump_provider_unittest.cc", - "android/path_utils_unittest.cc", - "android/pmf_utils_unittest.cc", - "android/pre_freeze_background_memory_trimmer_unittest.cc", - "android/radio_utils_unittest.cc", - "android/scoped_java_ref_unittest.cc", - "android/sys_utils_unittest.cc", - "android/token_android_unittest.cc", - "android/unguessable_token_android_unittest.cc", - ] - - # Android does not use test_launcher to run gtests. - sources -= [ - "process/process_unittest.cc", - "process/process_util_unittest.cc", - "test/gtest_links_unittest.cc", - "test/gtest_tags_unittest.cc", - "test/gtest_xml_unittest_result_printer_unittest.cc", - "test/launcher/test_launcher_unittest.cc", - "test/launcher/test_results_tracker_unittest.cc", - ] - deps += [ - ":base_unittest_support_java", - ":base_unittest_support_jni", - "//base/test:test_support_java", - "//third_party/jni_zero", - ] - } - - if (build_allocation_stack_trace_recorder) { - sources += [ "debug/allocation_trace_unittest.cc" ] - } - - if (is_apple || current_os == "freebsd" || current_os == "openbsd") { - sources += [ "posix/sysctl_unittest.cc" ] - } - if (is_apple) { - sources += [ - "apple/backup_util_unittest.mm", - "apple/bind_objc_block_unittest.mm", - "apple/dispatch_source_mach_unittest.cc", - "apple/foundation_util_unittest.mm", - "strings/sys_string_conversions_apple_unittest.mm", - "types/is_arc_pointer_unittest.mm", - ] - } - - if (is_apple) { - sources += [ "time/time_apple_unittest.mm" ] - } - - if (is_mac) { - sources += [ - "apple/call_with_eh_frame_unittest.mm", - "apple/scoped_cftyperef_unittest.cc", - "apple/scoped_mach_vm_unittest.cc", - "apple/scoped_nsautorelease_pool_unittest.mm", - "apple/scoped_objc_class_swizzler_unittest.mm", - "enterprise_util_mac_unittest.mm", - "mac/launch_application_unittest.mm", - "mac/mac_util_unittest.mm", - "mac/mach_port_rendezvous_unittest.cc", - "mac/scoped_sending_event_unittest.mm", - "message_loop/message_pump_apple_unittest.mm", - "power_monitor/thermal_state_observer_mac_unittest.mm", - "process/memory_unittest_mac.h", - "process/memory_unittest_mac.mm", - "system/sys_info_mac_unittest.mm", - ] - data_deps += [ "//base/mac:launch_application_test_helper" ] - } - - if (is_ios) { - sources += [ - "ios/crb_protocol_observers_unittest.mm", - "ios/device_util_unittest.mm", - "ios/scoped_critical_action_unittest.mm", - ] - - bundle_deps = [ ":base_test_proto_bundle_data" ] - if (use_blink) { - bundle_deps += - [ "//testing/buildbot/filters:base_unittests_filters_bundle_data" ] - } - if (is_cronet_build) { - sources += [ "message_loop/message_pump_io_ios_unittest.cc" ] - } else { - sources += [ "message_loop/message_pump_kqueue_unittest.cc" ] - } - - # ios does not use test_launcher to run gtests. - sources -= [ - "files/file_path_watcher_unittest.cc", - "memory/discardable_shared_memory_unittest.cc", - "process/memory_unittest.cc", - "process/process_unittest.cc", - "process/process_util_unittest.cc", - "sync_socket_unittest.cc", - "synchronization/waitable_event_watcher_unittest.cc", - "test/gtest_links_unittest.cc", - "test/gtest_tags_unittest.cc", - "test/gtest_xml_unittest_result_printer_unittest.cc", - "test/launcher/test_launcher_unittest.cc", - "test/launcher/test_results_tracker_unittest.cc", - ] - - sources -= [ - # The immediate crash tests require shared libraries, which we don't - # support loading on iOS. - "immediate_crash_unittest.cc", - ] - - if (use_blink) { - sources += [ "files/file_path_watcher_unittest.cc" ] - } - } - - if (is_mac) { - sources += [ "message_loop/message_pump_kqueue_unittest.cc" ] - frameworks = [ - "CoreFoundation.framework", - "Foundation.framework", - ] - deps += [ ":base_profiler_test_support_library" ] - } - - if (is_fuchsia || is_linux || is_chromeos) { - sources += [ - "debug/elf_reader_unittest.cc", - "debug/test_elf_image_builder.cc", - "debug/test_elf_image_builder.h", - ] - - deps += [ "//base/test:malloc_wrapper" ] - defines += [ - # This library is used by ElfReaderTest to test reading elf files. - "MALLOC_WRAPPER_LIB=\"${shlib_prefix}malloc_wrapper${shlib_extension}\"", - ] - - if (!is_component_build) { - # Set rpath to find libmalloc_wrapper.so even in a non-component build. - configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] - } - } - - if (is_linux || is_chromeos_lacros) { - sources += [ - "linux_util_unittest.cc", - "nix/xdg_util_unittest.cc", - ] - } - - if (!use_glib) { - sources -= [ "message_loop/message_pump_glib_unittest.cc" ] - } - - if (use_epoll) { - sources += [ "message_loop/message_pump_epoll_unittest.cc" ] - } - - if (is_fuchsia) { - sources += [ - "files/dir_reader_posix_unittest.cc", - "files/file_descriptor_watcher_posix_unittest.cc", - "fuchsia/fidl_event_handler_unittest.cc", - "fuchsia/file_utils_unittest.cc", - "fuchsia/filtered_service_directory_unittest.cc", - "fuchsia/fuchsia_logging_unittest.cc", - "fuchsia/intl_profile_watcher_unittest.cc", - "fuchsia/mem_buffer_util_unittest.cc", - "fuchsia/scoped_natural_service_binding_unittest.cc", - "fuchsia/scoped_natural_service_publisher_unittest.cc", - "fuchsia/scoped_service_binding_unittest.cc", - "fuchsia/scoped_service_publisher_unittest.cc", - "fuchsia/system_build_info_unittest.cc", - "fuchsia/system_product_info_unittest.cc", - "fuchsia/test_component_context_for_process_unittest.cc", - "fuchsia/time_zone_data_unittest.cc", - "message_loop/fd_watch_controller_posix_unittest.cc", - "posix/file_descriptor_shuffle_unittest.cc", - ] - - deps += [ - ":test_interface_impl", - ":test_interface_natural_impl", - ":test_log_listener_safe", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.buildinfo:fuchsia.buildinfo_cpp", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.buildinfo:fuchsia.buildinfo_hlcpp", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo_cpp", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.intl:fuchsia.intl_hlcpp", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.logger:fuchsia.logger_cpp", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.mem:fuchsia.mem_hlcpp", - "//third_party/fuchsia-sdk/sdk/pkg/async", - "//third_party/fuchsia-sdk/sdk/pkg/async-default", - "//third_party/fuchsia-sdk/sdk/pkg/component_incoming_cpp", - "//third_party/fuchsia-sdk/sdk/pkg/fdio", - "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp", - ] - - additional_manifest_fragments = [ - "//build/config/fuchsia/test/logger.shard.test-cml", - - # Required by PartitionAllocPageAllocatorTest tests with exec capability. - "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml", - ] - } - - if (!is_fuchsia && !is_ios) { - sources += [ "files/file_locking_unittest.cc" ] - } - - if (is_android) { - deps += [ "//testing/android/native_test:native_test_native_code" ] - sources += [ - "debug/elf_reader_unittest.cc", - "debug/proc_maps_linux_unittest.cc", - "debug/test_elf_image_builder.cc", - "debug/test_elf_image_builder.h", - ] - } - - if (is_win) { - deps += [ "//base:scoped_handle_test_dll" ] - if (current_cpu == "x64" || current_cpu == "arm64") { - sources += [ "profiler/win32_stack_frame_unwinder_unittest.cc" ] - deps += [ ":base_profiler_test_support_library" ] - } - - # These tests are not built by default because they make heavy use of - # parameterized tests. Even when disabled, they incur a startup penalty on - # base_unittests. See comments in the file as for why they are disabled by - # default, and https://crbug.com/1475518 for one consequence of the process - # startup penalty. - # sources += [ "files/os_validation_win_unittest.cc" ] - - if (toolchain_has_rust && win_enable_cfg_guards) { - deps += [ ":rust_cfg_win_test" ] - } - } - if (is_apple) { - sources += [ "profiler/frame_pointer_unwinder_unittest.cc" ] - } - if (is_chromeos && (current_cpu == "x64" || current_cpu == "arm64")) { - sources += [ "profiler/frame_pointer_unwinder_unittest.cc" ] - deps += [ ":base_profiler_test_support_library" ] - } - - if (use_allocator_shim) { - sources += [ - "sampling_heap_profiler/poisson_allocation_sampler_unittest.cc", - "sampling_heap_profiler/sampling_heap_profiler_unittest.cc", - - # TODO(crbug.com/40158212): Move partition_alloc tests into its repository. - "allocator/partition_alloc_support_unittest.cc", - "allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_unittest.cc", - ] - } - - if (enable_base_tracing) { - sources += [ - "test/trace_event_analyzer_unittest.cc", - "trace_event/memory_allocator_dump_unittest.cc", - "trace_event/memory_dump_manager_unittest.cc", - "trace_event/memory_dump_scheduler_unittest.cc", - "trace_event/memory_infra_background_allowlist_unittest.cc", - "trace_event/memory_usage_estimator_unittest.cc", - "trace_event/process_memory_dump_unittest.cc", - "trace_event/trace_arguments_unittest.cc", - "trace_event/trace_category_unittest.cc", - "trace_event/trace_config_unittest.cc", - "trace_event/trace_event_unittest.cc", - "trace_event/traced_value_support_unittest.cc", - "trace_event/traced_value_unittest.cc", - "trace_event/typed_macros_unittest.cc", - "tracing/perfetto_task_runner_unittest.cc", - ] - - if (is_android) { - sources += [ - "trace_event/cpufreq_monitor_android_unittest.cc", - "trace_event/java_heap_dump_provider_android_unittest.cc", - ] - } - - if (is_win) { - sources += [ "trace_event/trace_logging_minimal_win_unittest.cc" ] - } - - deps += [ - "//third_party/perfetto/include/perfetto/trace_processor:storage", - "//third_party/perfetto/protos/perfetto/trace:lite", - "//third_party/perfetto/protos/perfetto/trace/interned_data:lite", - "//third_party/perfetto/protos/perfetto/trace/track_event:lite", - ] - } - - if (enable_nocompile_tests) { - deps += [ ":base_nocompile_tests" ] - } -} - -# Test that CFG is enabled in Rust code. -if (is_win && toolchain_has_rust) { - source_set("rust_cfg_win_test") { - testonly = true - deps = [ - ":base", - "//testing/gtest", - ] - data_deps = [ "//build/rust/tests/test_control_flow_guard" ] - sources = [ "memory/rust_cfg_win_unittest.cc" ] - } -} - action("build_date") { script = "write_build_date_header.py" @@ -4141,1333 +2689,6 @@ action("build_date") { ] } -if (enable_nocompile_tests) { - nocompile_source_set("base_nocompile_tests") { - sources = [ - "allocator/partition_allocator/src/partition_alloc/partition_alloc_base/thread_annotations_pa_nocompile.nc", - "allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_nocompile.nc", - "allocator/partition_allocator/src/partition_alloc/pointers/raw_ref_nocompile.nc", - "callback_list_nocompile.nc", - "containers/buffer_iterator_nocompile.nc", - "containers/checked_iterators_nocompile.nc", - "containers/contains_nocompile.nc", - "containers/enum_set_nocompile.nc", - "containers/fixed_flat_map_nocompile.nc", - "containers/fixed_flat_set_nocompile.nc", - "containers/heap_array_nocompile.nc", - "containers/span_nocompile.nc", - "containers/to_value_list_nocompile.nc", - "containers/to_vector_nocompile.nc", - "debug/crash_logging_nocompile.nc", - "functional/bind_nocompile.nc", - "functional/callback_nocompile.nc", - "functional/function_ref_nocompile.nc", - "functional/overloaded_nocompile.nc", - "logging_nocompile.nc", - "memory/protected_memory_nocompile.nc", - "memory/ref_counted_nocompile.nc", - "memory/shared_memory_mapping_nocompile.nc", - "memory/structured_shared_memory_nocompile.nc", - "memory/weak_ptr_nocompile.nc", - "metrics/field_trial_params_nocompile.nc", - "metrics/histogram_nocompile.nc", - "no_destructor_nocompile.nc", - "observer_list_nocompile.nc", - "run_loop_nocompile.nc", - "sequence_checker_nocompile.nc", - "strings/cstring_view_nocompile.nc", - "strings/stringprintf_nocompile.nc", - "synchronization/lock_nocompile.nc", - "task/bind_post_task_nocompile.nc", - "task/task_traits_nocompile.nc", - "test/bind_test_nocompile.nc", - "thread_annotations_nocompile.nc", - "traits_bag_nocompile.nc", - "types/expected_macros_nocompile.nc", - "types/pass_key_nocompile.nc", - "types/variant_util_nocompile.nc", - "unsafe_buffers_nocompile.nc", - "values_nocompile.nc", - ] - deps = [ ":base" ] - } -} - -if (is_android || is_robolectric) { - # This is a subset of the main "base_jni", used in the robolectric toolchain. - # While it would be nice to just make 2 unique generate_jnis, we can't because - # we will have 2 GEN_JNI classes in one compilation unit. This is fixable, see - # crbug.com/330173100. - generate_jni("base_robolectric_jni") { - sources = [ - "android/java/src/org/chromium/base/Callback.java", - "android/java/src/org/chromium/base/CommandLine.java", - "android/java/src/org/chromium/base/JNIUtils.java", - "android/java/src/org/chromium/base/JavaExceptionReporter.java", - "android/java/src/org/chromium/base/JniAndroid.java", - "android/java/src/org/chromium/base/Token.java", - "android/java/src/org/chromium/base/TokenBase.java", - "android/java/src/org/chromium/base/TraceEvent.java", - "android/java/src/org/chromium/base/UnguessableToken.java", - "android/java/src/org/chromium/base/library_loader/LibraryLoader.java", - "android/java/src/org/chromium/base/metrics/NativeUmaRecorder.java", - ] - public_deps = [ ":android_runtime_jni_headers" ] - } - - generate_jni("base_jni") { - sources = [ - "android/java/src/org/chromium/base/ApkAssets.java", - "android/java/src/org/chromium/base/BaseFeatureMap.java", - "android/java/src/org/chromium/base/BuildInfo.java", - "android/java/src/org/chromium/base/BundleUtils.java", - "android/java/src/org/chromium/base/CpuFeatures.java", - "android/java/src/org/chromium/base/EventLog.java", - "android/java/src/org/chromium/base/FeatureList.java", - "android/java/src/org/chromium/base/FeatureMap.java", - "android/java/src/org/chromium/base/Features.java", - "android/java/src/org/chromium/base/FieldTrialList.java", - "android/java/src/org/chromium/base/FileUtils.java", - "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java", - "android/java/src/org/chromium/base/InputHintChecker.java", - "android/java/src/org/chromium/base/IntStringCallback.java", - "android/java/src/org/chromium/base/JNIUtils.java", - "android/java/src/org/chromium/base/JavaExceptionReporter.java", - "android/java/src/org/chromium/base/JavaHandlerThread.java", - "android/java/src/org/chromium/base/JniAndroid.java", - "android/java/src/org/chromium/base/LocaleUtils.java", - "android/java/src/org/chromium/base/PathService.java", - "android/java/src/org/chromium/base/PathUtils.java", - "android/java/src/org/chromium/base/PowerMonitor.java", - "android/java/src/org/chromium/base/RadioUtils.java", - "android/java/src/org/chromium/base/TimezoneUtils.java", - "android/java/src/org/chromium/base/Token.java", - "android/java/src/org/chromium/base/TokenBase.java", - "android/java/src/org/chromium/base/UnguessableToken.java", - ] - - if (use_clang_profiling) { - sources += [ - "test/android/javatests/src/org/chromium/base/test/ClangProfiler.java", - ] - } - - public_deps = [ ":android_runtime_jni_headers" ] - } - - generate_jar_jni("android_runtime_jni_headers") { - classes = [ - "java/lang/Runnable.class", - "java/lang/Runtime.class", - "java/lang/Throwable.class", - ] - } - - generate_jni("process_launcher_jni") { - sources = [ "android/java/src/org/chromium/base/process_launcher/ChildProcessService.java" ] - } - - generate_jni("base_shared_preferences_jni") { - sources = [ "android/java/src/org/chromium/base/shared_preferences/SharedPreferencesManager.java" ] - } - - shared_library_with_jni("libbase_junit_tests") { - testonly = true - enable_target = is_robolectric - sources = [ "android/robolectric_jni_onload.cc" ] - deps = [ ":base($robolectric_toolchain)" ] - java_targets = [ ":base_junit_tests" ] - visibility = [ ":*" ] - - # Make jni.h available. - configs += [ "//third_party/jdk" ] - } -} # is_android || is_robolectric - -if (is_android) { - java_cpp_features("java_features_srcjar") { - # External code should depend on ":base_java" instead. - visibility = [ ":*" ] - sources = [ - "allocator/partition_alloc_features.cc", - "features.cc", - "task/task_features.cc", - ] - template = "android/java/src/org/chromium/base/BaseFeatures.java.tmpl" - } - - android_library("base_switches_java") { - srcjar_deps = [ ":java_switches_srcjar" ] - } - - java_cpp_strings("java_switches_srcjar") { - # External code should depend on ":base_java" instead. - visibility = [ ":*" ] - sources = [ "base_switches.cc" ] - template = "android/java/src/org/chromium/base/BaseSwitches.java.tmpl" - } - - android_library("process_launcher_java") { - srcjar_deps = [ - ":process_launcher_aidl", - ":process_launcher_jni", - ] - deps = [ - ":base_java", - "//build/android:build_java", - "//third_party/android_deps:com_google_code_findbugs_jsr305_java", - "//third_party/androidx:androidx_annotation_annotation_experimental_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/androidx:androidx_collection_collection_java", - "//third_party/androidx:androidx_core_core_java", - "//third_party/jni_zero:jni_zero_java", - ] - sources = [ - "android/java/src/org/chromium/base/process_launcher/BindService.java", - "android/java/src/org/chromium/base/process_launcher/ChildConnectionAllocator.java", - "android/java/src/org/chromium/base/process_launcher/ChildProcessConnection.java", - "android/java/src/org/chromium/base/process_launcher/ChildProcessConstants.java", - "android/java/src/org/chromium/base/process_launcher/ChildProcessLauncher.java", - "android/java/src/org/chromium/base/process_launcher/ChildProcessService.java", - "android/java/src/org/chromium/base/process_launcher/ChildProcessServiceDelegate.java", - "android/java/src/org/chromium/base/process_launcher/ChildServiceConnection.java", - "android/java/src/org/chromium/base/process_launcher/ChildServiceConnectionDelegate.java", - "android/java/src/org/chromium/base/process_launcher/ChildServiceConnectionFactory.java", - "android/java/src/org/chromium/base/process_launcher/ChildServiceConnectionImpl.java", - "android/java/src/org/chromium/base/process_launcher/FileDescriptorInfo.java", - ] - } - - android_library("base_java") { - srcjar_deps = [ - ":base_android_java_enums_srcjar", - ":base_jni", - ":java_features_srcjar", - ] - - deps = [ - "//build/android:build_java", - "//third_party/android_deps:com_google_code_findbugs_jsr305_java", - "//third_party/android_deps:com_google_errorprone_error_prone_annotations_java", - "//third_party/androidx:androidx_annotation_annotation_experimental_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - - sources = [ - "android/java/src/org/chromium/base/ApkAssets.java", - "android/java/src/org/chromium/base/BaseFeatureMap.java", - "android/java/src/org/chromium/base/BinderCallsListener.java", - "android/java/src/org/chromium/base/BuildInfo.java", - "android/java/src/org/chromium/base/BundleUtils.java", - "android/java/src/org/chromium/base/CallbackController.java", - "android/java/src/org/chromium/base/CollectionUtil.java", - "android/java/src/org/chromium/base/CommandLineInitUtil.java", - "android/java/src/org/chromium/base/CpuFeatures.java", - "android/java/src/org/chromium/base/DiscardableReferencePool.java", - "android/java/src/org/chromium/base/EventLog.java", - "android/java/src/org/chromium/base/FeatureList.java", - "android/java/src/org/chromium/base/FeatureMap.java", - "android/java/src/org/chromium/base/FeatureParam.java", - "android/java/src/org/chromium/base/Features.java", - "android/java/src/org/chromium/base/FieldTrialList.java", - "android/java/src/org/chromium/base/FileProviderUtils.java", - "android/java/src/org/chromium/base/FileUtils.java", - "android/java/src/org/chromium/base/Flag.java", - "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java", - "android/java/src/org/chromium/base/InputHintChecker.java", - "android/java/src/org/chromium/base/IntStringCallback.java", - "android/java/src/org/chromium/base/IntentUtils.java", - "android/java/src/org/chromium/base/JNIUtils.java", - "android/java/src/org/chromium/base/JavaExceptionReporter.java", - "android/java/src/org/chromium/base/JavaHandlerThread.java", - "android/java/src/org/chromium/base/JniAndroid.java", - "android/java/src/org/chromium/base/LocaleUtils.java", - "android/java/src/org/chromium/base/MathUtils.java", - "android/java/src/org/chromium/base/MutableBooleanParamWithSafeDefault.java", - "android/java/src/org/chromium/base/MutableFlagWithSafeDefault.java", - "android/java/src/org/chromium/base/MutableIntParamWithSafeDefault.java", - "android/java/src/org/chromium/base/MutableParamWithSafeDefault.java", - "android/java/src/org/chromium/base/PackageManagerUtils.java", - "android/java/src/org/chromium/base/PackageUtils.java", - "android/java/src/org/chromium/base/PathService.java", - "android/java/src/org/chromium/base/PathUtils.java", - "android/java/src/org/chromium/base/PiiElider.java", - "android/java/src/org/chromium/base/PostNativeFlag.java", - "android/java/src/org/chromium/base/PowerMonitor.java", - "android/java/src/org/chromium/base/PowerMonitorForQ.java", - "android/java/src/org/chromium/base/RadioUtils.java", - "android/java/src/org/chromium/base/RequiredCallback.java", - "android/java/src/org/chromium/base/TimezoneUtils.java", - "android/java/src/org/chromium/base/Token.java", - "android/java/src/org/chromium/base/TokenBase.java", - "android/java/src/org/chromium/base/UnguessableToken.java", - "android/java/src/org/chromium/base/UserData.java", - "android/java/src/org/chromium/base/UserDataHost.java", - "android/java/src/org/chromium/base/ValueChangedCallback.java", - "android/java/src/org/chromium/base/WrappedClassLoader.java", - ] - - if (use_clang_profiling) { - sources += [ - "test/android/javatests/src/org/chromium/base/test/ClangProfiler.java", - ] - } else { - sources += [ "test/android/javatests/src/stub/org/chromium/base/test/ClangProfiler.java" ] - } - - resources_package = "org.chromium.base" - - proguard_configs = [ "android/proguard/shared_with_cronet.flags" ] - public_deps = [ - ":activity_state_java", - ":base_switches_java", - ":callback_java", - ":command_line_java", - ":jank_tracker_java", - ":library_loader_java", - ":lifetime_java", - ":log_java", - ":memory_java", - ":metrics_java", - ":promise_java", - ":resetters_java", - ":stream_util_java", - ":supplier_java", - ":sys_utils_java", - ":tasks_java", - ":time_utils_java", - ":unowned_user_data_java", - ] - if (!is_cronet_build) { - proguard_configs += [ - "android/proguard/chromium_apk.flags", - "android/proguard/remove_logging.flags", - ] - } - } - - generate_jni("metrics_jni") { - sources = [ - "android/java/src/org/chromium/base/metrics/NativeUmaRecorder.java", - "android/java/src/org/chromium/base/metrics/StatisticsRecorderAndroid.java", - ] - } - - java_cpp_enum("metrics_enum_srcjar") { - sources = [ "metrics/histogram_base.h" ] - } - - android_library("metrics_java") { - srcjar_deps = [ - ":metrics_enum_srcjar", - ":metrics_jni", - ] - sources = [ - "android/java/src/org/chromium/base/metrics/CachingUmaRecorder.java", - "android/java/src/org/chromium/base/metrics/HistogramBucket.java", - "android/java/src/org/chromium/base/metrics/NativeUmaRecorder.java", - "android/java/src/org/chromium/base/metrics/NoopUmaRecorder.java", - "android/java/src/org/chromium/base/metrics/RecordHistogram.java", - "android/java/src/org/chromium/base/metrics/RecordUserAction.java", - "android/java/src/org/chromium/base/metrics/ScopedSysTraceEvent.java", - "android/java/src/org/chromium/base/metrics/StatisticsRecorderAndroid.java", - "android/java/src/org/chromium/base/metrics/TimingMetric.java", - "android/java/src/org/chromium/base/metrics/UmaRecorder.java", - "android/java/src/org/chromium/base/metrics/UmaRecorderHolder.java", - ] - deps = [ - ":callback_java", - ":log_java", - ":time_utils_java", - "//build/android:build_java", - "//third_party/android_deps:com_google_code_findbugs_jsr305_java", - "//third_party/android_deps:com_google_errorprone_error_prone_annotations_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - generate_jni("jank_tracker_jni") { - sources = [ "android/java/src/org/chromium/base/jank_tracker/JankMetricUMARecorder.java" ] - } - - android_library("jank_tracker_java") { - srcjar_deps = [ ":jank_tracker_jni" ] - sources = [ - "android/java/src/org/chromium/base/jank_tracker/FrameMetricsListener.java", - "android/java/src/org/chromium/base/jank_tracker/FrameMetricsStore.java", - "android/java/src/org/chromium/base/jank_tracker/JankActivityTracker.java", - "android/java/src/org/chromium/base/jank_tracker/JankEndScenarioTime.java", - "android/java/src/org/chromium/base/jank_tracker/JankMetricUMARecorder.java", - "android/java/src/org/chromium/base/jank_tracker/JankMetrics.java", - "android/java/src/org/chromium/base/jank_tracker/JankReportingRunnable.java", - "android/java/src/org/chromium/base/jank_tracker/JankReportingScheduler.java", - "android/java/src/org/chromium/base/jank_tracker/JankScenario.java", - "android/java/src/org/chromium/base/jank_tracker/JankTracker.java", - "android/java/src/org/chromium/base/jank_tracker/JankTrackerImpl.java", - "android/java/src/org/chromium/base/jank_tracker/JankTrackerStateController.java", - "android/java/src/org/chromium/base/jank_tracker/PlaceholderJankTracker.java", - ] - deps = [ - ":activity_state_java", - ":lifetime_java", - ":log_java", - ":tasks_java", - ":time_utils_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - java_cpp_enum("memory_pressure_level_enum_srcjar") { - sources = [ "memory/memory_pressure_listener.h" ] - } - - generate_jni("memory_jni") { - sources = [ - "android/java/src/org/chromium/base/MemoryPressureListener.java", - "android/java/src/org/chromium/base/memory/JavaHeapDumpGenerator.java", - "android/java/src/org/chromium/base/memory/MemoryInfoBridge.java", - "android/java/src/org/chromium/base/memory/MemoryPurgeManager.java", - ] - } - - android_library("memory_java") { - srcjar_deps = [ - ":memory_jni", - ":memory_pressure_level_enum_srcjar", - ] - sources = [ - "android/java/src/org/chromium/base/MemoryPressureListener.java", - "android/java/src/org/chromium/base/memory/JavaHeapDumpGenerator.java", - "android/java/src/org/chromium/base/memory/MemoryInfoBridge.java", - "android/java/src/org/chromium/base/memory/MemoryPressureCallback.java", - "android/java/src/org/chromium/base/memory/MemoryPressureMonitor.java", - "android/java/src/org/chromium/base/memory/MemoryPressureUma.java", - "android/java/src/org/chromium/base/memory/MemoryPurgeManager.java", - ] - deps = [ - ":library_loader_java", - ":log_java", - ":metrics_java", - ":resetters_java", - ":supplier_java", - ":tasks_java", - ":time_utils_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - android_library("lifetime_java") { - sources = [ - "android/java/src/org/chromium/base/LifetimeAssert.java", - "android/java/src/org/chromium/base/lifetime/DestroyChecker.java", - "android/java/src/org/chromium/base/lifetime/Destroyable.java", - ] - deps = [ - "//base:tasks_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - ] - } - - android_library("promise_java") { - sources = [ "android/java/src/org/chromium/base/Promise.java" ] - deps = [ - ":callback_java", - "//third_party/androidx:androidx_annotation_annotation_java", - ] - } - - android_library("unowned_user_data_java") { - sources = [ - "android/java/src/org/chromium/base/UnownedUserData.java", - "android/java/src/org/chromium/base/UnownedUserDataHost.java", - "android/java/src/org/chromium/base/UnownedUserDataKey.java", - ] - deps = [ - ":lifetime_java", - ":tasks_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - ] - } - - android_library("supplier_java") { - sources = [ - "android/java/src/org/chromium/base/supplier/DestroyableObservableSupplier.java", - "android/java/src/org/chromium/base/supplier/LazyOneshotSupplier.java", - "android/java/src/org/chromium/base/supplier/LazyOneshotSupplierImpl.java", - "android/java/src/org/chromium/base/supplier/ObservableSupplier.java", - "android/java/src/org/chromium/base/supplier/ObservableSupplierImpl.java", - "android/java/src/org/chromium/base/supplier/OneShotCallback.java", - "android/java/src/org/chromium/base/supplier/OneshotSupplier.java", - "android/java/src/org/chromium/base/supplier/OneshotSupplierImpl.java", - "android/java/src/org/chromium/base/supplier/Supplier.java", - "android/java/src/org/chromium/base/supplier/SupplierUtils.java", - "android/java/src/org/chromium/base/supplier/SyncOneshotSupplier.java", - "android/java/src/org/chromium/base/supplier/SyncOneshotSupplierImpl.java", - "android/java/src/org/chromium/base/supplier/TransitiveObservableSupplier.java", - "android/java/src/org/chromium/base/supplier/UnownedUserDataSupplier.java", - "android/java/src/org/chromium/base/supplier/UnwrapObservableSupplier.java", - ] - deps = [ - ":callback_java", - ":lifetime_java", - ":promise_java", - ":resetters_java", - ":tasks_java", - ":unowned_user_data_java", - "//third_party/androidx:androidx_annotation_annotation_java", - ] - } - android_library("time_utils_java") { - sources = [ "android/java/src/org/chromium/base/TimeUtils.java" ] - deps = [ "//build/android:build_java" ] - } - - generate_jni("callback_jni") { - sources = [ "android/java/src/org/chromium/base/Callback.java" ] - } - - android_library("callback_java") { - sources = [ "android/java/src/org/chromium/base/Callback.java" ] - deps = [ - "//build/android:build_java", - "//third_party/android_deps:com_google_code_findbugs_jsr305_java", - "//third_party/android_deps:com_google_errorprone_error_prone_annotations_java", - "//third_party/androidx:androidx_annotation_annotation_experimental_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - java_cpp_enum("library_loader_java_enums_srcjar") { - sources = [ "android/library_loader/library_loader_hooks.h" ] - } - - generate_jni("library_loader_jni") { - sources = [ - "android/java/src/org/chromium/base/library_loader/LibraryLoader.java", - "android/java/src/org/chromium/base/library_loader/LibraryPrefetcher.java", - ] - } - - generate_jni("tasks_jni") { - sources = [ - "android/java/src/org/chromium/base/ApplicationStatus.java", - "android/java/src/org/chromium/base/EarlyTraceEvent.java", - "android/java/src/org/chromium/base/ThreadUtils.java", - "android/java/src/org/chromium/base/TraceEvent.java", - "android/java/src/org/chromium/base/task/PostTask.java", - "android/java/src/org/chromium/base/task/TaskRunnerImpl.java", - ] - } - - java_cpp_enum("task_trait_enum_srcjar") { - sources = [ - "android/task_scheduler/task_runner_android.h", - "android/task_scheduler/task_traits_android.h", - ] - } - - android_library("tasks_java") { - srcjar_deps = [ - ":task_trait_enum_srcjar", - ":tasks_jni", - ] - sources = [ - # Dependencies added after this comment is tech-debt, should be untangled - # and moved to their own separate android_library. - "android/java/src/org/chromium/base/ApiCompatibilityUtils.java", - "android/java/src/org/chromium/base/ApplicationStatus.java", - "android/java/src/org/chromium/base/ContextUtils.java", - "android/java/src/org/chromium/base/EarlyTraceEvent.java", - "android/java/src/org/chromium/base/ObserverList.java", - "android/java/src/org/chromium/base/StrictModeContext.java", - "android/java/src/org/chromium/base/ThreadUtils.java", - "android/java/src/org/chromium/base/TraceEvent.java", - - # End of cyclic dependencies. - # The root of the problem stems from the fact that tasks/* depends - # on source code outside of task which created a harsh cycle - # dependency between AsyncTask -> TraceEvent -> ThreadUtil -> - # PostTask -> AsyncTask. This should be solved by making everything inside - # task/* self contained. - "android/java/src/org/chromium/base/task/AsyncTask.java", - "android/java/src/org/chromium/base/task/BackgroundOnlyAsyncTask.java", - "android/java/src/org/chromium/base/task/ChainedTasks.java", - "android/java/src/org/chromium/base/task/ChromeThreadPoolExecutor.java", - "android/java/src/org/chromium/base/task/PostTask.java", - "android/java/src/org/chromium/base/task/SequencedTaskRunner.java", - "android/java/src/org/chromium/base/task/SequencedTaskRunnerImpl.java", - "android/java/src/org/chromium/base/task/SerialExecutor.java", - "android/java/src/org/chromium/base/task/TaskOriginException.java", - "android/java/src/org/chromium/base/task/TaskRunner.java", - "android/java/src/org/chromium/base/task/TaskRunnerImpl.java", - "android/java/src/org/chromium/base/task/UiThreadTaskRunnerImpl.java", - ] - deps = [ - ":activity_state_java", - ":base_switches_java", - ":command_line_java", - ":log_java", - ":metrics_java", - ":resetters_java", - ":time_utils_java", - "//build/android:build_java", - "//third_party/android_deps:com_google_code_findbugs_jsr305_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - android_library("log_java") { - sources = [ - "android/java/src/org/chromium/base/JavaUtils.java", - "android/java/src/org/chromium/base/Log.java", - ] - deps = [ "//build/android:build_java" ] - } - - generate_jni("command_line_jni") { - sources = [ "android/java/src/org/chromium/base/CommandLine.java" ] - } - android_library("command_line_java") { - srcjar_deps = [ ":command_line_jni" ] - sources = [ "android/java/src/org/chromium/base/CommandLine.java" ] - deps = [ - ":log_java", - ":resetters_java", - "//third_party/androidx:androidx_annotation_annotation_experimental_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - generate_jni("content_uri_utils_jni") { - sources = [ "android/java/src/org/chromium/base/ContentUriUtils.java" ] - } - android_library("content_uri_utils_java") { - srcjar_deps = [ ":content_uri_utils_jni" ] - deps = [ - ":log_java", - ":stream_util_java", - ":tasks_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - sources = [ "android/java/src/org/chromium/base/ContentUriUtils.java" ] - } - - android_library("activity_state_java") { - srcjar_deps = [ ":application_status_enum_srcjar" ] - sources = [ - "android/java/src/org/chromium/base/ActivityLifecycleCallbacksAdapter.java", - "android/java/src/org/chromium/base/ActivityState.java", - ] - deps = [ "//third_party/androidx:androidx_annotation_annotation_java" ] - } - - java_cpp_enum("application_status_enum_srcjar") { - sources = [ "android/application_status_listener.h" ] - } - - android_library("service_loader_java") { - deps = [ - ":resetters_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - ] - sources = [ "android/java/src/org/chromium/base/ServiceLoaderUtil.java" ] - } - - android_library("resetters_java") { - deps = [ - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_experimental_java", - "//third_party/androidx:androidx_annotation_annotation_java", - ] - sources = [ "android/java/src/org/chromium/base/ResettersForTesting.java" ] - } - - generate_jni("sys_utils_jni") { - sources = [ "android/java/src/org/chromium/base/SysUtils.java" ] - } - - java_cpp_enum("sys_utils_enum_srcjar") { - sources = [ "android/linker/linker_jni.h" ] - } - - android_library("sys_utils_java") { - srcjar_deps = [ - ":sys_utils_enum_srcjar", - ":sys_utils_jni", - ] - sources = [ "android/java/src/org/chromium/base/SysUtils.java" ] - deps = [ - ":tasks_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - android_library("stream_util_java") { - sources = [ "android/java/src/org/chromium/base/StreamUtil.java" ] - } - - android_library("library_loader_java") { - srcjar_deps = [ - ":library_loader_java_enums_srcjar", - ":library_loader_jni", - ] - sources = [ - "android/java/src/org/chromium/base/library_loader/LibraryLoader.java", - "android/java/src/org/chromium/base/library_loader/LibraryPrefetcher.java", - "android/java/src/org/chromium/base/library_loader/Linker.java", - "android/java/src/org/chromium/base/library_loader/LinkerJni.java", - "android/java/src/org/chromium/base/library_loader/LoaderErrors.java", - "android/java/src/org/chromium/base/library_loader/NativeLibraryPreloader.java", - "android/java/src/org/chromium/base/library_loader/ProcessInitException.java", - ] - - deps = [ - ":base_switches_java", - ":callback_java", - ":command_line_java", - ":log_java", - ":metrics_java", - ":resetters_java", - ":stream_util_java", - ":sys_utils_java", - ":tasks_java", - ":time_utils_java", - "//build/android:build_java", - "//third_party/android_deps:com_google_code_findbugs_jsr305_java", - "//third_party/android_deps:com_google_errorprone_error_prone_annotations_java", - "//third_party/androidx:androidx_annotation_annotation_experimental_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - android_library("base_shared_preferences_java") { - deps = [ - ":base_java", - "//build/android:build_java", - "//third_party/android_deps:guava_android_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - ] - - sources = [ - "android/java/src/org/chromium/base/shared_preferences/KeyPrefix.java", - "android/java/src/org/chromium/base/shared_preferences/KnownPreferenceKeyRegistries.java", - "android/java/src/org/chromium/base/shared_preferences/PreferenceKeyChecker.java", - "android/java/src/org/chromium/base/shared_preferences/PreferenceKeyRegistry.java", - "android/java/src/org/chromium/base/shared_preferences/SharedPreferencesManager.java", - "android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java", - ] - } - - android_library("base_cached_flags_java") { - deps = [ - ":base_java", - ":base_shared_preferences_java", - "//base/version_info/android:version_constants_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - ] - - sources = [ - "android/java/src/org/chromium/base/cached_flags/AllCachedFieldTrialParameters.java", - "android/java/src/org/chromium/base/cached_flags/BooleanCachedFieldTrialParameter.java", - "android/java/src/org/chromium/base/cached_flags/CachedFieldTrialParameter.java", - "android/java/src/org/chromium/base/cached_flags/CachedFlag.java", - "android/java/src/org/chromium/base/cached_flags/CachedFlagUtils.java", - "android/java/src/org/chromium/base/cached_flags/CachedFlagsSafeMode.java", - "android/java/src/org/chromium/base/cached_flags/CachedFlagsSharedPreferences.java", - "android/java/src/org/chromium/base/cached_flags/DoubleCachedFieldTrialParameter.java", - "android/java/src/org/chromium/base/cached_flags/IntCachedFieldTrialParameter.java", - "android/java/src/org/chromium/base/cached_flags/StringCachedFieldTrialParameter.java", - "android/java/src/org/chromium/base/cached_flags/ValuesOverridden.java", - "android/java/src/org/chromium/base/cached_flags/ValuesReturned.java", - ] - } - - android_aidl("process_launcher_aidl") { - import_include = [ "android/java/src" ] - sources = [ - "android/java/src/org/chromium/base/process_launcher/IChildProcessService.aidl", - "android/java/src/org/chromium/base/process_launcher/IParentProcess.aidl", - ] - } - - android_library("base_javatests") { - testonly = true - - deps = [ - ":base_java", - ":base_java_test_support", - ":base_java_test_support_uncommon", - "//base/test:test_support_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/androidx:androidx_test_monitor_java", - "//third_party/androidx:androidx_test_rules_java", - "//third_party/androidx:androidx_test_runner_java", - "//third_party/hamcrest:hamcrest_java", - "//third_party/jni_zero:jni_zero_java", - "//third_party/junit:junit", - "//third_party/mockito:mockito_java", - ] - - sources = [ - # AssertsTest doesn't really belong in //base but it's preferable to - # stick it here than create another target for a single test. - "android/javatests/src/org/chromium/base/AdvancedMockContextTest.java", - "android/javatests/src/org/chromium/base/AssertsTest.java", - "android/javatests/src/org/chromium/base/BinderCallsListenerTest.java", - "android/javatests/src/org/chromium/base/CommandLineFlagsTest.java", - "android/javatests/src/org/chromium/base/CommandLineTest.java", - "android/javatests/src/org/chromium/base/EarlyTraceEventTest.java", - "android/javatests/src/org/chromium/base/IntentUtilsTest.java", - "android/javatests/src/org/chromium/base/LocaleUtilsTest.java", - "android/javatests/src/org/chromium/base/ObserverListTest.java", - "android/javatests/src/org/chromium/base/PackageUtilsTest.java", - "android/javatests/src/org/chromium/base/StrictModeContextTest.java", - "android/javatests/src/org/chromium/base/UserDataHostTest.java", - "android/javatests/src/org/chromium/base/jank_tracker/JankTrackerTest.java", - "android/javatests/src/org/chromium/base/library_loader/EarlyNativeTest.java", - "android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java", - "android/javatests/src/org/chromium/base/task/AsyncTaskTest.java", - "android/javatests/src/org/chromium/base/task/ChainedTasksTest.java", - "android/javatests/src/org/chromium/base/task/PostTaskTest.java", - "android/javatests/src/org/chromium/base/task/SequencedTaskRunnerImplTest.java", - "android/javatests/src/org/chromium/base/test/metrics/HistogramWatcherTestBase.java", - "android/javatests/src/org/chromium/base/test/metrics/HistogramWatcherTransitionToNativeTest.java", - "android/javatests/src/org/chromium/base/test/metrics/HistogramWatcherWithNativeTest.java", - "android/javatests/src/org/chromium/base/test/metrics/HistogramWatcherWithoutNativeTest.java", - "android/javatests/src/org/chromium/base/util/GarbageCollectionTestUtilsTest.java", - ] - srcjar_deps = [ ":base_javatests_jni" ] - } - - source_set("base_javatests_lib") { - testonly = true - deps = [ - ":base", - ":base_javatests_jni", - ] - sources = [ "test/library_loader/early_native_test_helper.cc" ] - } - - generate_jni("base_javatests_jni") { - testonly = true - sources = [ "android/javatests/src/org/chromium/base/library_loader/EarlyNativeTest.java" ] - } - - android_library("base_java_url_utils_for_test") { - testonly = true - sources = [ - "test/android/javatests/src/org/chromium/base/test/util/UrlUtils.java", - ] - - deps = [ - ":base_java", - "//build/android:build_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/jni_zero:jni_zero_java", - "//third_party/junit:junit", - ] - } - - android_library("base_java_test_support") { - testonly = true - - deps = [ - ":base_cached_flags_java", - ":base_java", - "//build/android:build_java", - "//testing/android/instrumentation:test_runner_java", - "//third_party/accessibility_test_framework:accessibility_core_java", - "//third_party/android_deps:com_google_code_findbugs_jsr305_java", - "//third_party/android_deps:espresso_java", - "//third_party/android_deps:guava_android_java", - "//third_party/android_sdk:android_test_mock_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/androidx:androidx_core_core_java", - "//third_party/androidx:androidx_multidex_multidex_java", - "//third_party/androidx:androidx_test_monitor_java", - "//third_party/androidx:androidx_test_runner_java", - "//third_party/androidx:androidx_test_uiautomator_uiautomator_java", - "//third_party/hamcrest:hamcrest_java", - "//third_party/jni_zero:jni_zero_java", - "//third_party/junit", - ] - - public_deps = [ - ":base_java_url_utils_for_test", - ":tasks_java", - ] - - sources = [ - "test/android/java/src/org/chromium/base/multidex/ChromiumMultiDexInstaller.java", - "test/android/javatests/src/org/chromium/base/test/ActivityFinisher.java", - "test/android/javatests/src/org/chromium/base/test/BaseActivityTestRule.java", - "test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java", - "test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java", - "test/android/javatests/src/org/chromium/base/test/LoadNative.java", - "test/android/javatests/src/org/chromium/base/test/NativeCoverageInstrumentationRunListener.java", - "test/android/javatests/src/org/chromium/base/test/ScreenshotOnFailureStatement.java", - "test/android/javatests/src/org/chromium/base/test/SharedPreferencesTestUtil.java", - "test/android/javatests/src/org/chromium/base/test/TestTraceEvent.java", - "test/android/javatests/src/org/chromium/base/test/params/BaseJUnit4RunnerDelegate.java", - "test/android/javatests/src/org/chromium/base/test/params/BlockJUnit4RunnerDelegate.java", - "test/android/javatests/src/org/chromium/base/test/params/MethodParamAnnotationRule.java", - "test/android/javatests/src/org/chromium/base/test/params/MethodParamRule.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterAnnotations.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterProvider.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterSet.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterizedCommandLineFlags.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterizedFrameworkMethod.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunner.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunnerDelegate.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunnerDelegateCommon.java", - "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunnerDelegateFactory.java", - "test/android/javatests/src/org/chromium/base/test/params/SkipCommandLineParameterization.java", - "test/android/javatests/src/org/chromium/base/test/util/AdvancedMockContext.java", - "test/android/javatests/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheck.java", - "test/android/javatests/src/org/chromium/base/test/util/AnnotationProcessingUtils.java", - "test/android/javatests/src/org/chromium/base/test/util/AnnotationRule.java", - "test/android/javatests/src/org/chromium/base/test/util/ApplicationContextWrapper.java", - "test/android/javatests/src/org/chromium/base/test/util/ApplicationTestUtils.java", - "test/android/javatests/src/org/chromium/base/test/util/BaseRestrictions.java", - "test/android/javatests/src/org/chromium/base/test/util/Batch.java", - "test/android/javatests/src/org/chromium/base/test/util/CallbackHelper.java", - "test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java", - "test/android/javatests/src/org/chromium/base/test/util/Criteria.java", - "test/android/javatests/src/org/chromium/base/test/util/CriteriaHelper.java", - "test/android/javatests/src/org/chromium/base/test/util/CriteriaNotSatisfiedException.java", - "test/android/javatests/src/org/chromium/base/test/util/DisableIf.java", - "test/android/javatests/src/org/chromium/base/test/util/DisableIfSkipCheck.java", - "test/android/javatests/src/org/chromium/base/test/util/DisabledTest.java", - "test/android/javatests/src/org/chromium/base/test/util/DoNotBatch.java", - "test/android/javatests/src/org/chromium/base/test/util/DoNotRevive.java", - "test/android/javatests/src/org/chromium/base/test/util/DumpThreadsOnFailureRule.java", - "test/android/javatests/src/org/chromium/base/test/util/EnormousTest.java", - "test/android/javatests/src/org/chromium/base/test/util/Feature.java", - "test/android/javatests/src/org/chromium/base/test/util/Features.java", - "test/android/javatests/src/org/chromium/base/test/util/FieldTrials.java", - "test/android/javatests/src/org/chromium/base/test/util/HistogramWatcher.java", - "test/android/javatests/src/org/chromium/base/test/util/InMemorySharedPreferences.java", - "test/android/javatests/src/org/chromium/base/test/util/InMemorySharedPreferencesContext.java", - "test/android/javatests/src/org/chromium/base/test/util/IntegrationTest.java", - "test/android/javatests/src/org/chromium/base/test/util/JniMocker.java", - "test/android/javatests/src/org/chromium/base/test/util/LooperUtils.java", - "test/android/javatests/src/org/chromium/base/test/util/Manual.java", - "test/android/javatests/src/org/chromium/base/test/util/MaxAndroidSdkLevel.java", - "test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevel.java", - "test/android/javatests/src/org/chromium/base/test/util/PackageManagerWrapper.java", - "test/android/javatests/src/org/chromium/base/test/util/PayloadCallbackHelper.java", - "test/android/javatests/src/org/chromium/base/test/util/RawFailureHandler.java", - "test/android/javatests/src/org/chromium/base/test/util/RequiresRestart.java", - "test/android/javatests/src/org/chromium/base/test/util/Restriction.java", - "test/android/javatests/src/org/chromium/base/test/util/RestrictionSkipCheck.java", - "test/android/javatests/src/org/chromium/base/test/util/ScalableTimeout.java", - "test/android/javatests/src/org/chromium/base/test/util/SkipCheck.java", - "test/android/javatests/src/org/chromium/base/test/util/TestAnimations.java", - "test/android/javatests/src/org/chromium/base/test/util/TestFileUtil.java", - "test/android/javatests/src/org/chromium/base/test/util/TestThreadUtils.java", - "test/android/javatests/src/org/chromium/base/test/util/TimeoutTimer.java", - "test/android/javatests/src/org/chromium/base/test/util/UserActionTester.java", - "test/android/javatests/src/org/chromium/base/test/util/ViewActionOnDescendant.java", - "test/android/javatests/src/org/chromium/base/test/util/ViewPrinter.java", - ] - if (use_clang_coverage) { - mergeable_android_manifests = [ - "test/android/javatests/AndroidManifest_NativeCoverageListener.xml", - ] - } - } - - generate_jni("base_java_test_support_uncommon_jni") { - testonly = true - sources = [ "test/android/javatests/src/org/chromium/base/test/task/ThreadPoolTestHelpers.java" ] - } - - android_library("base_java_test_support_uncommon") { - testonly = true - - deps = [ - "//base:base_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/androidx:androidx_test_monitor_java", - "//third_party/hamcrest:hamcrest_java", - "//third_party/jni_zero:jni_zero_java", - "//third_party/junit:junit", - ] - - srcjar_deps = [ ":base_java_test_support_uncommon_jni" ] - sources = [ - "test/android/javatests/src/org/chromium/base/FakeTimeTestRule.java", - "test/android/javatests/src/org/chromium/base/test/SetUpStatement.java", - "test/android/javatests/src/org/chromium/base/test/SetUpTestRule.java", - "test/android/javatests/src/org/chromium/base/test/task/SchedulerTestHelpers.java", - "test/android/javatests/src/org/chromium/base/test/task/ThreadPoolTestHelpers.java", - "test/android/javatests/src/org/chromium/base/test/util/CloseableOnMainThread.java", - "test/android/javatests/src/org/chromium/base/test/util/InstrumentationUtils.java", - "test/android/javatests/src/org/chromium/base/test/util/Matchers.java", - ] - } - - android_library("base_java_process_launcher_test_support") { - testonly = true - - public_deps = [ ":process_launcher_java" ] - - sources = [ "test/android/javatests/src/org/chromium/base/process_launcher/TestChildProcessConnection.java" ] - } - - robolectric_library("base_junit_test_support") { - sources = [ - "//third_party/robolectric/custom_asynctask/java/src/org/chromium/base/task/test/ShadowAsyncTask.java", - "//third_party/robolectric/custom_asynctask/java/src/org/chromium/base/task/test/ShadowAsyncTaskBridge.java", - "test/android/junit/src/org/chromium/base/task/test/BackgroundShadowAsyncTask.java", - "test/android/junit/src/org/chromium/base/task/test/CustomShadowAsyncTask.java", - "test/android/junit/src/org/chromium/base/task/test/PausedExecutorTestRule.java", - "test/android/junit/src/org/chromium/base/task/test/ShadowPostTask.java", - "test/android/junit/src/org/chromium/base/test/BaseRobolectricAndroidConfigurer.java", - "test/android/junit/src/org/chromium/base/test/BaseRobolectricTestListener.java", - "test/android/junit/src/org/chromium/base/test/BaseRobolectricTestRule.java", - "test/android/junit/src/org/chromium/base/test/BaseRobolectricTestRunner.java", - "test/android/junit/src/org/chromium/base/test/ShadowBuildInfo.java", - "test/android/junit/src/org/chromium/base/test/util/BaseFlagTestRule.java", - "test/android/junit/src/org/chromium/base/test/util/TestRunnerTestRule.java", - ] - - # Make sure robolectric tests have classes filtered out of base_java by - # jar_excluded_patterns. - srcjar_deps = [ "//build/android:native_libraries_gen" ] - - deps = [ - ":base_java", - ":base_java_test_support", - "//base:base_cached_flags_java", - "//build/android:build_java", - "//testing/android/junit:junit_test_support", - "//third_party/androidx:androidx_test_core_java", - "//third_party/androidx:androidx_test_monitor_java", - "//third_party/hamcrest:hamcrest_java", - "//third_party/junit:junit", - ] - } - - robolectric_binary("base_junit_tests") { - shared_libraries = [ ":libbase_junit_tests($robolectric_toolchain)" ] - sources = [ - "android/junit/src/org/chromium/base/ApplicationStatusTest.java", - "android/junit/src/org/chromium/base/BuildInfoTest.java", - "android/junit/src/org/chromium/base/CallbackControllerTest.java", - "android/junit/src/org/chromium/base/CollectionUtilTest.java", - "android/junit/src/org/chromium/base/CommandLineTest.java", - "android/junit/src/org/chromium/base/DiscardableReferencePoolTest.java", - "android/junit/src/org/chromium/base/FeatureListUnitTest.java", - "android/junit/src/org/chromium/base/FileUtilsTest.java", - "android/junit/src/org/chromium/base/FlagUnitTest.java", - "android/junit/src/org/chromium/base/LifetimeAssertTest.java", - "android/junit/src/org/chromium/base/LogTest.java", - "android/junit/src/org/chromium/base/MathUtilsTest.java", - "android/junit/src/org/chromium/base/MutableBooleanParamWithSafeDefaultUnitTest.java", - "android/junit/src/org/chromium/base/MutableFlagWithSafeDefaultUnitTest.java", - "android/junit/src/org/chromium/base/MutableIntParamWithSafeDefaultUnitTest.java", - "android/junit/src/org/chromium/base/PathUtilsTest.java", - "android/junit/src/org/chromium/base/PiiEliderTest.java", - "android/junit/src/org/chromium/base/PostNativeFlagUnitTest.java", - "android/junit/src/org/chromium/base/PromiseTest.java", - "android/junit/src/org/chromium/base/ResettersForTestingTest.java", - "android/junit/src/org/chromium/base/ThreadUtilsTest.java", - "android/junit/src/org/chromium/base/TimeUtilsTest.java", - "android/junit/src/org/chromium/base/TokenUnitTest.java", - "android/junit/src/org/chromium/base/TraceEventTest.java", - "android/junit/src/org/chromium/base/UnownedUserDataHostTest.java", - "android/junit/src/org/chromium/base/UnownedUserDataKeyTest.java", - "android/junit/src/org/chromium/base/ValueChangedCallbackTest.java", - "android/junit/src/org/chromium/base/cached_flags/CachedFeatureFlagsSafeModeUnitTest.java", - "android/junit/src/org/chromium/base/cached_flags/CachedFieldTrialParameterUnitTest.java", - "android/junit/src/org/chromium/base/cached_flags/CachedFlagUnitTest.java", - "android/junit/src/org/chromium/base/jank_tracker/FrameMetricsListenerTest.java", - "android/junit/src/org/chromium/base/jank_tracker/FrameMetricsStoreTest.java", - "android/junit/src/org/chromium/base/jank_tracker/JankActivityTrackerTest.java", - "android/junit/src/org/chromium/base/jank_tracker/JankMetricUMARecorderTest.java", - "android/junit/src/org/chromium/base/jank_tracker/JankReportingRunnableTest.java", - "android/junit/src/org/chromium/base/jank_tracker/JankReportingSchedulerTest.java", - "android/junit/src/org/chromium/base/library_loader/LinkerTest.java", - "android/junit/src/org/chromium/base/memory/MemoryPressureMonitorTest.java", - "android/junit/src/org/chromium/base/memory/MemoryPurgeManagerTest.java", - "android/junit/src/org/chromium/base/metrics/CachingUmaRecorderTest.java", - "android/junit/src/org/chromium/base/process_launcher/ChildConnectionAllocatorTest.java", - "android/junit/src/org/chromium/base/process_launcher/ChildProcessConnectionTest.java", - "android/junit/src/org/chromium/base/shared_preferences/KeyPrefixTest.java", - "android/junit/src/org/chromium/base/shared_preferences/KnownPreferenceKeyRegistriesTest.java", - "android/junit/src/org/chromium/base/shared_preferences/SharedPreferencesManagerTest.java", - "android/junit/src/org/chromium/base/shared_preferences/StrictPreferenceKeyCheckerTest.java", - "android/junit/src/org/chromium/base/supplier/LazyOneshotSupplierImplTest.java", - "android/junit/src/org/chromium/base/supplier/LazyOneshotSupplierTest.java", - "android/junit/src/org/chromium/base/supplier/ObservableSupplierImplTest.java", - "android/junit/src/org/chromium/base/supplier/OneShotCallbackTest.java", - "android/junit/src/org/chromium/base/supplier/OneshotSupplierImplTest.java", - "android/junit/src/org/chromium/base/supplier/SupplierUtilsTest.java", - "android/junit/src/org/chromium/base/supplier/SyncOneshotSupplierImplTest.java", - "android/junit/src/org/chromium/base/supplier/TransitiveObservableSupplierTest.java", - "android/junit/src/org/chromium/base/supplier/UnownedUserDataSupplierTest.java", - "android/junit/src/org/chromium/base/supplier/UnwrapObservableSupplierTest.java", - "android/junit/src/org/chromium/base/task/AsyncTaskThreadTest.java", - "android/junit/src/org/chromium/base/task/SequencedTaskRunnerTaskMigrationTest.java", - "android/junit/src/org/chromium/base/util/GarbageCollectionTestUtilsUnitTest.java", - "test/android/junit/src/org/chromium/base/test/SetUpStatementTest.java", - "test/android/junit/src/org/chromium/base/test/TestListInstrumentationRunListenerTest.java", - "test/android/junit/src/org/chromium/base/test/params/ExampleParameterizedTest.java", - "test/android/junit/src/org/chromium/base/test/params/ParameterizedRunnerDelegateCommonTest.java", - "test/android/junit/src/org/chromium/base/test/params/ParameterizedRunnerDelegateFactoryTest.java", - "test/android/junit/src/org/chromium/base/test/params/ParameterizedRunnerTest.java", - "test/android/junit/src/org/chromium/base/test/params/ParameterizedTestNameTest.java", - "test/android/junit/src/org/chromium/base/test/util/AndroidSdkLevelSkipCheckTest.java", - "test/android/junit/src/org/chromium/base/test/util/AnnotationProcessingUtilsTest.java", - "test/android/junit/src/org/chromium/base/test/util/CommandLineFlagsNoClassAnnotationCheckTest.java", - "test/android/junit/src/org/chromium/base/test/util/CommandLineFlagsWithClassAnnotationCheckTest.java", - "test/android/junit/src/org/chromium/base/test/util/DisableIfTest.java", - "test/android/junit/src/org/chromium/base/test/util/DisabledTestForClassRobolectricTest.java", - "test/android/junit/src/org/chromium/base/test/util/DisabledTestRobolectricTest.java", - "test/android/junit/src/org/chromium/base/test/util/RestrictionSkipCheckTest.java", - "test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java", - ] - deps = [ - ":base_cached_flags_java", - ":base_java", - ":base_java_process_launcher_test_support", - ":base_java_test_support", - ":base_java_test_support_uncommon", - ":base_junit_test_support", - ":base_shared_preferences_java", - "//base/test:public_transit_robolectric_tests_java", - "//base/test:test_support_java", - "//testing/android/instrumentation:test_runner_java", - "//third_party/android_deps:guava_android_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/androidx:androidx_test_core_java", - "//third_party/androidx:androidx_test_runner_java", - "//third_party/hamcrest:hamcrest_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - java_cpp_enum("base_android_java_enums_srcjar") { - sources = [ - "android/child_process_binding_types.h", - "power_monitor/power_observer.h", - "process/kill.h", - "task/task_traits.h", - ] - if (enable_base_tracing) { - sources += [ "trace_event/trace_config.h" ] - } - } - - generate_jni("base_profiler_test_support_jni") { - testonly = true - sources = - [ "android/javatests/src/org/chromium/base/profiler/TestSupport.java" ] - } - - android_library("base_profiler_test_support_java") { - testonly = true - sources = - [ "android/javatests/src/org/chromium/base/profiler/TestSupport.java" ] - srcjar_deps = [ ":base_profiler_test_support_jni" ] - - deps = [ - "//build/android:build_java", - "//third_party/jni_zero:jni_zero_java", - ] - } - - generate_jni("base_unittest_support_jni") { - testonly = true - sources = - [ "test/android/java/src/org/chromium/base/JniAndroidTestUtils.java" ] - } - - # Used by gtests and not by robolectric / instrumentation tests. - android_library("base_unittest_support_java") { - testonly = true - - deps = [ - ":base_java", - ":content_uri_utils_java", - "//third_party/jni_zero:jni_zero_java", - ] - srcjar_deps = [ ":base_unittest_support_jni" ] - - sources = [ - "test/android/java/src/org/chromium/base/ContentUriTestUtils.java", - "test/android/java/src/org/chromium/base/JavaHandlerThreadHelpers.java", - "test/android/java/src/org/chromium/base/JniAndroidTestUtils.java", - ] - } -} # is_android - -# Keep the list of fuzzer_tests in alphabetical order. -fuzzer_test("base64_decode_fuzzer") { - sources = [ "base64_decode_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("base64_encode_fuzzer") { - sources = [ "base64_encode_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("base64url_fuzzer") { - sources = [ "base64url_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("base_json_correctness_fuzzer") { - sources = [ "json/json_correctness_fuzzer.cc" ] - deps = [ ":base" ] - dict = "//testing/libfuzzer/fuzzers/dicts/json.dict" -} - -fuzzer_test("base_json_reader_fuzzer") { - sources = [ "json/json_reader_fuzzer.cc" ] - deps = [ "//base" ] - dict = "//testing/libfuzzer/fuzzers/dicts/json.dict" -} - -fuzzer_test("base_json_string_escape_fuzzer") { - sources = [ "json/string_escape_fuzzer.cc" ] - deps = [ "//base" ] -} - -if (is_mac) { - protoc_convert("base_mach_port_rendezvous_convert_corpus") { - sources = [ - "test/data/mach_port_rendezvous_fuzz/dead_name.textproto", - "test/data/mach_port_rendezvous_fuzz/send.textproto", - ] - inputs = [ "//testing/libfuzzer/fuzzers/mach/mach_message.proto" ] - output_pattern = "$target_gen_dir/base_mach_port_rendezvous_corpus/{{source_name_part}}.binarypb" - args = [ - "--encode=mach_fuzzer.MachMessage", - "-I", - rebase_path("//"), - rebase_path(inputs[0]), - ] - } - fuzzer_test("base_mach_port_rendezvous_fuzzer") { - sources = [ "mac/mach_port_rendezvous_fuzzer.cc" ] - deps = [ - "//base", - "//testing/libfuzzer/fuzzers/mach:converter", - "//third_party/libprotobuf-mutator", - ] - seed_corpus = "$target_gen_dir/base_mach_port_rendezvous_corpus" - seed_corpus_deps = [ ":base_mach_port_rendezvous_convert_corpus" ] - } -} - -fuzzer_test("command_line_fuzzer") { - sources = [ "command_line_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("escape_fuzzer") { - sources = [ "strings/escape_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("file_path_fuzzer") { - sources = [ "files/file_path_fuzzer.cc" ] - deps = [ "//base" ] -} - -if (is_linux || is_chromeos) { - fuzzer_test("mime_util_xdg_fuzzer") { - sources = [ "nix/mime_util_xdg_fuzzer.cc" ] - deps = [ "//base" ] - } -} - -fuzzer_test("base_persistent_histogram_allocator_fuzzer") { - sources = [ "metrics/persistent_histogram_allocator_fuzzer.cc" ] - deps = [ "//base" ] - seed_corpus = "//base/test/data/pma_corpus" -} - -fuzzer_test("string_number_conversions_fuzzer") { - sources = [ "strings/string_number_conversions_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("string_pattern_fuzzer") { - sources = [ "strings/pattern_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("string_tokenizer_fuzzer") { - sources = [ "strings/string_tokenizer_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("substring_set_matcher_fuzzer") { - sources = [ "substring_set_matcher/substring_set_matcher_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("sys_string_conversions_fuzzer") { - sources = [ "strings/sys_string_conversions_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("time_delta_from_string_fuzzer") { - sources = [ "time/time_delta_from_string_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("time_fuzzer") { - sources = [ "time/time_fuzzer.cc" ] - deps = [ - "//base", - "//base/test:test_support", - ] -} - -fuzzer_test("utf_string_conversions_fuzzer") { - sources = [ "strings/utf_string_conversions_fuzzer.cc" ] - deps = [ "//base" ] -} - -fuzzer_test("pickle_fuzzer") { - sources = [ "pickle_fuzzer.cc" ] - deps = [ - "//base", - "//base/test:test_support", - ] -} - -if (enable_base_tracing) { - # This group makes visible those targets in subdirectories that are not - # explicitly depended on. - group("gn_all") { - testonly = true - deps = [ "//base/tracing:perfetto_diff_tests" ] - } -} - process_version("check_version_internal") { template_file = "//base/check_version_internal.h.in" output = "$target_gen_dir/check_version_internal.h" diff --git a/src/base/numerics/BUILD.gn b/src/base/numerics/BUILD.gn index 638f875a0a..51d86e4a70 100644 --- a/src/base/numerics/BUILD.gn +++ b/src/base/numerics/BUILD.gn @@ -31,13 +31,3 @@ source_set("base_numerics") { "wrapping_math.h", ] } - -source_set("unittests") { - testonly = true - visibility = [ "//base/*" ] - sources = [ "byte_conversions_unittest.cc" ] - deps = [ - "//base/numerics:base_numerics", - "//testing/gtest", - ] -} diff --git a/src/components/miracle_parameter/common/BUILD.gn b/src/components/miracle_parameter/common/BUILD.gn index 80dc9c9ee7..7bbf4f00e2 100644 --- a/src/components/miracle_parameter/common/BUILD.gn +++ b/src/components/miracle_parameter/common/BUILD.gn @@ -14,17 +14,3 @@ component("common") { deps = [ "//base" ] } - -source_set("unit_tests") { - testonly = true - - sources = [ "public/miracle_parameter_unittest.cc" ] - - deps = [ - ":common", - "//base", - "//base/test:test_support", - "//testing/gmock", - "//testing/gtest", - ] -} diff --git a/src/components/network_time/time_tracker/BUILD.gn b/src/components/network_time/time_tracker/BUILD.gn index 554cb177d8..cfc00306bc 100644 --- a/src/components/network_time/time_tracker/BUILD.gn +++ b/src/components/network_time/time_tracker/BUILD.gn @@ -10,15 +10,3 @@ static_library("time_tracker") { deps = [ "//base" ] } - -source_set("unit_tests") { - testonly = true - sources = [ "time_tracker_unittest.cc" ] - - deps = [ - ":time_tracker", - "//base", - "//base/test:test_support", - "//testing/gtest", - ] -} diff --git a/src/crypto/BUILD.gn b/src/crypto/BUILD.gn index bf398715a3..f129b30960 100644 --- a/src/crypto/BUILD.gn +++ b/src/crypto/BUILD.gn @@ -6,7 +6,6 @@ import("//build/buildflag_header.gni") import("//build/config/chromeos/ui_mode.gni") import("//components/nacl/toolchain.gni") import("//crypto/features.gni") -import("//testing/test.gni") buildflag_header("buildflags") { header = "crypto_buildflags.h" @@ -143,127 +142,3 @@ component("crypto") { defines = [ "CRYPTO_IMPLEMENTATION" ] } - -if (is_apple) { - source_set("mock_apple_keychain") { - sources = [ - "mock_apple_keychain.cc", - "mock_apple_keychain.h", - ] - - if (is_mac) { - sources += [ "mock_apple_keychain_mac.cc" ] - } else if (is_ios) { - sources += [ "mock_apple_keychain_ios.cc" ] - } - - deps = [ - ":crypto", - "//base", - ] - } -} - -test("crypto_unittests") { - sources = [ - "aead_unittest.cc", - "ec_private_key_unittest.cc", - "ec_signature_creator_unittest.cc", - "encryptor_unittest.cc", - "hmac_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", - ] - - if (is_win || is_mac) { - sources += [ "unexportable_key_metrics_unittest.cc" ] - } - - if (is_apple) { - sources += [ "mock_apple_keychain_unittest.cc" ] - } - - if (is_mac) { - sources += [ - "apple_keychain_util_unittest.mm", - "unexportable_key_mac_unittest.mm", - "user_verifying_key_mac_unittest.mm", - ] - } - - # 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" ] - } - - deps = [ - ":crypto", - ":test_support", - "//base", - "//base/test:run_all_unittests", - "//base/test:test_support", - "//testing/gmock", - "//testing/gtest", - ] - - if (is_apple) { - deps += [ ":mock_apple_keychain" ] - } -} - -static_library("test_support") { - testonly = true - sources = [ - "scoped_fake_user_verifying_key_provider.cc", - "scoped_fake_user_verifying_key_provider.h", - "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", - ] - } - - if (is_mac) { - sources += [ - "fake_apple_keychain_v2.h", - "fake_apple_keychain_v2.mm", - "scoped_fake_apple_keychain_v2.h", - "scoped_fake_apple_keychain_v2.mm", - ] - frameworks = [ - "CoreFoundation.framework", - "Foundation.framework", - "LocalAuthentication.framework", - "Security.framework", - ] - } - - deps = [ - ":crypto", - "//base", - ] -} diff --git a/src/net/BUILD.gn b/src/net/BUILD.gn index e229ec4c97..1afabf0a72 100644 --- a/src/net/BUILD.gn +++ b/src/net/BUILD.gn @@ -10,8 +10,6 @@ import("//build/config/cronet/config.gni") import("//build/config/features.gni") import("//crypto/features.gni") import("//net/features.gni") -import("//testing/libfuzzer/fuzzer_test.gni") -import("//testing/test.gni") import("//third_party/icu/config.gni") import("//third_party/protobuf/proto_library.gni") import("//tools/grit/grit_rule.gni") @@ -20,7 +18,6 @@ import("//url/features.gni") if (is_android) { import("//build/config/android/config.gni") import("//build/config/android/rules.gni") - import("//components/cronet/android/cronet_test_templates.gni") import("//third_party/jni_zero/jni_zero.gni") } else if (is_mac) { import("//build/config/mac/mac_sdk.gni") @@ -1823,14 +1820,6 @@ source_set("net_public_deps") { } } -grit("net_resources") { - source = "base/net_resources.grd" - outputs = [ - "grit/net_resources.h", - "net_resources.pak", - ] -} - proto_library("net_nqe_proto") { visibility = [ ":net_public_deps" ] @@ -1850,48 +1839,6 @@ proto_library("isolation_info_proto") { sources = [ "base/isolation_info.proto" ] } -component("extras") { - sources = [ - "extras/sqlite/cookie_crypto_delegate.h", - "extras/sqlite/sqlite_persistent_cookie_store.cc", - "extras/sqlite/sqlite_persistent_cookie_store.h", - "extras/sqlite/sqlite_persistent_shared_dictionary_store.cc", - "extras/sqlite/sqlite_persistent_shared_dictionary_store.h", - "extras/sqlite/sqlite_persistent_store_backend_base.cc", - "extras/sqlite/sqlite_persistent_store_backend_base.h", - ] - defines = [ "IS_NET_EXTRAS_IMPL" ] - configs += [ "//build/config/compiler:wexit_time_destructors" ] - deps = [ - ":net", - "//base", - "//crypto", - "//sql:sql", - ] - public_deps = [ ":shared_dictionary_info" ] - - if (enable_reporting) { - sources += [ - "extras/sqlite/sqlite_persistent_reporting_and_nel_store.cc", - "extras/sqlite/sqlite_persistent_reporting_and_nel_store.h", - ] - } -} - -component("shared_dictionary_info") { - sources = [ - "extras/shared_dictionary/shared_dictionary_info.cc", - "extras/shared_dictionary/shared_dictionary_info.h", - "extras/shared_dictionary/shared_dictionary_usage_info.h", - ] - defines = [ "IS_NET_SHARED_DICTIONARY_IMPL" ] - configs += [ "//build/config/compiler:wexit_time_destructors" ] - deps = [ - ":net", - "//base", - ] -} - static_library("preload_decoder") { sources = [ "extras/preload_data/decoder.cc", @@ -1899,2141 +1846,3 @@ static_library("preload_decoder") { ] deps = [ "//base" ] } - -if (!is_ios) { - executable("dump_cache") { - testonly = true - sources = [ - "tools/dump_cache/dump_cache.cc", - "tools/dump_cache/dump_files.cc", - "tools/dump_cache/dump_files.h", - ] - - deps = [ - ":net", - ":test_support", - "//base", - "//build/win:default_exe_manifest", - ] - } -} - -if (is_ios) { - bundle_data_from_filelist("test_support_bundle_data") { - visibility = [ ":test_support" ] - testonly = true - filelist_name = "data/test_support_bundle_data.filelist" - } -} - -static_library("gtest_util") { - testonly = true - sources = [ - "test/gtest_util.h", - "test/scoped_disable_exit_on_dfatal.cc", - "test/scoped_disable_exit_on_dfatal.h", - ] - public_deps = [ - "//base", - "//base/test:test_support", - "//net", - "//testing/gmock", - "//testing/gtest", - ] -} - -static_library("test_support") { - testonly = true - sources = [ - "base/connection_endpoint_metadata_test_util.cc", - "base/connection_endpoint_metadata_test_util.h", - "base/load_timing_info_test_util.cc", - "base/load_timing_info_test_util.h", - "base/mock_file_stream.cc", - "base/mock_file_stream.h", - "base/mock_network_change_notifier.cc", - "base/mock_network_change_notifier.h", - "base/test_completion_callback.cc", - "base/test_completion_callback.h", - "base/test_data_stream.cc", - "base/test_data_stream.h", - "cert/internal/cert_issuer_source_sync_unittest.h", - "cert/internal/test_helpers.cc", - "cert/internal/test_helpers.h", - "cert/mock_cert_net_fetcher.cc", - "cert/mock_cert_net_fetcher.h", - "cert/mock_cert_verifier.cc", - "cert/mock_cert_verifier.h", - "cert/mock_client_cert_verifier.cc", - "cert/mock_client_cert_verifier.h", - "cookies/canonical_cookie_test_helpers.h", - "cookies/cookie_change_dispatcher_test_helpers.cc", - "cookies/cookie_change_dispatcher_test_helpers.h", - "cookies/cookie_monster_store_test.cc", - "cookies/cookie_monster_store_test.h", - "cookies/cookie_store_change_unittest.h", - "cookies/cookie_store_test_callbacks.cc", - "cookies/cookie_store_test_callbacks.h", - "cookies/cookie_store_test_helpers.cc", - "cookies/cookie_store_test_helpers.h", - "cookies/cookie_store_unittest.h", - "cookies/test_cookie_access_delegate.cc", - "cookies/test_cookie_access_delegate.h", - "disk_cache/disk_cache_test_base.cc", - "disk_cache/disk_cache_test_base.h", - "disk_cache/disk_cache_test_util.cc", - "disk_cache/disk_cache_test_util.h", - "disk_cache/mock/mock_backend_impl.cc", - "disk_cache/mock/mock_backend_impl.h", - "disk_cache/mock/mock_entry_impl.cc", - "disk_cache/mock/mock_entry_impl.h", - "filter/filter_source_stream_test_util.cc", - "filter/filter_source_stream_test_util.h", - "filter/mock_source_stream.cc", - "filter/mock_source_stream.h", - "http/http_response_headers_test_util.cc", - "http/http_response_headers_test_util.h", - "http/http_stream_factory_test_util.cc", - "http/http_stream_factory_test_util.h", - "http/http_stream_pool_test_util.cc", - "http/http_stream_pool_test_util.h", - "http/http_transaction_test_util.cc", - "http/http_transaction_test_util.h", - "http/mock_http_cache.cc", - "http/mock_http_cache.h", - "http/transport_security_state_test_util.cc", - "http/transport_security_state_test_util.h", - "log/test_net_log.cc", - "log/test_net_log.h", - "log/test_net_log_util.cc", - "log/test_net_log_util.h", - "nqe/network_quality_estimator_test_util.cc", - "nqe/network_quality_estimator_test_util.h", - "proxy_resolution/mock_pac_file_fetcher.cc", - "proxy_resolution/mock_pac_file_fetcher.h", - "proxy_resolution/mock_proxy_resolver.cc", - "proxy_resolution/mock_proxy_resolver.h", - "proxy_resolution/proxy_config_service_common_unittest.cc", - "proxy_resolution/proxy_config_service_common_unittest.h", - "socket/read_buffering_stream_socket.cc", - "socket/read_buffering_stream_socket.h", - "socket/socket_test_util.cc", - "socket/socket_test_util.h", - "socket/transport_client_socket_test_util.cc", - "socket/transport_client_socket_test_util.h", - "spdy/spdy_test_util_common.cc", - "spdy/spdy_test_util_common.h", - "ssl/client_cert_identity_test_util.cc", - "ssl/client_cert_identity_test_util.h", - "ssl/ssl_private_key_test_util.cc", - "ssl/ssl_private_key_test_util.h", - "ssl/test_ssl_config_service.cc", - "ssl/test_ssl_config_service.h", - "ssl/test_ssl_private_key.cc", - "ssl/test_ssl_private_key.h", - "test/cert_builder.cc", - "test/cert_builder.h", - "test/cert_test_util.cc", - "test/cert_test_util.h", - "test/ct_test_util.cc", - "test/ct_test_util.h", - "test/embedded_test_server/connection_tracker.cc", - "test/embedded_test_server/connection_tracker.h", - "test/embedded_test_server/controllable_http_response.cc", - "test/embedded_test_server/controllable_http_response.h", - "test/embedded_test_server/default_handlers.cc", - "test/embedded_test_server/default_handlers.h", - "test/embedded_test_server/embedded_test_server.cc", - "test/embedded_test_server/embedded_test_server.h", - "test/embedded_test_server/embedded_test_server_connection_listener.cc", - "test/embedded_test_server/embedded_test_server_connection_listener.h", - "test/embedded_test_server/http1_connection.cc", - "test/embedded_test_server/http1_connection.h", - "test/embedded_test_server/http2_connection.cc", - "test/embedded_test_server/http2_connection.h", - "test/embedded_test_server/http_connection.cc", - "test/embedded_test_server/http_connection.h", - "test/embedded_test_server/http_request.cc", - "test/embedded_test_server/http_request.h", - "test/embedded_test_server/http_response.cc", - "test/embedded_test_server/http_response.h", - "test/embedded_test_server/request_handler_util.cc", - "test/embedded_test_server/request_handler_util.h", - "test/embedded_test_server/simple_connection_listener.cc", - "test/embedded_test_server/simple_connection_listener.h", - "test/event_waiter.h", - "test/key_util.cc", - "test/key_util.h", - "test/net_test_suite.cc", - "test/net_test_suite.h", - "test/quic_simple_test_server.cc", - "test/quic_simple_test_server.h", - "test/revocation_builder.cc", - "test/revocation_builder.h", - "test/scoped_mutually_exclusive_feature_list.h", - "test/ssl_test_util.cc", - "test/ssl_test_util.h", - "test/test_certificate_data.h", - "test/test_connection_cost_observer.cc", - "test/test_connection_cost_observer.h", - "test/test_data_directory.cc", - "test/test_data_directory.h", - "test/test_doh_server.cc", - "test/test_doh_server.h", - "test/test_with_task_environment.cc", - "test/test_with_task_environment.h", - "test/url_request/ssl_certificate_error_job.cc", - "test/url_request/ssl_certificate_error_job.h", - "test/url_request/url_request_failed_job.cc", - "test/url_request/url_request_failed_job.h", - "test/url_request/url_request_hanging_read_job.cc", - "test/url_request/url_request_hanging_read_job.h", - "test/url_request/url_request_mock_data_job.cc", - "test/url_request/url_request_mock_data_job.h", - "url_request/url_request_filter.cc", - "url_request/url_request_filter.h", - "url_request/url_request_test_job.cc", - "url_request/url_request_test_job.h", - "url_request/url_request_test_util.cc", - "url_request/url_request_test_util.h", - ] - - if (is_win) { - sources += [ - "test/win/fake_network_cost_manager.cc", - "test/win/fake_network_cost_manager.h", - ] - } - - if (is_linux || is_chromeos || is_android) { - sources += [ - "base/address_tracker_linux_test_util.cc", - "base/address_tracker_linux_test_util.h", - ] - } - - configs += [ "//build/config:precompiled_headers" ] - - public_deps = [ - ":cronet_buildflags", - ":gtest_util", - "//base", - "//base/test:test_support", - "//crypto", - "//net", - "//net/dns:test_support", - "//net/tools/tld_cleanup", - "//net/traffic_annotation:test_support", - "//testing/gmock", - "//testing/gtest", - "//url", - ] - - deps = [ - ":quic_test_flags_utils", - ":simple_quic_tools", - "//net/http:transport_security_state_unittest_data_default", - "//third_party/zlib", - ] - - allow_circular_includes_from = [ "//net/dns:test_support" ] - - # Data dependencies shared with suites other than net_unittests. - data = [ - "data/cert_net_fetcher_impl_unittest/", - "data/dns/", - "data/ov_name_constraints/", - "data/parse_certificate_unittest/", - "data/ssl/", - "data/url_request_unittest/", - "data/websocket/", - ] - - if (is_mac) { - frameworks = [ "Security.framework" ] - } - - if (is_ios) { - deps += [ ":test_support_bundle_data" ] - } - - if (use_nss_certs) { - configs += [ "//build/config/linux/nss" ] - } - - if (enable_websockets || (is_cronet_build && !is_ios)) { - sources += [ - "test/spawned_test_server/base_test_server.cc", - "test/spawned_test_server/base_test_server.h", - "test/spawned_test_server/spawned_test_server.h", - ] - } - - public_configs = [ ":net_test_config" ] - - if (use_remote_test_server) { - sources += [ - "test/spawned_test_server/remote_test_server.cc", - "test/spawned_test_server/remote_test_server.h", - "test/spawned_test_server/remote_test_server_spawner_request.cc", - "test/spawned_test_server/remote_test_server_spawner_request.h", - ] - } else if (!is_ios) { - sources += [ - "test/spawned_test_server/local_test_server.cc", - "test/spawned_test_server/local_test_server.h", - ] - if (is_win) { - sources += [ "test/spawned_test_server/local_test_server_win.cc" ] - } else if (is_posix || is_fuchsia) { - sources += [ "test/spawned_test_server/local_test_server_posix.cc" ] - } - } - - if (enable_python_utils) { - sources += [ - "test/python_utils.cc", - "test/python_utils.h", - ] - } - - if (use_nss_certs) { - sources += [ "test/cert_test_util_nss.cc" ] - } - - if (!disable_file_support) { - sources += [ - "test/url_request/url_request_mock_http_job.cc", - "test/url_request/url_request_mock_http_job.h", - "test/url_request/url_request_test_job_backed_by_file.cc", - "test/url_request/url_request_test_job_backed_by_file.h", - ] - } - - if (enable_reporting) { - sources += [ - "network_error_logging/mock_persistent_nel_store.cc", - "network_error_logging/mock_persistent_nel_store.h", - "network_error_logging/network_error_logging_test_util.cc", - "network_error_logging/network_error_logging_test_util.h", - "reporting/mock_persistent_reporting_store.cc", - "reporting/mock_persistent_reporting_store.h", - "reporting/reporting_test_util.cc", - "reporting/reporting_test_util.h", - ] - } -} - -if (!is_ios && !is_android) { - executable("cert_verify_tool") { - testonly = true - sources = [ - "tools/cert_verify_tool/cert_verify_tool.cc", - "tools/cert_verify_tool/cert_verify_tool_util.cc", - "tools/cert_verify_tool/cert_verify_tool_util.h", - "tools/cert_verify_tool/verify_using_cert_verify_proc.cc", - "tools/cert_verify_tool/verify_using_cert_verify_proc.h", - "tools/cert_verify_tool/verify_using_path_builder.cc", - "tools/cert_verify_tool/verify_using_path_builder.h", - ] - - deps = [ - ":net", - ":test_support", - "//base", - "//build/win:default_exe_manifest", - ] - - if (is_mac) { - frameworks = [ "Security.framework" ] - } - } - - executable("crash_cache") { - testonly = true - sources = [ "tools/crash_cache/crash_cache.cc" ] - - deps = [ - ":net", - ":test_support", - "//base", - "//build/win:default_exe_manifest", - ] - } - - executable("hpack_example_generator") { - testonly = true - sources = [ "spdy/fuzzing/hpack_example_generator.cc" ] - - deps = [ - ":net", - ":spdy_test_tools", - "//base", - "//build/win:default_exe_manifest", - ] - } - - executable("net_watcher") { - testonly = true - sources = [ "tools/net_watcher/net_watcher.cc" ] - deps = [ - ":net", - "//base", - "//build:chromeos_buildflags", - "//build/win:default_exe_manifest", - ] - } - - executable("run_testserver") { - testonly = true - sources = [ "tools/testserver/run_testserver.cc" ] - deps = [ - ":test_support", - "//base", - "//base/test:test_support", - "//build/win:default_exe_manifest", - "//testing/gtest", - ] - } - - executable("stress_cache") { - testonly = true - sources = [ "tools/stress_cache/stress_cache.cc" ] - - deps = [ - ":net", - ":test_support", - "//base", - "//build/win:default_exe_manifest", - ] - } - - executable("tld_cleanup") { - sources = [ "tools/tld_cleanup/tld_cleanup.cc" ] - - deps = [ - "//base", - "//base:i18n", - "//build/win:default_exe_manifest", - "//net/tools/tld_cleanup", - ] - } -} - -if (use_external_gssapi) { - # In order for the tests to be reliable, these two targets cannot depend on a - # valid GSSAPI library. This is easy to achieve on most platforms. But on - # macOS care must be taken to not depend directly or indirectly on - # GSS.framework. This is suprisingly easy to get wrong since - # Security.framework is such a common dependency and it indirectly depends on - # GSS. - shared_library("test_gssapi") { - testonly = true - sources = [ - "tools/gssapi/gss_import_name.cc", - "tools/gssapi/gss_methods.cc", - "tools/gssapi/gss_types.h", - ] - } - - shared_library("test_badgssapi") { - testonly = true - sources = [ - "tools/gssapi/gss_methods.cc", - "tools/gssapi/gss_types.h", - ] - } -} - -if (is_linux || is_chromeos || is_mac) { - executable("cachetool") { - testonly = true - sources = [ "tools/cachetool/cachetool.cc" ] - deps = [ - ":net", - ":test_support", - "//base", - ] - } - - executable("content_decoder_tool") { - testonly = true - sources = [ - "tools/content_decoder_tool/content_decoder_tool.cc", - "tools/content_decoder_tool/content_decoder_tool.h", - "tools/content_decoder_tool/content_decoder_tool_bin.cc", - ] - deps = [ - ":net", - ":test_support", - "//base", - "//url", - ] - } -} - -if (is_android) { - generate_jni("net_jni_headers") { - sources = [ - "android/java/src/org/chromium/net/AndroidCertVerifyResult.java", - "android/java/src/org/chromium/net/AndroidKeyStore.java", - "android/java/src/org/chromium/net/AndroidNetworkLibrary.java", - "android/java/src/org/chromium/net/AndroidTrafficStats.java", - "android/java/src/org/chromium/net/DnsStatus.java", - "android/java/src/org/chromium/net/GURLUtils.java", - "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java", - "android/java/src/org/chromium/net/HttpUtil.java", - "android/java/src/org/chromium/net/NetStringUtil.java", - "android/java/src/org/chromium/net/NetworkActiveNotifier.java", - "android/java/src/org/chromium/net/NetworkChangeNotifier.java", - "android/java/src/org/chromium/net/ProxyChangeListener.java", - "android/java/src/org/chromium/net/X509Util.java", - ] - } -} - -if (is_android || is_linux || is_chromeos) { - executable("disk_cache_memory_test") { - testonly = true - sources = [ "tools/disk_cache_memory_test/disk_cache_memory_test.cc" ] - deps = [ - ":net", - "//base", - ] - } -} - -source_set("spdy_test_tools") { - testonly = true - sources = [ - "spdy/fuzzing/hpack_fuzz_util.cc", - "spdy/fuzzing/hpack_fuzz_util.h", - ] - deps = [ - ":net", - "//base", - "//testing/gmock", - "//testing/gtest", - ] -} - -source_set("quic_test_flags_utils") { - testonly = true - sources = [ - "quic/platform/impl/quic_test_flags_utils.cc", - "quic/platform/impl/quic_test_flags_utils.h", - ] - deps = [ ":net" ] -} - -source_set("quic_test_tools") { - testonly = true - sources = [ - "quic/crypto_test_utils_chromium.cc", - "quic/crypto_test_utils_chromium.h", - "quic/mock_crypto_client_stream.cc", - "quic/mock_crypto_client_stream.h", - "quic/mock_crypto_client_stream_factory.cc", - "quic/mock_crypto_client_stream_factory.h", - "quic/mock_decrypter.cc", - "quic/mock_decrypter.h", - "quic/mock_encrypter.cc", - "quic/mock_encrypter.h", - "quic/mock_quic_context.cc", - "quic/mock_quic_context.h", - "quic/test_task_runner.cc", - "quic/test_task_runner.h", - ] - deps = [ - ":net", - ":simple_quic_tools", - ":test_support", - "//base", - "//crypto:test_support", - "//testing/gmock", - "//testing/gtest", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - "//third_party/quic_trace:quic_trace_proto", - ] - public_deps = [ - ":quic_test_flags_utils", - "//net/third_party/quiche:quiche_test_support", - ] -} - -source_set("simple_quic_tools") { - testonly = true - sources = [ - "tools/quic/quic_client_message_loop_network_helper.cc", - "tools/quic/quic_client_message_loop_network_helper.h", - "tools/quic/quic_simple_client.cc", - "tools/quic/quic_simple_client.h", - "tools/quic/quic_simple_server.cc", - "tools/quic/quic_simple_server.h", - "tools/quic/quic_simple_server_packet_writer.cc", - "tools/quic/quic_simple_server_packet_writer.h", - "tools/quic/quic_simple_server_session_helper.cc", - "tools/quic/quic_simple_server_session_helper.h", - "tools/quic/quic_simple_server_socket.cc", - "tools/quic/quic_simple_server_socket.h", - "tools/quic/synchronous_host_resolver.cc", - "tools/quic/synchronous_host_resolver.h", - ] - deps = [ - ":net", - "//base", - "//net/third_party/quiche:quiche_tool_support", - "//third_party/protobuf:protobuf_lite", - "//url", - ] - public_deps = [ "//net/third_party/quiche:quiche_tool_support" ] -} - -if (!is_ios) { - executable("quic_client") { - testonly = true - sources = [ "tools/quic/quic_simple_client_bin.cc" ] - deps = [ - ":net", - ":simple_quic_tools", - "//base", - "//build/win:default_exe_manifest", - "//net/third_party/quiche:quic_client_core", - "//url", - ] - } - executable("quic_server") { - testonly = true - sources = [ - "tools/quic/quic_simple_server_backend_factory.cc", - "tools/quic/quic_simple_server_backend_factory.h", - "tools/quic/quic_simple_server_bin.cc", - ] - deps = [ - ":net", - ":simple_quic_tools", - "//base", - "//build/win:default_exe_manifest", - "//net/third_party/quiche:quic_server_core", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - ] - } - executable("crypto_message_printer") { - testonly = true - sources = [ "tools/quic/crypto_message_printer_bin.cc" ] - deps = [ - ":net", - "//base", - "//build/win:default_exe_manifest", - ] - } -} - -if (is_ios) { - bundle_data_from_filelist("net_test_bundle_data") { - testonly = true - filelist_name = "data/test_bundle_data.filelist" - } -} - -if (!is_cronet_build) { - test("net_fuzztests") { - sources = [ - "cert/x509_certificate_fuzztest.cc", - "http/http_cookie_indices_fuzztest.cc", - ] - - fuzztests = [ - "CookieIndicesFuzzTest.FuzzParseFromHeader", - "X509CertificateFuzzTest.FuzzCreateFromDERCertChain", - ] - - deps = [ - ":net", - "//third_party/fuzztest:fuzztest_gtest_main", - ] - } -} - -if (is_cronet_build) { - _test_target_type = "cronet_test" -} else { - _test_target_type = "test" -} - -target(_test_target_type, "net_unittests") { - sources = [ - "base/address_family_unittest.cc", - "base/address_list_unittest.cc", - "base/backoff_entry_serializer_unittest.cc", - "base/backoff_entry_unittest.cc", - "base/chunked_upload_data_stream_unittest.cc", - "base/data_url_unittest.cc", - "base/datagram_buffer_unittest.cc", - "base/elements_upload_data_stream_unittest.cc", - "base/expiring_cache_unittest.cc", - "base/file_stream_unittest.cc", - "base/filename_util_unittest.cc", - "base/host_mapping_rules_unittest.cc", - "base/host_port_pair_unittest.cc", - "base/interval_test.cc", - "base/io_buffer_unittest.cc", - "base/ip_address_unittest.cc", - "base/ip_endpoint_unittest.cc", - "base/isolation_info_unittest.cc", - "base/lookup_string_in_fixed_set_unittest.cc", - "base/mime_sniffer_unittest.cc", - "base/mime_util_unittest.cc", - "base/net_errors_unittest.cc", - "base/net_string_util_unittest.cc", - "base/network_activity_monitor_unittest.cc", - "base/network_anonymization_key_unittest.cc", - "base/network_change_notifier_unittest.cc", - "base/network_delegate_unittest.cc", - "base/network_interfaces_unittest.cc", - "base/network_isolation_key_unittest.cc", - "base/parse_number_unittest.cc", - "base/port_util_unittest.cc", - "base/prioritized_dispatcher_unittest.cc", - "base/prioritized_task_runner_unittest.cc", - "base/priority_queue_unittest.cc", - "base/proxy_chain_unittest.cc", - "base/proxy_server_unittest.cc", - "base/proxy_string_util_unittest.cc", - "base/registry_controlled_domains/registry_controlled_domain_unittest.cc", - "base/scheme_host_port_matcher_rule_unittest.cc", - "base/scheme_host_port_matcher_unittest.cc", - "base/schemeful_site_unittest.cc", - "base/test_completion_callback_unittest.cc", - "base/test_proxy_delegate.cc", - "base/test_proxy_delegate.h", - "base/upload_bytes_element_reader_unittest.cc", - "base/upload_file_element_reader_unittest.cc", - "base/url_search_params_unittest.cc", - "base/url_util_unittest.cc", - "cert/caching_cert_verifier_unittest.cc", - "cert/cert_database_unittest.cc", - "cert/cert_verifier_unittest.cc", - "cert/cert_verify_proc_builtin_unittest.cc", - "cert/cert_verify_proc_unittest.cc", - "cert/coalescing_cert_verifier_unittest.cc", - "cert/crl_set_unittest.cc", - "cert/ct_log_response_parser_unittest.cc", - "cert/ct_log_verifier_unittest.cc", - "cert/ct_objects_extractor_unittest.cc", - "cert/ct_serialization_unittest.cc", - "cert/ev_root_ca_metadata_unittest.cc", - "cert/internal/cert_issuer_source_aia_unittest.cc", - "cert/internal/cert_issuer_source_sync_unittest.cc", - "cert/internal/revocation_checker_unittest.cc", - "cert/internal/system_trust_store_unittest.cc", - "cert/known_roots_unittest.cc", - "cert/merkle_audit_proof_unittest.cc", - "cert/merkle_tree_leaf_unittest.cc", - "cert/multi_log_ct_verifier_unittest.cc", - "cert/multi_threaded_cert_verifier_unittest.cc", - "cert/signed_certificate_timestamp_unittest.cc", - "cert/symantec_certs_unittest.cc", - "cert/test_root_certs_unittest.cc", - "cert/time_conversions_unittest.cc", - "cert/x509_cert_types_unittest.cc", - "cert/x509_certificate_unittest.cc", - "cert/x509_util_unittest.cc", - "cert_net/cert_net_fetcher_url_request_unittest.cc", - "cookies/canonical_cookie_unittest.cc", - "cookies/cookie_base_unittest.cc", - "cookies/cookie_constants_unittest.cc", - "cookies/cookie_deletion_info_unittest.cc", - "cookies/cookie_inclusion_status_unittest.cc", - "cookies/cookie_monster_unittest.cc", - "cookies/cookie_options_unittest.cc", - "cookies/cookie_partition_key_collection_unittest.cc", - "cookies/cookie_partition_key_unittest.cc", - "cookies/cookie_util_unittest.cc", - "cookies/parsed_cookie_unittest.cc", - "cookies/site_for_cookies_unittest.cc", - "cookies/static_cookie_policy_unittest.cc", - "disk_cache/backend_cleanup_tracker_unittest.cc", - "disk_cache/backend_unittest.cc", - "disk_cache/blockfile/addr_unittest.cc", - "disk_cache/blockfile/bitmap_unittest.cc", - "disk_cache/blockfile/block_files_unittest.cc", - "disk_cache/blockfile/mapped_file_unittest.cc", - "disk_cache/blockfile/stats_unittest.cc", - "disk_cache/blockfile/storage_block_unittest.cc", - "disk_cache/cache_util_unittest.cc", - "disk_cache/entry_unittest.cc", - "disk_cache/simple/simple_file_enumerator_unittest.cc", - "disk_cache/simple/simple_file_tracker_unittest.cc", - "disk_cache/simple/simple_index_file_unittest.cc", - "disk_cache/simple/simple_index_unittest.cc", - "disk_cache/simple/simple_test_util.cc", - "disk_cache/simple/simple_test_util.h", - "disk_cache/simple/simple_util_unittest.cc", - "disk_cache/simple/simple_version_upgrade_unittest.cc", - "filter/filter_source_stream_unittest.cc", - "filter/gzip_source_stream_unittest.cc", - "first_party_sets/addition_overlaps_union_find_unittest.cc", - "first_party_sets/first_party_set_entry_override_unittest.cc", - "first_party_sets/first_party_sets_cache_filter_unittest.cc", - "first_party_sets/first_party_sets_context_config_unittest.cc", - "first_party_sets/first_party_sets_validator_unittest.cc", - "first_party_sets/global_first_party_sets_unittest.cc", - "first_party_sets/local_set_declaration_unittest.cc", - "first_party_sets/sets_mutation_unittest.cc", - "http/alternative_service_unittest.cc", - "http/bidirectional_stream_unittest.cc", - "http/broken_alternative_services_unittest.cc", - "http/http_auth_cache_unittest.cc", - "http/http_auth_challenge_tokenizer_unittest.cc", - "http/http_auth_controller_unittest.cc", - "http/http_auth_filter_unittest.cc", - "http/http_auth_handler_basic_unittest.cc", - "http/http_auth_handler_digest_unittest.cc", - "http/http_auth_handler_factory_unittest.cc", - "http/http_auth_handler_mock.cc", - "http/http_auth_handler_mock.h", - "http/http_auth_handler_unittest.cc", - "http/http_auth_multi_round_parse_unittest.cc", - "http/http_auth_preferences_unittest.cc", - "http/http_auth_unittest.cc", - "http/http_basic_state_unittest.cc", - "http/http_byte_range_unittest.cc", - "http/http_cache_unittest.cc", - "http/http_cache_writers_unittest.cc", - "http/http_chunked_decoder_unittest.cc", - "http/http_content_disposition_unittest.cc", - "http/http_cookie_indices_unittest.cc", - "http/http_log_util_unittest.cc", - "http/http_network_layer_unittest.cc", - "http/http_network_transaction_unittest.cc", - "http/http_no_vary_search_data_unittest.cc", - "http/http_proxy_client_socket_unittest.cc", - "http/http_proxy_connect_job_unittest.cc", - "http/http_request_headers_unittest.cc", - "http/http_request_info_unittest.cc", - "http/http_response_body_drainer_unittest.cc", - "http/http_response_headers_unittest.cc", - "http/http_response_info_unittest.cc", - "http/http_security_headers_unittest.cc", - "http/http_server_properties_manager_unittest.cc", - "http/http_server_properties_unittest.cc", - "http/http_status_code_unittest.cc", - "http/http_stream_factory_job_controller_unittest.cc", - "http/http_stream_factory_unittest.cc", - "http/http_stream_key_unittest.cc", - "http/http_stream_parser_unittest.cc", - "http/http_stream_pool_attempt_manager_unittest.cc", - "http/http_stream_pool_group_unittest.cc", - "http/http_stream_request_unittest.cc", - "http/http_transaction_test_util_unittest.cc", - "http/http_util_unittest.cc", - "http/http_vary_data_unittest.cc", - "http/mock_allow_http_auth_preferences.cc", - "http/mock_allow_http_auth_preferences.h", - "http/test_upload_data_stream_not_allow_http1.cc", - "http/test_upload_data_stream_not_allow_http1.h", - "http/transport_security_persister_unittest.cc", - "http/transport_security_state_unittest.cc", - "http/url_security_manager_unittest.cc", - "log/file_net_log_observer_unittest.cc", - "log/net_log_capture_mode_unittest.cc", - "log/net_log_unittest.cc", - "log/net_log_util_unittest.cc", - "log/net_log_values_unittest.cc", - "nqe/effective_connection_type_unittest.cc", - "nqe/event_creator_unittest.cc", - "nqe/network_id_unittest.cc", - "nqe/network_qualities_prefs_manager_unittest.cc", - "nqe/network_quality_estimator_params_unittest.cc", - "nqe/network_quality_estimator_unittest.cc", - "nqe/network_quality_estimator_util_unittest.cc", - "nqe/network_quality_store_unittest.cc", - "nqe/observation_buffer_unittest.cc", - "nqe/socket_watcher_unittest.cc", - "nqe/throughput_analyzer_unittest.cc", - "proxy_resolution/configured_proxy_resolution_service_unittest.cc", - "proxy_resolution/multi_threaded_proxy_resolver_unittest.cc", - "proxy_resolution/network_delegate_error_observer_unittest.cc", - "proxy_resolution/pac_file_decider_unittest.cc", - "proxy_resolution/pac_file_fetcher_impl_unittest.cc", - "proxy_resolution/proxy_bypass_rules_unittest.cc", - "proxy_resolution/proxy_config_unittest.cc", - "proxy_resolution/proxy_info_unittest.cc", - "proxy_resolution/proxy_list_unittest.cc", - "quic/bidirectional_stream_quic_impl_unittest.cc", - "quic/crypto/proof_test_chromium.cc", - "quic/crypto/proof_verifier_chromium_test.cc", - "quic/dedicated_web_transport_http3_client_test.cc", - "quic/mock_quic_data.cc", - "quic/mock_quic_data.h", - "quic/network_connection_unittest.cc", - "quic/platform/impl/quic_chromium_clock_test.cc", - "quic/properties_based_quic_server_info_test.cc", - "quic/quic_address_mismatch_test.cc", - "quic/quic_chromium_alarm_factory_test.cc", - "quic/quic_chromium_client_session_peer.cc", - "quic/quic_chromium_client_session_peer.h", - "quic/quic_chromium_client_session_test.cc", - "quic/quic_chromium_client_stream_test.cc", - "quic/quic_chromium_connection_helper_test.cc", - "quic/quic_clock_skew_detector_test.cc", - "quic/quic_end_to_end_unittest.cc", - "quic/quic_http_stream_test.cc", - "quic/quic_http_utils_test.cc", - "quic/quic_network_transaction_unittest.cc", - "quic/quic_proxy_client_socket_test_base.cc", - "quic/quic_proxy_client_socket_test_base.h", - "quic/quic_proxy_client_socket_unittest.cc", - "quic/quic_proxy_datagram_client_socket_unittest.cc", - "quic/quic_session_key_unittest.cc", - "quic/quic_session_pool_peer.cc", - "quic/quic_session_pool_peer.h", - "quic/quic_session_pool_proxy_job_unittest.cc", - "quic/quic_session_pool_test.cc", - "quic/quic_session_pool_test_base.cc", - "quic/quic_session_pool_test_base.h", - "quic/quic_socket_data_provider.cc", - "quic/quic_socket_data_provider.h", - "quic/quic_socket_data_provider_unittest.cc", - "quic/quic_test_packet_maker.cc", - "quic/quic_test_packet_maker.h", - "quic/quic_test_packet_printer.cc", - "quic/quic_test_packet_printer.h", - "quic/set_quic_flag_test.cc", - "quic/test_quic_crypto_client_config_handle.cc", - "quic/test_quic_crypto_client_config_handle.h", - "shared_dictionary/shared_dictionary_header_checker_source_stream_unittest.cc", - "shared_dictionary/shared_dictionary_isolation_key_unittest.cc", - "shared_dictionary/shared_dictionary_network_transaction_factory_unittest.cc", - "shared_dictionary/shared_dictionary_network_transaction_unittest.cc", - "socket/client_socket_pool_base_unittest.cc", - "socket/client_socket_pool_unittest.cc", - "socket/connect_job_factory_unittest.cc", - "socket/connect_job_params_factory_unittest.cc", - "socket/connect_job_test_util.cc", - "socket/connect_job_test_util.h", - "socket/connect_job_unittest.cc", - "socket/mock_client_socket_pool_manager.cc", - "socket/mock_client_socket_pool_manager.h", - "socket/sequenced_socket_data_unittest.cc", - "socket/socket_bio_adapter_unittest.cc", - "socket/socket_tag_unittest.cc", - "socket/socks5_client_socket_unittest.cc", - "socket/socks_client_socket_unittest.cc", - "socket/socks_connect_job_unittest.cc", - "socket/ssl_client_socket_unittest.cc", - "socket/ssl_connect_job_unittest.cc", - "socket/ssl_server_socket_unittest.cc", - "socket/tcp_client_socket_unittest.cc", - "socket/tcp_server_socket_unittest.cc", - "socket/tcp_socket_unittest.cc", - "socket/tcp_stream_attempt_unittest.cc", - "socket/tls_stream_attempt_unittest.cc", - "socket/transport_client_socket_pool_test_util.cc", - "socket/transport_client_socket_pool_test_util.h", - "socket/transport_client_socket_pool_unittest.cc", - "socket/transport_client_socket_unittest.cc", - "socket/transport_connect_job_unittest.cc", - "socket/udp_socket_unittest.cc", - "socket/websocket_endpoint_lock_manager_unittest.cc", - "socket/websocket_transport_client_socket_pool_unittest.cc", - "spdy/alps_decoder_test.cc", - "spdy/bidirectional_stream_spdy_impl_unittest.cc", - "spdy/buffered_spdy_framer_unittest.cc", - "spdy/fuzzing/hpack_fuzz_util_test.cc", - "spdy/header_coalescer_test.cc", - "spdy/http2_priority_dependencies_unittest.cc", - "spdy/spdy_buffer_unittest.cc", - "spdy/spdy_http_stream_unittest.cc", - "spdy/spdy_http_utils_unittest.cc", - "spdy/spdy_log_util_unittest.cc", - "spdy/spdy_network_transaction_unittest.cc", - "spdy/spdy_proxy_client_socket_unittest.cc", - "spdy/spdy_read_queue_unittest.cc", - "spdy/spdy_session_key_unittest.cc", - "spdy/spdy_session_pool_unittest.cc", - "spdy/spdy_session_test_util.cc", - "spdy/spdy_session_test_util.h", - "spdy/spdy_session_unittest.cc", - "spdy/spdy_stream_test_util.cc", - "spdy/spdy_stream_test_util.h", - "spdy/spdy_stream_unittest.cc", - "spdy/spdy_write_queue_unittest.cc", - "ssl/client_cert_identity_unittest.cc", - "ssl/client_cert_store_unittest-inl.h", - "ssl/openssl_private_key_unittest.cc", - "ssl/ssl_cipher_suite_names_unittest.cc", - "ssl/ssl_client_auth_cache_unittest.cc", - "ssl/ssl_client_session_cache_unittest.cc", - "ssl/ssl_config_service_unittest.cc", - "ssl/ssl_config_unittest.cc", - "ssl/ssl_connection_status_flags_unittest.cc", - "ssl/ssl_platform_key_util_unittest.cc", - "test/embedded_test_server/embedded_test_server_unittest.cc", - "test/embedded_test_server/http_request_unittest.cc", - "test/embedded_test_server/http_response_unittest.cc", - "test/run_all_unittests.cc", - "tools/content_decoder_tool/content_decoder_tool.cc", - "tools/content_decoder_tool/content_decoder_tool.h", - "tools/content_decoder_tool/content_decoder_tool_unittest.cc", - "tools/quic/quic_simple_client_test.cc", - "tools/tld_cleanup/tld_cleanup_util_unittest.cc", - "url_request/redirect_info_unittest.cc", - "url_request/redirect_util_unittest.cc", - "url_request/url_request_context_builder_unittest.cc", - "url_request/url_request_filter_unittest.cc", - "url_request/url_request_http_job_unittest.cc", - "url_request/url_request_job_factory_unittest.cc", - "url_request/url_request_job_unittest.cc", - "url_request/url_request_quic_unittest.cc", - "url_request/url_request_unittest.cc", - "url_request/view_cache_helper_unittest.cc", - ] - - if (is_android) { - sources += [ - "android/dummy_spnego_authenticator.cc", - "android/dummy_spnego_authenticator.h", - "android/http_auth_negotiate_android_unittest.cc", - "android/network_change_notifier_android_unittest.cc", - "android/network_library_unittest.cc", - "android/traffic_stats_unittest.cc", - "cert/cert_verify_proc_android_unittest.cc", - "proxy_resolution/proxy_config_service_android_unittest.cc", - "ssl/ssl_platform_key_android_unittest.cc", - ] - } - - if (is_chromeos_ash && use_nss_certs) { - sources += [ - "cert/nss_cert_database_chromeos_unittest.cc", - "cert/nss_profile_filter_chromeos_unittest.cc", - ] - } - - if (is_linux) { - sources += [ - "base/network_change_notifier_linux_unittest.cc", - "proxy_resolution/proxy_config_service_linux_unittest.cc", - ] - } - - if (is_linux || is_chromeos) { - sources += [ - "base/address_tracker_linux_unittest.cc", - "base/network_interfaces_linux_unittest.cc", - ] - } - - if (is_mac) { - sources += [ - "cert/internal/trust_store_mac_unittest.cc", - "ssl/client_cert_store_mac_unittest.cc", - "ssl/ssl_platform_key_mac_unittest.cc", - ] - } - - if (is_apple) { - sources += [ - "cert/x509_util_apple_unittest.cc", - "proxy_resolution/proxy_chain_util_apple_unittest.cc", - ] - } - - if (is_win) { - sources += [ - "base/network_change_notifier_win_unittest.cc", - "base/network_cost_change_notifier_win_unittest.cc", - "base/network_interfaces_win_unittest.cc", - "http/http_auth_sspi_win_unittest.cc", - "http/mock_sspi_library_win.cc", - "http/mock_sspi_library_win.h", - "proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win_unittest.cc", - "proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc", - "proxy_resolution/win/proxy_config_service_win_unittest.cc", - "proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc", - "ssl/client_cert_store_win_unittest.cc", - "ssl/ssl_platform_key_win_unittest.cc", - ] - } - - configs += [ "//build/config:precompiled_headers" ] - defines = [] - if (disable_zstd_filter) { - defines += [ "NET_DISABLE_ZSTD" ] - } - - deps = [ - ":cronet_buildflags", - ":net", - ":preload_decoder", - ":quic_test_tools", - ":simple_quic_tools", - ":spdy_test_tools", - ":test_support", - "//base", - "//base:i18n", - "//build:chromeos_buildflags", - "//components/network_time/time_tracker", - "//crypto", - "//crypto:test_support", - "//net/base/registry_controlled_domains", - "//net/base/registry_controlled_domains:lookup_strings_test_sets", - "//net/dns:tests", - "//net/dns/public:tests", - "//net/http:transport_security_state_unittest_data", - "//net/http:transport_security_state_unittest_data_default", - "//net/third_party/quiche:quiche_tests", - "//net/third_party/uri_template:uri_template_tests", - "//net/tools/huffman_trie:huffman_trie_generator_sources", - "//testing/gmock", - "//testing/gtest", - "//third_party/abseil-cpp:absl", - "//third_party/anonymous_tokens:anonymous_tokens_tests", - "//third_party/protobuf:protobuf_lite", - "//third_party/zlib", - "//url", - "//url:buildflags", - ] - - if (!is_cronet_build) { - sources += [ - "extras/sqlite/sqlite_persistent_cookie_store_unittest.cc", - "extras/sqlite/sqlite_persistent_shared_dictionary_store_unittest.cc", - "log/trace_net_log_observer_unittest.cc", - ] - - deps += [ - ":extras", - "//components/sqlite_proto", - "//sql", - "//sql:test_support", - ] - } - - if (enable_websockets) { - sources += [ - "server/http_connection_unittest.cc", - "server/http_server_response_info_unittest.cc", - "server/http_server_unittest.cc", - "server/web_socket_encoder_unittest.cc", - ] - } - - if (is_posix) { - sources += [ "base/sockaddr_util_posix_unittest.cc" ] - } - - if (is_android || is_chromeos_ash) { - sources += [ "base/network_change_notifier_passive_unittest.cc" ] - } - - if (enable_reporting) { - sources += [ - "network_error_logging/mock_persistent_nel_store_unittest.cc", - "network_error_logging/network_error_logging_service_unittest.cc", - "reporting/mock_persistent_reporting_store_unittest.cc", - "reporting/reporting_browsing_data_remover_unittest.cc", - "reporting/reporting_cache_unittest.cc", - "reporting/reporting_context_unittest.cc", - "reporting/reporting_delivery_agent_unittest.cc", - "reporting/reporting_endpoint_manager_unittest.cc", - "reporting/reporting_garbage_collector_unittest.cc", - "reporting/reporting_header_parser_unittest.cc", - "reporting/reporting_network_change_observer_unittest.cc", - "reporting/reporting_service_unittest.cc", - "reporting/reporting_uploader_unittest.cc", - ] - if (!is_cronet_build) { - sources += [ - "extras/sqlite/sqlite_persistent_reporting_and_nel_store_unittest.cc", - ] - } - } - - data = [ - "data/cache_tests/", - "data/cert_issuer_source_aia_unittest/", - "data/cert_issuer_source_static_unittest/", - "data/embedded_test_server/", - "data/file_stream_unittest/", - "data/filter_unittests/", - "data/gencerts/", - "data/pac_file_fetcher_unittest/", - "data/quic_http_response_cache_data/", - "data/quic_http_response_cache_data_with_push/", - "data/spdy_tests/", - "data/test.html", - "data/verify_certificate_chain_unittest/", - ] - data_deps = [ "//testing/buildbot/filters:net_unittests_filters" ] - - if (is_linux || is_chromeos || is_mac || is_win || is_fuchsia) { - deps += [ "//third_party/pywebsocket3/" ] - data_deps += [ "//third_party/pywebsocket3/" ] - data += [ - "tools/testserver/", - "//third_party/pywebsocket3/src/mod_pywebsocket/", - ] - } - - if (is_linux || is_chromeos) { - sources += [ "tools/quic/quic_simple_server_test.cc" ] - } - - if (is_apple) { - sources += [ - "base/apple/http_response_headers_util_unittest.mm", - "base/apple/url_conversions_unittest.mm", - ] - } - - if (is_mac) { - sources += [ "base/network_change_notifier_apple_unittest.cc" ] - frameworks = [ - "Security.framework", - "SystemConfiguration.framework", - ] - } - - if (!is_win) { - sources += [ - "http/http_auth_handler_ntlm_portable_unittest.cc", - "ntlm/ntlm_buffer_reader_unittest.cc", - "ntlm/ntlm_buffer_writer_unittest.cc", - "ntlm/ntlm_client_unittest.cc", - "ntlm/ntlm_test_data.h", - "ntlm/ntlm_unittest.cc", - ] - } - - if (enable_python_utils) { - sources += [ "test/python_utils_unittest.cc" ] - } - - if (is_fuchsia) { - use_test_server = true - deps += [ - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_hlcpp", - "//third_party/fuchsia-sdk/sdk/pkg/fidl_cpp", - ] - sources += [ - "base/fuchsia/network_interface_cache_unittest.cc", - "base/network_change_notifier_fuchsia_unittest.cc", - ] - additional_manifest_fragments = - [ "//build/config/fuchsia/test/network.shard.test-cml" ] - } - - if (use_nss_certs) { - sources += [ - "cert/internal/system_trust_store_nss_unittest.cc", - "cert/internal/trust_store_nss_unittest.cc", - "cert/nss_cert_database_unittest.cc", - "cert/x509_util_nss_unittest.cc", - ] - if (!is_castos) { - sources += [ - "ssl/client_cert_store_nss_unittest.cc", - "ssl/ssl_platform_key_nss_unittest.cc", - ] - } - configs += [ "//build/config/linux/nss" ] - } - - if (use_external_gssapi) { - sources += [ - "http/http_auth_gssapi_posix_unittest.cc", - "http/mock_gssapi_library_posix.cc", - "http/mock_gssapi_library_posix.h", - ] - data_deps += [ - ":test_badgssapi", - ":test_gssapi", - ] - } - - if (use_kerberos) { - sources += [ "http/http_auth_handler_negotiate_unittest.cc" ] - } - - if (enable_websockets) { - sources += [ - "websockets/websocket_basic_handshake_stream_test.cc", - "websockets/websocket_basic_stream_adapters_test.cc", - "websockets/websocket_basic_stream_test.cc", - "websockets/websocket_channel_test.cc", - "websockets/websocket_deflate_parameters_test.cc", - "websockets/websocket_deflate_predictor_impl_test.cc", - "websockets/websocket_deflate_stream_test.cc", - "websockets/websocket_deflater_test.cc", - "websockets/websocket_errors_test.cc", - "websockets/websocket_extension_parser_test.cc", - "websockets/websocket_extension_test.cc", - "websockets/websocket_frame_parser_test.cc", - "websockets/websocket_frame_test.cc", - "websockets/websocket_handshake_challenge_test.cc", - "websockets/websocket_handshake_stream_create_helper_test.cc", - "websockets/websocket_inflater_test.cc", - "websockets/websocket_stream_cookie_test.cc", - "websockets/websocket_stream_create_test_base.cc", - "websockets/websocket_stream_create_test_base.h", - "websockets/websocket_stream_test.cc", - "websockets/websocket_test_util.cc", - "websockets/websocket_test_util.h", - ] - - if (!is_ios) { - # TODO(crbug.com/40812029): iOS does not have support for the spawned test - # server, which is used by this test. The long term plan is to add - # websocket support to the embedded test server and when that happens, - # this test could be enabled. - sources += [ "websockets/websocket_end_to_end_test.cc" ] - } - } - - if (!disable_file_support) { - sources += [ - "base/directory_lister_unittest.cc", - "base/directory_listing_unittest.cc", - "test/url_request/url_request_test_job_backed_by_file_unittest.cc", - ] - } - - if (enable_built_in_dns) { - sources += [ "url_request/http_with_dns_over_https_unittest.cc" ] - } - - if (is_ios) { - bundle_deps = [ ":net_test_bundle_data" ] - } - - if (enable_unix_sockets) { - sources += [ - "socket/unix_domain_client_socket_posix_unittest.cc", - "socket/unix_domain_server_socket_posix_unittest.cc", - ] - } - - # Use getifaddrs() on POSIX platforms, except Linux. - if (is_posix && !is_linux && !is_chromeos) { - sources += [ "base/network_interfaces_getifaddrs_unittest.cc" ] - } - - # Unit tests that aren't supported by the current ICU alternatives on Android. - if (is_android && use_platform_icu_alternatives) { - sources -= [ - "base/filename_util_unittest.cc", - "base/url_util_unittest.cc", - "cert/x509_certificate_unittest.cc", - "url_request/url_request_job_unittest.cc", - ] - deps += [ "//url:url_java" ] - } - - # Unit tests that are not supported by the current ICU alternatives on iOS. - if (is_ios && use_platform_icu_alternatives) { - sources -= [ - "base/filename_util_unittest.cc", - "base/url_util_unittest.cc", - "cert/x509_certificate_unittest.cc", - "http/http_auth_handler_basic_unittest.cc", - "http/http_auth_handler_digest_unittest.cc", - "http/http_auth_handler_factory_unittest.cc", - "http/http_auth_unittest.cc", - "http/http_content_disposition_unittest.cc", - "http/http_network_transaction_unittest.cc", - "spdy/spdy_network_transaction_unittest.cc", - "spdy/spdy_proxy_client_socket_unittest.cc", - "url_request/url_request_job_unittest.cc", - "url_request/url_request_unittest.cc", - ] - } - - if (!disable_brotli_filter) { - sources += [ "filter/brotli_source_stream_unittest.cc" ] - } - - if (!disable_zstd_filter) { - sources += [ "filter/zstd_source_stream_unittest.cc" ] - } - - if (is_android) { - data_deps += [ "//net/tools/testserver:testserver_py" ] - deps += [ - ":net_jni_headers", - "//base:base_unittest_support_java", - "//net/android:dummy_spnego_authenticator_java", - "//net/android:dummy_spnego_authenticator_jni", - "//net/android:net_java", - "//net/android:net_java_test_support", - "//net/android:net_test_support_jni", - "//net/android:net_tests_java", - "//net/android:net_tests_jni", - "//net/android:net_unittests_apk_resources", - - # TODO(mmenke): This depends on test_support_base, which depends on - # icu. Figure out a way to remove that dependency. - "//testing/android/native_test:native_test_native_code", - ] - android_manifest = "//net/android/unittest_support/AndroidManifest.xml" - - sources += [ - "base/address_tracker_linux_unittest.cc", - "base/network_interfaces_linux_unittest.cc", - ] - shard_timeout = 300 - - if (enable_chrome_android_internal) { - data_deps += [ "//clank/build/bot/filters:net_unittests_filters" ] - } - } - - if (is_win) { - libs = [ - "iphlpapi.lib", - "ncrypt.lib", - ] - } - - if (chrome_root_store_supported) { - sources += [ "cert/internal/trust_store_chrome_unittest.cc" ] - deps += [ - "//base/version_info", - "//net/data/ssl/chrome_root_store:gen_root_store_test_inc", - ] - - if (is_win) { - sources += [ "cert/internal/trust_store_win_unittest.cc" ] - sources += [ "cert/internal/path_builder_trust_store_win_unittest.cc" ] - libs += [ "crypt32.lib" ] - } - } - - # Include transport_security_state_generator tests. - if (host_toolchain == current_toolchain) { - deps += [ - "//net/tools/huffman_trie:huffman_trie_generator_test_sources", - "//net/tools/transport_security_state_generator:transport_security_state_generator_test_sources", - ] - } - - if (enable_device_bound_sessions) { - sources += [ - "device_bound_sessions/cookie_craving_unittest.cc", - "device_bound_sessions/jwk_utils_unittest.cc", - "device_bound_sessions/registration_fetcher_param_unittest.cc", - "device_bound_sessions/registration_fetcher_unittest.cc", - "device_bound_sessions/session_binding_utils_unittest.cc", - "device_bound_sessions/session_challenge_param_unittest.cc", - "device_bound_sessions/session_inclusion_rules_unittest.cc", - "device_bound_sessions/session_service_impl_unittest.cc", - "device_bound_sessions/session_service_unittest.cc", - "device_bound_sessions/session_unittest.cc", - "device_bound_sessions/test_util.cc", - "device_bound_sessions/test_util.h", - "device_bound_sessions/unexportable_key_service_factory_unittest.cc", - ] - deps += [ - ":device_bound_sessions_storage_proto", - "//components/unexportable_keys:unexportable_keys", - ] - } -} - -# !is_android && !is_win && !is_mac -if (!is_ios) { - # TODO(crbug.com/40460932): this should be converted to "app" template and - # enabled on iOS too. - test("net_perftests") { - sources = [ - "base/mime_sniffer_perftest.cc", - "cookies/cookie_monster_perftest.cc", - "disk_cache/disk_cache_perftest.cc", - "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc", - "socket/udp_socket_perftest.cc", - "spdy/spdy_http_utils_perftest.cc", - "url_request/url_request_quic_perftest.cc", - ] - - deps = [ - ":extras", - ":net", - ":quic_test_tools", - ":simple_quic_tools", - ":test_support", - "//base", - "//base:i18n", - "//base/test:test_support_perf", - "//testing/gtest", - "//testing/perf", - "//third_party/google_benchmark:google_benchmark", - "//url", - ] - data_deps = [ - # Needed for isolate script to execute. - "//testing:run_perf_test", - ] - if (enable_websockets) { - sources += [ "websockets/websocket_frame_perftest.cc" ] - } - if (is_win) { - deps += [ "//build/win:default_exe_manifest" ] - } - } -} - -# Fuzzers - -# This has a global (InitGlobals) that must always be linked in, so -# must be a source set instead of a static library. -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("net_fuzzer_test_support") { - testonly = true - - sources = [ - "base/fuzzer_test_support.cc", - "filter/fuzzed_source_stream.cc", - "filter/fuzzed_source_stream.h", - "socket/fuzzed_datagram_client_socket.cc", - "socket/fuzzed_datagram_client_socket.h", - "socket/fuzzed_server_socket.cc", - "socket/fuzzed_server_socket.h", - "socket/fuzzed_socket.cc", - "socket/fuzzed_socket.h", - "socket/fuzzed_socket_factory.cc", - "socket/fuzzed_socket_factory.h", - ] - public_deps = [ - "//base/test:test_support", - "//net/dns:fuzzer_test_support", - ] - deps = [ - "//base", - "//base:i18n", - "//net", - ] - data = [ - "data/fuzzer_data", - "data/fuzzer_dictionaries", - ] - allow_circular_includes_from = [ "//net/dns:fuzzer_test_support" ] - } -} - -if (enable_websockets && use_fuzzing_engine) { - fuzzer_test("net_http_server_fuzzer") { - sources = [ "//net/server/http_server_fuzzer.cc" ] - deps = [ - "//base", - "//net", - "//net:net_fuzzer_test_support", - "//net:test_support", - ] - dict = "//net/data/fuzzer_dictionaries/net_http_server_fuzzer.dict" - seed_corpus = "//net/data/fuzzer_data/http_server_requests/" - } -} - -fuzzer_test("host_port_pair_fuzzer") { - sources = [ "base/host_port_pair_fuzzer.cc" ] - deps = [ "//net" ] -} - -proto_library("disk_cache_lpm_fuzzer_proto") { - sources = [ "disk_cache/disk_cache_fuzzer.proto" ] -} - -fuzzer_test("disk_cache_lpm_fuzzer") { - sources = [ "disk_cache/disk_cache_fuzzer.cc" ] - deps = [ - ":disk_cache_lpm_fuzzer_proto", - ":test_support", - "//base", - "//net", - "//third_party/libprotobuf-mutator", - ] -} - -proto_library("backoff_entry_serializer_fuzzer_input") { - proto_in_dir = "//" - sources = [ "base/backoff_entry_serializer_fuzzer_input.proto" ] - link_deps = [ "//testing/libfuzzer/proto:json_proto" ] -} - -fuzzer_test("net_backoff_entry_serializer_fuzzer") { - sources = [ "base/backoff_entry_serializer_fuzzer.cc" ] - deps = [ - ":backoff_entry_serializer_fuzzer_input", - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - "//testing/libfuzzer/proto:json_proto", - "//testing/libfuzzer/proto:json_proto_converter", - "//third_party/libprotobuf-mutator", - ] -} - -fuzzer_test("net_data_url_fuzzer") { - sources = [ "base/data_url_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_data_url_fuzzer.dict" - - # IsTokenChar() and ToLowerASCII() are surprisingly slow in instrumented builds. - libfuzzer_options = [ "max_len=100000" ] -} - -fuzzer_test("net_mime_sniffer_fuzzer") { - sources = [ "base/mime_sniffer_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_mime_sniffer_fuzzer.dict" -} - -fuzzer_test("net_parse_proxy_list_pac_fuzzer") { - sources = [ "proxy_resolution/parse_proxy_list_pac_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] -} - -fuzzer_test("net_parse_proxy_list_fuzzer") { - sources = [ "proxy_resolution/parse_proxy_list_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] -} - -fuzzer_test("net_parse_proxy_bypass_rules_fuzzer") { - sources = [ "proxy_resolution/parse_proxy_bypass_rules_fuzzer.cc" ] - - libfuzzer_options = [ - # The proxy bypass rules aren't very complicated, so this is more than - # enough to explore the grammar. Allowing the length to become too large - # can result in test timeouts (https://crbug.com/813619). - "max_len=512", - ] - - deps = [ - ":net_fuzzer_test_support", - "//net", - ] -} - -fuzzer_test("net_parse_proxy_rules_fuzzer") { - sources = [ "proxy_resolution/parse_proxy_rules_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_parse_proxy_bypass_rules_fuzzer.dict" -} - -fuzzer_test("net_get_domain_and_registry_fuzzer") { - sources = - [ "base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_get_domain_and_registry_fuzzer.dict" -} - -fuzzer_test("net_lookup_string_in_fixed_set_fuzzer") { - sources = [ "base/lookup_string_in_fixed_set_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - "//net/base/registry_controlled_domains:lookup_strings_test_sets", - ] - dict = "data/fuzzer_dictionaries/net_get_domain_and_registry_fuzzer.dict" -} - -fuzzer_test("net_base_schemeful_site_fuzzer") { - sources = [ "base/schemeful_site_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - "//testing/libfuzzer/proto:url_proto", - "//testing/libfuzzer/proto:url_proto_converter", - "//third_party/libprotobuf-mutator", - ] -} - -fuzzer_test("net_cert_ct_decode_signed_certificate_timestamp_fuzzer") { - sources = [ "cert/decode_signed_certificate_timestamp_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_canonical_cookie_fuzzer") { - sources = [ "cookies/canonical_cookie_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_cookies_fuzzer.dict" - seed_corpus = "data/fuzzer_data/cookies/" -} - -fuzzer_test("net_cookie_partition_key_fuzzer") { - sources = [ "cookies/cookie_partition_key_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] -} - -fuzzer_test("net_cookie_util_parsing_fuzzer") { - sources = [ "cookies/cookie_util_parsing_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_cookies_fuzzer.dict" - libfuzzer_options = [ "max_len=8192" ] - seed_corpus = "data/fuzzer_data/cookies/" -} - -fuzzer_test("net_parse_cookie_line_fuzzer") { - sources = [ "cookies/parse_cookie_line_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_cookies_fuzzer.dict" - seed_corpus = "data/fuzzer_data/cookies/" -} - -fuzzer_test("net_http_stream_parser_fuzzer") { - sources = [ "http/http_stream_parser_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_http_stream_parser_fuzzer.dict" -} - -fuzzer_test("canonicalize_host_fuzzer") { - sources = [ "base/canonicalize_host_fuzzer.cc" ] - deps = [ - "//net", - "//third_party/icu/fuzzers:fuzzer_support", - ] - dict = "base/canonicalize_host_fuzzer.dict" -} - -if (!is_win) { - fuzzer_test("net_ntlm_ntlm_client_fuzzer") { - sources = [ - "ntlm/ntlm_client_fuzzer.cc", - "ntlm/ntlm_test_data.h", - ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_ntlm_ntlm_client_fuzzer.dict" - seed_corpus = "data/fuzzer_data/ntlm_client_fuzzer/" - } -} - -if (!disable_brotli_filter) { - fuzzer_test("net_brotli_source_stream_fuzzer") { - sources = [ "filter/brotli_source_stream_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - } -} - -if (!disable_zstd_filter) { - fuzzer_test("net_zstd_source_stream_fuzzer") { - sources = [ "filter/zstd_source_stream_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - } -} - -fuzzer_test("net_gzip_source_stream_fuzzer") { - sources = [ "filter/gzip_source_stream_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_crl_set_fuzzer") { - sources = [ "cert/crl_set_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - seed_corpus = "data/fuzzer_data/net_crl_set_fuzzer/" -} - -fuzzer_test("net_spdy_headers_to_http_response_headers_fuzzer") { - sources = [ "spdy/spdy_headers_to_http_response_headers_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_http_stream_parser_fuzzer.dict" - libfuzzer_options = [ "max_len = 512" ] -} - -fuzzer_test("net_unescape_url_component_fuzzer") { - sources = [ "base/unescape_url_component_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/unescape_url_component_fuzzer.dict" - libfuzzer_options = [ "max_len = 2048" ] -} - -fuzzer_test("net_websocket_deflate_stream_fuzzer") { - sources = [ "websockets/websocket_deflate_stream_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_websocket_frame_parser_fuzzer.dict" - libfuzzer_options = [ "max_len=512" ] -} - -fuzzer_test("net_websocket_extension_parser_fuzzer") { - sources = [ "websockets/websocket_extension_parser_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_websocket_extension_parser_fuzzer.dict" - libfuzzer_options = [ "max_len = 256" ] -} - -fuzzer_test("net_websocket_frame_parser_fuzzer") { - sources = [ "websockets/websocket_frame_parser_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_websocket_frame_parser_fuzzer.dict" - libfuzzer_options = [ "max_len=256" ] -} - -if (use_fuzzing_engine) { - # This is a separate target because //net/server:http_server - # wants to limit its visibility to a select number of target, but the - # "fuzzer_test" template expands on iOS to many targets that need to - # have the "deps" information propagated in order to support "fat" - # binaries. - source_set("net_web_socket_encoder_fuzzer_deps") { - testonly = true - visibility = [ - ":net_web_socket_encoder_fuzzer", - ":net_web_socket_encoder_fuzzer_executable", - ":run_net_web_socket_encoder_fuzzer", - ] - public_deps = [ - ":net_fuzzer_test_support", - "//net", - ] - } - - fuzzer_test("net_web_socket_encoder_fuzzer") { - sources = [ "server/web_socket_encoder_fuzzer.cc" ] - deps = [ ":net_web_socket_encoder_fuzzer_deps" ] - libfuzzer_options = [ "max_len=256" ] - } -} - -fuzzer_test("net_http_chunked_decoder_fuzzer") { - sources = [ "http/http_chunked_decoder_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = "data/fuzzer_dictionaries/http_chunked_decoder_fuzzer.dict" -} - -fuzzer_test("net_http_auth_handler_basic_fuzzer") { - sources = [ "http/http_auth_handler_basic_fuzzer.cc" ] - dict = "data/fuzzer_dictionaries/net_http_auth_handler_basic_fuzzer.dict" - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//net", - ] -} - -fuzzer_test("net_http_auth_handler_digest_fuzzer") { - sources = [ "http/http_auth_handler_digest_fuzzer.cc" ] - dict = "data/fuzzer_dictionaries/net_http_auth_handler_digest_fuzzer.dict" - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//net", - ] -} - -fuzzer_test("net_http_auth_handler_fuzzer") { - sources = [ "http/http_auth_handler_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_http_content_disposition_fuzzer") { - sources = [ "http/http_content_disposition_fuzzer.cc" ] - dict = "data/fuzzer_dictionaries/net_http_content_disposition_fuzzer.dict" - deps = [ - ":net_fuzzer_test_support", - "//net", - ] -} - -fuzzer_test("net_http_proxy_client_socket_fuzzer") { - sources = [ "http/http_proxy_client_socket_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_http_proxy_client_socket_fuzzer.dict" -} - -fuzzer_test("net_structured_headers_fuzzer") { - sources = [ "http/structured_headers_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - seed_corpus = "data/fuzzer_data/structured_headers_corpus" -} - -fuzzer_test("net_parse_url_hostname_to_address_fuzzer") { - sources = [ "base/parse_url_hostname_to_address_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] - libfuzzer_options = [ "max_len=512" ] - seed_corpus = "data/fuzzer_data/hostnames/" -} - -fuzzer_test("net_quic_crypto_framer_parse_message_fuzzer") { - sources = [ "quic/quic_crypto_framer_parse_message_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_quic_transport_parameters_fuzzer") { - sources = [ "quic/quic_transport_parameters_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_socks_client_socket_fuzzer") { - sources = [ "socket/socks_client_socket_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_socks5_client_socket_fuzzer") { - sources = [ "socket/socks5_client_socket_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_url_request_fuzzer") { - sources = [ "url_request/url_request_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_url_request_fuzzer.dict" -} - -fuzzer_test("net_auth_challenge_tokenizer_fuzzer") { - sources = [ "http/http_auth_challenge_tokenizer_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_http_security_headers_hsts_fuzzer") { - sources = [ "http/http_security_headers_hsts_fuzzer.cc" ] - deps = [ - "//base", - "//net", - ] - dict = "data/fuzzer_dictionaries/net_http_security_headers_fuzzer.dict" - seed_corpus = "data/fuzzer_data/http_security_headers/" -} - -fuzzer_test("net_http_transport_security_state_static_fuzzer") { - sources = [ "http/transport_security_state_static_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - "//net", - ] - dict = - "data/fuzzer_dictionaries/net_http_transport_security_state_fuzzer.dict" -} - -fuzzer_test("net_spdy_session_fuzzer") { - sources = [ "spdy/spdy_session_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - "//net/data/ssl/certificates:generate_fuzzer_cert_includes", - ] - dict = "data/fuzzer_dictionaries/net_spdy_session_fuzzer.dict" - seed_corpus = "data/fuzzer_data/net_spdy_session_fuzzer/" -} - -fuzzer_test("net_http2_frame_decoder_fuzzer") { - sources = [ "spdy/fuzzing/http2_frame_decoder_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] -} - -fuzzer_test("net_hpack_decoder_fuzzer") { - sources = [ "spdy/fuzzing/hpack_decoder_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] -} - -proto_library("reporting_policy_proto") { - proto_in_dir = "//" - sources = [ "reporting/reporting_policy.proto" ] - link_deps = [ "//testing/libfuzzer/proto:json_proto" ] -} - -fuzzer_test("net_reporting_header_parser_fuzzer") { - sources = [ "reporting/reporting_header_parser_fuzzer.cc" ] - - deps = [ - ":net_fuzzer_test_support", - ":reporting_policy_proto", - ":test_support", - "//base", - "//net", - "//testing/libfuzzer/proto:json_proto", - "//testing/libfuzzer/proto:json_proto_converter", - "//third_party/libprotobuf-mutator", - ] -} - -fuzzer_test("net_quic_session_pool_fuzzer") { - sources = [ "quic/quic_session_pool_fuzzer.cc" ] - - deps = [ - ":net_fuzzer_test_support", - ":quic_test_tools", - ":test_support", - "//net", - "//net/data/ssl/certificates:generate_fuzzer_cert_includes", - ] -} - -if (is_linux || is_chromeos) { - fuzzer_test("net_base_address_tracker_linux_fuzzer") { - sources = [ "base/address_tracker_linux_fuzzer.cc" ] - deps = [ - ":net_fuzzer_test_support", - ":test_support", - "//base", - "//net", - ] - } -} - -if (is_android) { - java_cpp_strings("java_cookie_switches_srcjar") { - # External code should depend on ":cookie_switches_java" instead. - visibility = [ ":*" ] - sources = [ "cookies/cookie_switches.cc" ] - template = "cookies/android/java_templates/CookieSwitches.java.tmpl" - } - - android_library("cookie_switches_java") { - srcjar_deps = [ ":java_cookie_switches_srcjar" ] - } -} diff --git a/src/net/dns/BUILD.gn b/src/net/dns/BUILD.gn index 5f4ff9ff81..447976dc34 100644 --- a/src/net/dns/BUILD.gn +++ b/src/net/dns/BUILD.gn @@ -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 = use_blink @@ -17,16 +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/*", - - # Needed for brokering system DNS resolution out of the network service. - "//content/browser/system_dns_resolution", - "//content/test/*", "//net/*", - "//services/network/*", ] public = [] @@ -211,30 +200,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 = [ @@ -273,16 +239,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" ] @@ -312,24 +269,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/41408297): 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/41424787): Remove once migrated to network service. - "//chrome/browser/ash/smb_client/discovery", - - # Tests and test support - "//chrome/browser:test_support", - "//chrome/test/*", - - # Network stack/service - "//components/certificate_transparency/*", "//net/*", - "//services/network/*", ] sources = [ @@ -366,29 +306,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/41408297): 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/41408297): 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/41424787): Remove once migrated to network service. - "//chrome/browser/ash/smb_client/discovery", - - # Tests and test support - "//chrome/browser:test_support", - - # Network stack/service "//net/*", - "//services/network/*", ] public = [] @@ -405,247 +323,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_names_util_unittest.cc", - "dns_query_unittest.cc", - "dns_response_result_extractor_unittest.cc", - "dns_response_unittest.cc", - "dns_task_results_manager_unittest.cc", - "dns_transaction_unittest.cc", - "dns_udp_tracker_unittest.cc", - "dns_util_unittest.cc", - "host_cache_unittest.cc", - "host_resolver_cache_unittest.cc", - "host_resolver_internal_result_unittest.cc", - "host_resolver_manager_ipv6_reachability_override_unittest.cc", - "host_resolver_manager_unittest.cc", - "host_resolver_service_endpoint_request_unittest.cc", - "https_record_rdata_unittest.cc", - "httpssvc_metrics_unittest.cc", - "loopback_only_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_internal_result_test_util.cc", - "host_resolver_results_test_util.cc", - "mock_host_resolver.cc", - ] - public = [ - "dns_test_util.h", - "host_resolver_internal_result_test_util.h", - "host_resolver_manager_unittest.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", - "//base/test:test_support", - "//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_host_resolver_cache_fuzzer") { - sources = [ "host_resolver_cache_fuzzer.cc" ] - deps = [ - "//base", - "//net", - "//net:net_fuzzer_test_support", - "//testing/libfuzzer/proto:json_proto", - "//testing/libfuzzer/proto:json_proto_converter", - "//third_party/libprotobuf-mutator", - ] -} - -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_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" - libfuzzer_options = [ "max_len=4096" ] -} - -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" - } -} diff --git a/src/net/dns/public/BUILD.gn b/src/net/dns/public/BUILD.gn index b2b99d7ec3..292b5ea895 100644 --- a/src/net/dns/public/BUILD.gn +++ b/src/net/dns/public/BUILD.gn @@ -63,32 +63,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", - ] -} diff --git a/src/net/third_party/quiche/BUILD.gn b/src/net/third_party/quiche/BUILD.gn index 43d04ac382..e6324e11b5 100644 --- a/src/net/third_party/quiche/BUILD.gn +++ b/src/net/third_party/quiche/BUILD.gn @@ -26,11 +26,8 @@ import("//build/config/chromeos/ui_mode.gni") import("//net/third_party/quiche/src/build/source_list.gni") -import("//testing/libfuzzer/fuzzer_test.gni") import("//third_party/protobuf/proto_library.gni") -build_epoll_based_tools = is_linux || is_chromeos - config("quiche_internal_config") { cflags = [] if (is_clang) { @@ -131,827 +128,3 @@ proto_library("net_quic_test_tools_proto") { extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] } - -if (build_epoll_based_tools) { - static_library("epoll_tool_support") { - # TODO(crbug.com/325102878): Remove once usage of the deprecated version of - # absl::HexStringToBytes have been removed. - cflags = [ "-Wno-deprecated-declarations" ] - testonly = true - sources = [ - "overrides/quiche_platform_impl/quiche_udp_socket_platform_impl.h", - "src/quiche/common/platform/default/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h", - ] + io_tool_support_srcs + io_tool_support_hdrs - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":quiche_tool_support", - "//base", - "//net", - "//third_party/boringssl", - ] - } - - executable("epoll_quic_client") { - testonly = true - sources = [ - "src/quiche/quic/tools/quic_client_bin.cc", - "src/quiche/quic/tools/quic_epoll_client_factory.cc", - "src/quiche/quic/tools/quic_epoll_client_factory.h", - ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":epoll_tool_support", - ":quic_client_core", - ":quiche_tool_support", - "//base", - "//net", - "//third_party/boringssl", - ] - } - - executable("epoll_quic_server") { - testonly = true - sources = [ - "src/quiche/quic/tools/quic_server_bin.cc", - "src/quiche/quic/tools/quic_server_factory.cc", - "src/quiche/quic/tools/quic_server_factory.h", - ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":epoll_tool_support", - ":quic_server_core", - ":quiche_tool_support", - "//base", - "//net", - "//third_party/boringssl", - ] - } - - executable("quic_client_interop_test") { - testonly = true - sources = [ "src/quiche/quic/tools/quic_client_interop_test_bin.cc" ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":epoll_tool_support", - ":quiche_test_support", - ":quiche_tool_support", - "//net", - ] - } - - executable("masque_client") { - testonly = true - - # TODO(crbug.com/325102878): Remove once usage of the deprecated version of - # absl::HexStringToBytes have been removed. - cflags = [ "-Wno-deprecated-declarations" ] - sources = [ "src/quiche/quic/masque/masque_client_bin.cc" ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":epoll_tool_support", - ":quiche_tool_support", - "//net", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - ] - } - - executable("masque_server") { - testonly = true - sources = [ "src/quiche/quic/masque/masque_server_bin.cc" ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":epoll_tool_support", - ":quiche_tool_support", - "//net", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - ] - } - - static_library("epoll_test_support") { - testonly = true - sources = io_test_support_srcs + io_test_support_hdrs - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":epoll_tool_support", - ":quiche_test_support", - ":quiche_tool_support", - "//base", - "//net", - "//net:gtest_util", - "//testing/gmock", - "//testing/gtest", - ] - } -} - -static_library("quiche_test_support") { - testonly = true - - # TODO(crbug.com/325102878): Remove once usage of the deprecated version of - # absl::HexStringToBytes have been removed. - cflags = [ "-Wno-deprecated-declarations" ] - sources = [ - "overrides/quiche_platform_impl/quiche_expect_bug_impl.h", - "overrides/quiche_platform_impl/quiche_mock_log_impl.h", - "overrides/quiche_platform_impl/quiche_test_helpers_impl.cc", - "overrides/quiche_platform_impl/quiche_test_helpers_impl.h", - "overrides/quiche_platform_impl/quiche_test_impl.cc", - "overrides/quiche_platform_impl/quiche_test_impl.h", - "overrides/quiche_platform_impl/quiche_test_output_impl.cc", - "overrides/quiche_platform_impl/quiche_test_output_impl.h", - "src/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.cc", - "src/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.h", - ] + quiche_test_support_srcs + quiche_test_support_hdrs - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":quiche", - ":quiche_tool_support", - "//base", - "//crypto:test_support", - "//net:quic_test_flags_utils", - "//net:test_support", - "//testing/gmock", - "//testing/gtest", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - ] -} - -static_library("quiche_tool_support") { - testonly = true - sources = [ - "overrides/quiche_platform_impl/quiche_command_line_flags_impl.cc", - "overrides/quiche_platform_impl/quiche_command_line_flags_impl.h", - "overrides/quiche_platform_impl/quiche_default_proof_providers_impl.cc", - "overrides/quiche_platform_impl/quiche_default_proof_providers_impl.h", - "overrides/quiche_platform_impl/quiche_system_event_loop_impl.h", - "src/quiche/common/platform/default/quiche_platform_impl/quiche_file_utils_impl.cc", - "src/quiche/common/platform/default/quiche_platform_impl/quiche_file_utils_impl.h", - ] + quiche_tool_support_srcs + quiche_tool_support_hdrs - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - "//base", - "//net", - "//third_party/protobuf:protobuf_lite", - "//third_party/quic_trace:quic_trace_proto", - "//url", - ] -} - -# QUICHE-provided CLI tools that don't use epoll. -if (!is_ios) { - # The two libraries below, quic_client_core and quic_server_core, define - # mutually exclusive command-line flags, and thus any target depending - # directly on both will fail to build. Only executable targets should depend - # on those. - source_set("quic_client_core") { - testonly = true - - # TODO(crbug.com/325102878): Remove once usage of the deprecated version of - # absl::HexStringToBytes have been removed. - cflags = [ "-Wno-deprecated-declarations" ] - sources = [ - "src/quiche/quic/tools/quic_toy_client.cc", - "src/quiche/quic/tools/quic_toy_client.h", - ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - "//net", - "//net:quic_test_tools", - "//net:simple_quic_tools", - ] - } - source_set("quic_server_core") { - testonly = true - sources = [ - "src/quiche/quic/tools/quic_toy_server.cc", - "src/quiche/quic/tools/quic_toy_server.h", - ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - "//net", - "//net:simple_quic_tools", - ] - } - - executable("quic_packet_printer") { - testonly = true - - # TODO(crbug.com/325102878): Remove once usage of the deprecated version of - # absl::HexStringToBytes have been removed. - cflags = [ "-Wno-deprecated-declarations" ] - sources = [ "src/quiche/quic/tools/quic_packet_printer_bin.cc" ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - "//base", - "//build/win:default_exe_manifest", - "//net", - "//net:simple_quic_tools", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - ] - } - - executable("quic_crypto_message_printer") { - testonly = true - - # TODO(crbug.com/325102878): Remove once usage of the deprecated version of - # absl::HexStringToBytes have been removed. - cflags = [ "-Wno-deprecated-declarations" ] - sources = [ "src/quiche/quic/tools/crypto_message_printer_bin.cc" ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - "//base", - "//build/win:default_exe_manifest", - "//net", - "//net:simple_quic_tools", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - ] - } - - executable("quic_reject_reason_decoder") { - testonly = true - sources = [ "src/quiche/quic/tools/quic_reject_reason_decoder_bin.cc" ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - "//base", - "//build/win:default_exe_manifest", - "//net", - "//net:simple_quic_tools", - "//third_party/boringssl", - "//third_party/protobuf:protobuf_lite", - ] - } - - executable("qpack_offline_decoder") { - testonly = true - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - sources = [ "src/quiche/quic/tools/qpack_offline_decoder_bin.cc" ] - deps = [ - "//base", - "//net", - "//net:quic_test_tools", - "//net:simple_quic_tools", - "//testing/gmock", - ] - } -} - -bundle_data("test_data") { - visibility = [ ":quiche_tests" ] - testonly = true - sources = [ - "src/quiche/common/platform/api/testdir/README.md", - "src/quiche/common/platform/api/testdir/a/b/c/d/e", - "src/quiche/common/platform/api/testdir/a/subdir/testfile", - "src/quiche/common/platform/api/testdir/a/z", - "src/quiche/common/platform/api/testdir/testfile", - ] - outputs = [ "{{bundle_resources_dir}}/" + - "{{source_root_relative_dir}}/{{source_file_part}}" ] -} - -source_set("quiche_tests") { - testonly = true - - # TODO(crbug.com/325102878): Remove once usage of the deprecated version of - # absl::HexStringToBytes have been removed. - cflags = [ "-Wno-deprecated-declarations" ] - sources = [ - "src/quiche/binary_http/binary_http_message_test.cc", - "src/quiche/blind_sign_auth/blind_sign_auth_test.cc", - "src/quiche/blind_sign_auth/cached_blind_sign_auth_test.cc", - "src/quiche/common/btree_scheduler_test.cc", - "src/quiche/common/capsule_test.cc", - "src/quiche/common/http/http_header_block_test.cc", - "src/quiche/common/http/http_header_storage_test.cc", - "src/quiche/common/masque/connect_ip_datagram_payload_test.cc", - "src/quiche/common/masque/connect_udp_datagram_payload_test.cc", - "src/quiche/common/platform/api/quiche_file_utils_test.cc", - "src/quiche/common/platform/api/quiche_hostname_utils_test.cc", - "src/quiche/common/platform/api/quiche_lower_case_string_test.cc", - "src/quiche/common/platform/api/quiche_mem_slice_test.cc", - "src/quiche/common/platform/api/quiche_reference_counted_test.cc", - "src/quiche/common/platform/api/quiche_stack_trace_test.cc", - "src/quiche/common/platform/api/quiche_time_utils_test.cc", - "src/quiche/common/platform/api/quiche_url_utils_test.cc", - "src/quiche/common/print_elements_test.cc", - "src/quiche/common/quiche_buffer_allocator_test.cc", - "src/quiche/common/quiche_callbacks_test.cc", - "src/quiche/common/quiche_circular_deque_test.cc", - "src/quiche/common/quiche_data_reader_test.cc", - "src/quiche/common/quiche_data_writer_test.cc", - "src/quiche/common/quiche_endian_test.cc", - "src/quiche/common/quiche_ip_address_test.cc", - "src/quiche/common/quiche_linked_hash_map_test.cc", - "src/quiche/common/quiche_mem_slice_storage_test.cc", - "src/quiche/common/quiche_random_test.cc", - "src/quiche/common/quiche_simple_arena_test.cc", - "src/quiche/common/quiche_text_utils_test.cc", - "src/quiche/common/simple_buffer_allocator_test.cc", - "src/quiche/common/structured_headers_generated_test.cc", - "src/quiche/common/structured_headers_test.cc", - "src/quiche/common/test_tools/mock_streams_test.cc", - "src/quiche/common/test_tools/quiche_test_utils_test.cc", - "src/quiche/common/wire_serialization_test.cc", - "src/quiche/http2/adapter/event_forwarder_test.cc", - "src/quiche/http2/adapter/header_validator_test.cc", - "src/quiche/http2/adapter/noop_header_validator_test.cc", - "src/quiche/http2/adapter/oghttp2_adapter_metadata_test.cc", - "src/quiche/http2/adapter/oghttp2_adapter_test.cc", - "src/quiche/http2/adapter/oghttp2_session_test.cc", - "src/quiche/http2/adapter/oghttp2_util_test.cc", - "src/quiche/http2/adapter/recording_http2_visitor_test.cc", - "src/quiche/http2/adapter/window_manager_test.cc", - "src/quiche/http2/core/array_output_buffer_test.cc", - "src/quiche/http2/core/priority_write_scheduler_test.cc", - "src/quiche/http2/core/spdy_alt_svc_wire_format_test.cc", - "src/quiche/http2/core/spdy_frame_builder_test.cc", - "src/quiche/http2/core/spdy_framer_test.cc", - "src/quiche/http2/core/spdy_protocol_test.cc", - "src/quiche/http2/decoder/decode_buffer_test.cc", - "src/quiche/http2/decoder/decode_http2_structures_test.cc", - "src/quiche/http2/decoder/http2_frame_decoder_test.cc", - "src/quiche/http2/decoder/http2_structure_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/data_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/headers_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/ping_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/priority_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/priority_update_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/settings_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc", - "src/quiche/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc", - "src/quiche/http2/hpack/decoder/hpack_block_collector_test.cc", - "src/quiche/http2/hpack/decoder/hpack_block_decoder_test.cc", - "src/quiche/http2/hpack/decoder/hpack_decoder_state_test.cc", - "src/quiche/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc", - "src/quiche/http2/hpack/decoder/hpack_decoder_tables_test.cc", - "src/quiche/http2/hpack/decoder/hpack_decoder_test.cc", - "src/quiche/http2/hpack/decoder/hpack_entry_collector_test.cc", - "src/quiche/http2/hpack/decoder/hpack_entry_decoder_test.cc", - "src/quiche/http2/hpack/decoder/hpack_entry_type_decoder_test.cc", - "src/quiche/http2/hpack/decoder/hpack_string_decoder_test.cc", - "src/quiche/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc", - "src/quiche/http2/hpack/hpack_encoder_test.cc", - "src/quiche/http2/hpack/hpack_entry_test.cc", - "src/quiche/http2/hpack/hpack_header_table_test.cc", - "src/quiche/http2/hpack/hpack_output_stream_test.cc", - "src/quiche/http2/hpack/hpack_static_table_test.cc", - "src/quiche/http2/hpack/http2_hpack_constants_test.cc", - "src/quiche/http2/hpack/huffman/hpack_huffman_decoder_test.cc", - "src/quiche/http2/hpack/huffman/hpack_huffman_encoder_test.cc", - "src/quiche/http2/hpack/huffman/hpack_huffman_transcoder_test.cc", - "src/quiche/http2/hpack/varint/hpack_varint_decoder_test.cc", - "src/quiche/http2/hpack/varint/hpack_varint_encoder_test.cc", - "src/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc", - "src/quiche/http2/http2_constants_test.cc", - "src/quiche/http2/http2_structures_test.cc", - "src/quiche/http2/test_tools/hpack_block_builder_test.cc", - "src/quiche/http2/test_tools/hpack_example_test.cc", - "src/quiche/http2/test_tools/http2_frame_builder_test.cc", - "src/quiche/http2/test_tools/http2_random_test.cc", - "src/quiche/http2/test_tools/random_decoder_test_base_test.cc", - "src/quiche/oblivious_http/buffers/oblivious_http_integration_test.cc", - "src/quiche/oblivious_http/buffers/oblivious_http_request_test.cc", - "src/quiche/oblivious_http/buffers/oblivious_http_response_test.cc", - "src/quiche/oblivious_http/common/oblivious_http_header_key_config_test.cc", - "src/quiche/oblivious_http/oblivious_http_client_test.cc", - "src/quiche/oblivious_http/oblivious_http_gateway_test.cc", - "src/quiche/quic/core/congestion_control/bandwidth_sampler_test.cc", - "src/quiche/quic/core/congestion_control/bbr2_simulator_test.cc", - "src/quiche/quic/core/congestion_control/bbr_sender_test.cc", - "src/quiche/quic/core/congestion_control/cubic_bytes_test.cc", - "src/quiche/quic/core/congestion_control/general_loss_algorithm_test.cc", - "src/quiche/quic/core/congestion_control/hybrid_slow_start_test.cc", - "src/quiche/quic/core/congestion_control/pacing_sender_test.cc", - "src/quiche/quic/core/congestion_control/prr_sender_test.cc", - "src/quiche/quic/core/congestion_control/rtt_stats_test.cc", - "src/quiche/quic/core/congestion_control/send_algorithm_test.cc", - "src/quiche/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc", - "src/quiche/quic/core/congestion_control/uber_loss_algorithm_test.cc", - "src/quiche/quic/core/congestion_control/windowed_filter_test.cc", - "src/quiche/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc", - "src/quiche/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc", - "src/quiche/quic/core/crypto/aes_128_gcm_decrypter_test.cc", - "src/quiche/quic/core/crypto/aes_128_gcm_encrypter_test.cc", - "src/quiche/quic/core/crypto/aes_256_gcm_decrypter_test.cc", - "src/quiche/quic/core/crypto/aes_256_gcm_encrypter_test.cc", - "src/quiche/quic/core/crypto/cert_compressor_test.cc", - "src/quiche/quic/core/crypto/certificate_util_test.cc", - "src/quiche/quic/core/crypto/certificate_view_test.cc", - "src/quiche/quic/core/crypto/chacha20_poly1305_decrypter_test.cc", - "src/quiche/quic/core/crypto/chacha20_poly1305_encrypter_test.cc", - "src/quiche/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc", - "src/quiche/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc", - "src/quiche/quic/core/crypto/channel_id_test.cc", - "src/quiche/quic/core/crypto/client_proof_source_test.cc", - "src/quiche/quic/core/crypto/crypto_framer_test.cc", - "src/quiche/quic/core/crypto/crypto_handshake_message_test.cc", - "src/quiche/quic/core/crypto/crypto_secret_boxer_test.cc", - "src/quiche/quic/core/crypto/crypto_server_test.cc", - "src/quiche/quic/core/crypto/crypto_utils_test.cc", - "src/quiche/quic/core/crypto/curve25519_key_exchange_test.cc", - "src/quiche/quic/core/crypto/null_decrypter_test.cc", - "src/quiche/quic/core/crypto/null_encrypter_test.cc", - "src/quiche/quic/core/crypto/p256_key_exchange_test.cc", - "src/quiche/quic/core/crypto/proof_source_x509_test.cc", - "src/quiche/quic/core/crypto/quic_client_session_cache_test.cc", - "src/quiche/quic/core/crypto/quic_compressed_certs_cache_test.cc", - "src/quiche/quic/core/crypto/quic_crypto_client_config_test.cc", - "src/quiche/quic/core/crypto/quic_crypto_server_config_test.cc", - "src/quiche/quic/core/crypto/quic_hkdf_test.cc", - "src/quiche/quic/core/crypto/transport_parameters_test.cc", - "src/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier_test.cc", - "src/quiche/quic/core/deterministic_connection_id_generator_test.cc", - "src/quiche/quic/core/frames/quic_frames_test.cc", - "src/quiche/quic/core/http/http_decoder_test.cc", - "src/quiche/quic/core/http/http_encoder_test.cc", - "src/quiche/quic/core/http/http_frames_test.cc", - "src/quiche/quic/core/http/quic_header_list_test.cc", - "src/quiche/quic/core/http/quic_headers_stream_test.cc", - "src/quiche/quic/core/http/quic_receive_control_stream_test.cc", - "src/quiche/quic/core/http/quic_send_control_stream_test.cc", - "src/quiche/quic/core/http/quic_server_session_base_test.cc", - "src/quiche/quic/core/http/quic_spdy_session_test.cc", - "src/quiche/quic/core/http/quic_spdy_stream_body_manager_test.cc", - "src/quiche/quic/core/http/quic_spdy_stream_test.cc", - "src/quiche/quic/core/http/spdy_utils_test.cc", - "src/quiche/quic/core/http/web_transport_http3_test.cc", - "src/quiche/quic/core/internet_checksum_test.cc", - "src/quiche/quic/core/legacy_quic_stream_id_manager_test.cc", - "src/quiche/quic/core/packet_number_indexed_queue_test.cc", - "src/quiche/quic/core/qpack/qpack_blocking_manager_test.cc", - "src/quiche/quic/core/qpack/qpack_decoded_headers_accumulator_test.cc", - "src/quiche/quic/core/qpack/qpack_decoder_stream_receiver_test.cc", - "src/quiche/quic/core/qpack/qpack_decoder_stream_sender_test.cc", - "src/quiche/quic/core/qpack/qpack_decoder_test.cc", - "src/quiche/quic/core/qpack/qpack_encoder_stream_receiver_test.cc", - "src/quiche/quic/core/qpack/qpack_encoder_stream_sender_test.cc", - "src/quiche/quic/core/qpack/qpack_encoder_test.cc", - "src/quiche/quic/core/qpack/qpack_header_table_test.cc", - "src/quiche/quic/core/qpack/qpack_index_conversions_test.cc", - "src/quiche/quic/core/qpack/qpack_instruction_decoder_test.cc", - "src/quiche/quic/core/qpack/qpack_instruction_encoder_test.cc", - "src/quiche/quic/core/qpack/qpack_receive_stream_test.cc", - "src/quiche/quic/core/qpack/qpack_required_insert_count_test.cc", - "src/quiche/quic/core/qpack/qpack_round_trip_test.cc", - "src/quiche/quic/core/qpack/qpack_send_stream_test.cc", - "src/quiche/quic/core/qpack/qpack_static_table_test.cc", - "src/quiche/quic/core/qpack/value_splitting_header_list_test.cc", - "src/quiche/quic/core/quic_alarm_test.cc", - "src/quiche/quic/core/quic_arena_scoped_ptr_test.cc", - "src/quiche/quic/core/quic_bandwidth_test.cc", - "src/quiche/quic/core/quic_buffered_packet_store_test.cc", - "src/quiche/quic/core/quic_chaos_protector_test.cc", - "src/quiche/quic/core/quic_coalesced_packet_test.cc", - "src/quiche/quic/core/quic_config_test.cc", - "src/quiche/quic/core/quic_connection_context_test.cc", - "src/quiche/quic/core/quic_connection_id_manager_test.cc", - "src/quiche/quic/core/quic_connection_id_test.cc", - "src/quiche/quic/core/quic_connection_test.cc", - "src/quiche/quic/core/quic_control_frame_manager_test.cc", - "src/quiche/quic/core/quic_crypto_client_handshaker_test.cc", - "src/quiche/quic/core/quic_crypto_client_stream_test.cc", - "src/quiche/quic/core/quic_crypto_server_stream_test.cc", - "src/quiche/quic/core/quic_crypto_stream_test.cc", - "src/quiche/quic/core/quic_data_writer_test.cc", - "src/quiche/quic/core/quic_datagram_queue_test.cc", - "src/quiche/quic/core/quic_dispatcher_test.cc", - "src/quiche/quic/core/quic_error_codes_test.cc", - "src/quiche/quic/core/quic_flow_controller_test.cc", - "src/quiche/quic/core/quic_framer_test.cc", - "src/quiche/quic/core/quic_generic_session_test.cc", - "src/quiche/quic/core/quic_idle_network_detector_test.cc", - "src/quiche/quic/core/quic_interval_deque_test.cc", - "src/quiche/quic/core/quic_interval_set_test.cc", - "src/quiche/quic/core/quic_interval_test.cc", - "src/quiche/quic/core/quic_lru_cache_test.cc", - "src/quiche/quic/core/quic_network_blackhole_detector_test.cc", - "src/quiche/quic/core/quic_one_block_arena_test.cc", - "src/quiche/quic/core/quic_packet_creator_test.cc", - "src/quiche/quic/core/quic_packet_number_test.cc", - "src/quiche/quic/core/quic_packets_test.cc", - "src/quiche/quic/core/quic_path_validator_test.cc", - "src/quiche/quic/core/quic_ping_manager_test.cc", - "src/quiche/quic/core/quic_received_packet_manager_test.cc", - "src/quiche/quic/core/quic_sent_packet_manager_test.cc", - "src/quiche/quic/core/quic_server_id_test.cc", - "src/quiche/quic/core/quic_session_test.cc", - "src/quiche/quic/core/quic_socket_address_coder_test.cc", - "src/quiche/quic/core/quic_stream_id_manager_test.cc", - "src/quiche/quic/core/quic_stream_priority_test.cc", - "src/quiche/quic/core/quic_stream_send_buffer_test.cc", - "src/quiche/quic/core/quic_stream_sequencer_buffer_test.cc", - "src/quiche/quic/core/quic_stream_sequencer_test.cc", - "src/quiche/quic/core/quic_stream_test.cc", - "src/quiche/quic/core/quic_sustained_bandwidth_recorder_test.cc", - "src/quiche/quic/core/quic_tag_test.cc", - "src/quiche/quic/core/quic_time_accumulator_test.cc", - "src/quiche/quic/core/quic_time_test.cc", - "src/quiche/quic/core/quic_time_wait_list_manager_test.cc", - "src/quiche/quic/core/quic_trace_visitor_test.cc", - "src/quiche/quic/core/quic_unacked_packet_map_test.cc", - "src/quiche/quic/core/quic_utils_test.cc", - "src/quiche/quic/core/quic_version_manager_test.cc", - "src/quiche/quic/core/quic_versions_test.cc", - "src/quiche/quic/core/quic_write_blocked_list_test.cc", - "src/quiche/quic/core/tls_chlo_extractor_test.cc", - "src/quiche/quic/core/tls_client_handshaker_test.cc", - "src/quiche/quic/core/tls_server_handshaker_test.cc", - "src/quiche/quic/core/uber_quic_stream_id_manager_test.cc", - "src/quiche/quic/core/uber_received_packet_manager_test.cc", - "src/quiche/quic/platform/api/quic_socket_address_test.cc", - "src/quiche/quic/test_tools/crypto_test_utils_test.cc", - "src/quiche/quic/test_tools/quic_test_utils_test.cc", - "src/quiche/quic/test_tools/simple_session_notifier_test.cc", - "src/quiche/quic/test_tools/simulator/quic_endpoint_test.cc", - "src/quiche/quic/test_tools/simulator/simulator_test.cc", - "src/quiche/quic/test_tools/test_ip_packets_test.cc", - "src/quiche/quic/tools/connect_tunnel_test.cc", - "src/quiche/quic/tools/connect_udp_tunnel_test.cc", - "src/quiche/quic/tools/quic_memory_cache_backend_test.cc", - "src/quiche/quic/tools/quic_tcp_like_trace_converter_test.cc", - "src/quiche/quic/tools/simple_ticket_crypter_test.cc", - "src/quiche/spdy/core/hpack/hpack_decoder_adapter_test.cc", - "src/quiche/spdy/core/hpack/hpack_round_trip_test.cc", - "src/quiche/web_transport/encapsulated/encapsulated_web_transport_test.cc", - "src/quiche/web_transport/web_transport_headers_test.cc", - ] - - data = [ "src/quiche/common/platform/api/testdir/" ] - - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":blind_sign_auth", - ":blind_sign_auth_test_support", - "//net", - "//net:quic_test_tools", - "//net:simple_quic_tools", - "//net:spdy_test_tools", - "//testing/gmock", - "//testing/gtest", - ] - if (is_ios) { - deps += [ ":test_data" ] - } - public_deps = [] - - if (build_epoll_based_tools) { - sources += [ - "overrides/quiche_platform_impl/quiche_command_line_flags_test.cc", - "src/quiche/quic/core/chlo_extractor_test.cc", - "src/quiche/quic/core/http/end_to_end_test.cc", - "src/quiche/quic/core/http/quic_spdy_client_session_test.cc", - "src/quiche/quic/core/http/quic_spdy_client_stream_test.cc", - "src/quiche/quic/core/http/quic_spdy_server_stream_base_test.cc", - "src/quiche/quic/core/io/event_loop_connecting_client_socket_test.cc", - "src/quiche/quic/core/io/quic_all_event_loops_test.cc", - "src/quiche/quic/core/io/quic_poll_event_loop_test.cc", - "src/quiche/quic/core/io/socket_test.cc", - "src/quiche/quic/tools/quic_default_client_test.cc", - "src/quiche/quic/tools/quic_server_test.cc", - "src/quiche/quic/tools/quic_simple_server_session_test.cc", - "src/quiche/quic/tools/quic_simple_server_stream_test.cc", - "src/quiche/quic/tools/quic_url_test.cc", - ] - public_deps += [ - ":epoll_test_support", - ":epoll_tool_support", - ] - } -} - -fuzzer_test("net_quic_framer_fuzzer") { - sources = [ "src/quiche/quic/test_tools/fuzzing/quic_framer_fuzzer.cc" ] - - deps = [ - "//net", - "//net:net_fuzzer_test_support", - "//net:quic_test_tools", - "//net:test_support", - "//net/data/ssl/certificates:generate_fuzzer_cert_includes", - ] -} - -fuzzer_test("net_quic_framer_process_data_packet_fuzzer") { - sources = [ "src/quiche/quic/test_tools/fuzzing/quic_framer_process_data_packet_fuzzer.cc" ] - - deps = [ - "//net", - "//net:net_fuzzer_test_support", - "//net:quic_test_tools", - "//net:test_support", - "//net/data/ssl/certificates:generate_fuzzer_cert_includes", - ] -} - -fuzzer_test("net_qpack_decoder_fuzzer") { - sources = [ "src/quiche/quic/core/qpack/fuzzer/qpack_decoder_fuzzer.cc" ] - deps = [ - "//base", - "//net", - "//net:net_fuzzer_test_support", - "//net:quic_test_tools", - "//net:test_support", - ] -} - -fuzzer_test("net_qpack_encoder_stream_receiver_fuzzer") { - sources = [ - "src/quiche/quic/core/qpack/fuzzer/qpack_encoder_stream_receiver_fuzzer.cc", - ] - deps = [ - "//base", - "//net", - "//net:net_fuzzer_test_support", - ] -} - -fuzzer_test("net_qpack_encoder_stream_sender_fuzzer") { - sources = [ - "src/quiche/quic/core/qpack/fuzzer/qpack_encoder_stream_sender_fuzzer.cc", - ] - deps = [ - "//base", - "//net", - "//net:net_fuzzer_test_support", - "//net:quic_test_tools", - "//net:test_support", - ] -} - -fuzzer_test("net_qpack_round_trip_fuzzer") { - sources = [ "src/quiche/quic/core/qpack/fuzzer/qpack_round_trip_fuzzer.cc" ] - deps = [ - "//base", - "//net", - "//net:net_fuzzer_test_support", - "//net:quic_test_tools", - "//net:test_support", - ] -} - -component("blind_sign_auth") { - sources = [ - "src/quiche/blind_sign_auth/blind_sign_auth.cc", - "src/quiche/blind_sign_auth/blind_sign_auth.h", - "src/quiche/blind_sign_auth/blind_sign_auth_interface.h", - "src/quiche/blind_sign_auth/blind_sign_message_interface.h", - "src/quiche/blind_sign_auth/blind_sign_message_response.cc", - "src/quiche/blind_sign_auth/blind_sign_message_response.h", - "src/quiche/blind_sign_auth/cached_blind_sign_auth.cc", - "src/quiche/blind_sign_auth/cached_blind_sign_auth.h", - ] - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":quiche", - "//base", - "//third_party/abseil-cpp:absl", - "//third_party/anonymous_tokens:rsa_bssa_public_metadata_client", - "//third_party/boringssl", - "//url", - ] - - public_deps = [ - ":blind_sign_auth_proto", - "//third_party/anonymous_tokens:anonymous_tokens_rsa_bssa_client", - "//third_party/anonymous_tokens:crypto_utils", - "//third_party/anonymous_tokens:proto_utils", - "//third_party/anonymous_tokens:tokens_encodings", - ] - - defines = [ "IS_QUICHE_IMPL" ] -} - -proto_library("blind_sign_auth_proto") { - visibility = [ - ":blind_sign_auth", - ":blind_sign_auth_test_support", - ":quiche", - ":quiche_tests", - "//components/ip_protection/*", - ] - - sources = protobuf_blind_sign_auth - cc_generator_options = "lite=true,dllexport_decl=COMPONENT_EXPORT(QUICHE):" - cc_include = "base/component_export.h" - component_build_force_source_set = true - - proto_in_dir = "src" - - deps = [ "//base" ] - - proto_deps = [ "//third_party/anonymous_tokens:anonymous_tokens_cc_proto" ] - - proto_data_sources = [ "//third_party/anonymous_tokens/src/anonymous_tokens/proto/anonymous_tokens.proto" ] - - import_dirs = [ "//third_party/anonymous_tokens/src/" ] - - defines = [ "IS_QUICHE_IMPL" ] - - extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] -} - -source_set("blind_sign_auth_test_support") { - visibility = [ ":quiche_tests" ] - testonly = true - sources = [ - "src/quiche/blind_sign_auth/test_tools/mock_blind_sign_auth_interface.h", - "src/quiche/blind_sign_auth/test_tools/mock_blind_sign_message_interface.h", - ] - configs += [ ":quiche_internal_config" ] - public_configs = [ ":quiche_config" ] - - deps = [ - ":blind_sign_auth", - ":quiche", - ":quiche_test_support", - ":quiche_tool_support", - ] - public_deps = - [ "//third_party/anonymous_tokens:anonymous_tokens_test_support" ] -} - -if (is_android) { - import("//build/config/android/rules.gni") - - proto_java_library("blind_sign_auth_proto_java") { - visibility = [ - "//components/ip_protection/*", - "//net/third_party/quiche/*", - ] - - proto_path = "src/" - - sources = [ - "src/quiche/blind_sign_auth/proto/any.proto", - "src/quiche/blind_sign_auth/proto/attestation.proto", - "src/quiche/blind_sign_auth/proto/auth_and_sign.proto", - "src/quiche/blind_sign_auth/proto/get_initial_data.proto", - "src/quiche/blind_sign_auth/proto/key_services.proto", - "src/quiche/blind_sign_auth/proto/proxy_layer.proto", - "src/quiche/blind_sign_auth/proto/public_metadata.proto", - ] - - deps = [ "//third_party/anonymous_tokens:anonymous_tokens_java_proto" ] - - import_dirs = [ "//third_party/anonymous_tokens/src/" ] - } -} diff --git a/src/net/third_party/uri_template/BUILD.gn b/src/net/third_party/uri_template/BUILD.gn index 0d5166e85a..2c2cc6f657 100644 --- a/src/net/third_party/uri_template/BUILD.gn +++ b/src/net/third_party/uri_template/BUILD.gn @@ -1,7 +1,6 @@ # 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/libfuzzer/fuzzer_test.gni") component("uri_template") { sources = [ @@ -9,30 +8,9 @@ component("uri_template") { "uri_template.h", ] visibility = [ - ":uri_template_tests", "//net:net_public_deps", "//net/third_party/quiche", ] defines = [ "IS_URI_TEMPLATE_IMPL" ] public_deps = [ "//base" ] } - -source_set("uri_template_tests") { - testonly = true - sources = [ "uri_template_test.cc" ] - deps = [ - ":uri_template", - "//testing/gmock", - "//testing/gtest", - ] -} - -fuzzer_test("net_uri_template_fuzzer") { - sources = [ "uri_template_fuzzer.cc" ] - deps = [ - "//base", - "//net", - "//net:net_fuzzer_test_support", - ] - dict = "//net/data/fuzzer_dictionaries/net_uri_template_fuzzer.dict" -} diff --git a/src/net/tools/huffman_trie/BUILD.gn b/src/net/tools/huffman_trie/BUILD.gn index 4e9331ab56..feb1553587 100644 --- a/src/net/tools/huffman_trie/BUILD.gn +++ b/src/net/tools/huffman_trie/BUILD.gn @@ -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", - ] -} diff --git a/src/net/tools/transport_security_state_generator/BUILD.gn b/src/net/tools/transport_security_state_generator/BUILD.gn index 6069a30232..1bf81bbe91 100644 --- a/src/net/tools/transport_security_state_generator/BUILD.gn +++ b/src/net/tools/transport_security_state_generator/BUILD.gn @@ -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 = [ diff --git a/src/third_party/brotli/BUILD.gn b/src/third_party/brotli/BUILD.gn index 0e986ea204..0aa74779e8 100644 --- a/src/third_party/brotli/BUILD.gn +++ b/src/third_party/brotli/BUILD.gn @@ -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") } @@ -210,9 +208,3 @@ if (current_toolchain == host_toolchain) { } } } - -fuzzer_test("brotli_fuzzer") { - sources = [ "fuzz/decode_fuzzer.c" ] - deps = [ ":dec" ] - libfuzzer_options = [ "max_len=1280" ] -} diff --git a/src/third_party/googletest/BUILD.gn b/src/third_party/googletest/BUILD.gn index 14089f0d15..b8458d6009 100644 --- a/src/third_party/googletest/BUILD.gn +++ b/src/third_party/googletest/BUILD.gn @@ -134,7 +134,6 @@ source_set("gtest") { # googletest only needs `absl`, but this makes gn check happier. deps = [ "//third_party/abseil-cpp:absl_full" ] - public_deps = [ "//third_party/re2" ] if (is_nacl || !build_with_chromium) { defines += [ "GTEST_DISABLE_PRINT_STACK_TRACE" ] sources -= [ diff --git a/src/url/BUILD.gn b/src/url/BUILD.gn index f22b73bc29..5ba1cc117c 100644 --- a/src/url/BUILD.gn +++ b/src/url/BUILD.gn @@ -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") import("//build/config/cronet/config.gni") @@ -118,280 +116,3 @@ component("url") { ] } } - -if (is_android || is_robolectric) { - generate_jni("url_jni_headers") { - sources = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ] - if (!is_cronet_build) { - sources += [ - "android/java/src/org/chromium/url/GURL.java", - "android/java/src/org/chromium/url/Origin.java", - "android/java/src/org/chromium/url/Parsed.java", - ] - } - } -} -if (is_android && current_toolchain == default_toolchain) { - # TODO(agrieve): Remove alias once usages are removed. - java_group("gurl_java") { - deps = [ ":url_java" ] - } - - android_library("url_java") { - sources = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ] - srcjar_deps = [ ":url_jni_headers" ] - deps = [ "//third_party/jni_zero:jni_zero_java" ] - if (!is_cronet_build) { - sources += [ - "android/java/src/org/chromium/url/GURL.java", - "android/java/src/org/chromium/url/Origin.java", - "android/java/src/org/chromium/url/Parsed.java", - "android/java/src/org/chromium/url/URI.java", - ] - deps += [ - "//base:base_java", - "//build/android:build_java", - "//mojo/public/java:bindings_java", - "//mojo/public/mojom/base:base_java", - "//third_party/android_deps:com_google_errorprone_error_prone_annotations_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//url/mojom:url_mojom_gurl_java", - "//url/mojom:url_mojom_origin_java", - ] - } - } -} - -source_set("url_test_support") { - testonly = true - - sources = [ - "gurl_abstract_tests.h", - "origin_abstract_tests.cc", - "origin_abstract_tests.h", - "url_canon_icu_test_helpers.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 && !is_cronet_build) { - 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" -} - -fuzzer_test("url_idna_icu_fuzzer") { - sources = [ "url_idna_icu_fuzzer.cc" ] - deps = [ - ":url", - "//third_party/icu:icuuc", - "//third_party/icu/fuzzers:fuzzer_support", - ] -} - -fuzzer_test("url_canon_icu_fuzzer") { - sources = [ "url_canon_icu_fuzzer.cc" ] - deps = [ - ":url", - ":url_test_support", - "//third_party/icu:icuuc", - ] -} - -if (is_android && !is_cronet_build) { - source_set("android_test_helper") { - testonly = true - sources = [ - "android/gurl_java_test_helper.cc", - "android/origin_java_test_helper.cc", - ] - deps = [ - ":j_test_jni_headers($default_toolchain)", - ":url", - "//base/test:test_support", - ] - } - - if (current_toolchain == default_toolchain) { - android_library("android_test_helper_java") { - testonly = true - - srcjar_deps = [ ":j_test_jni_headers" ] - sources = [ - "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java", - "android/javatests/src/org/chromium/url/OriginJavaTestHelper.java", - ] - deps = [ - ":url_java", - "//base:base_java_test_support", - "//third_party/jni_zero:jni_zero_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 = [ ":url_java" ] - } - - android_library("url_java_unit_tests") { - testonly = true - sources = [ - "android/javatests/src/org/chromium/url/GURLJavaTest.java", - "android/javatests/src/org/chromium/url/OriginJavaTest.java", - ] - deps = [ - ":android_test_helper_java", - ":gurl_junit_test_support", - ":url_java", - "//base:base_java", - "//base:base_java_test_support", - "//build/android:build_java", - "//content/public/test/android:content_java_test_support", - "//mojo/public/mojom/base:base_java", - "//third_party/androidx:androidx_core_core_java", - "//third_party/androidx:androidx_test_runner_java", - "//third_party/jni_zero:jni_zero_java", - "//third_party/junit", - "//third_party/mockito:mockito_java", - "//url/mojom:url_mojom_gurl_java", - "//url/mojom:url_mojom_origin_java", - ] - } - - # See https://bugs.chromium.org/p/chromium/issues/detail?id=908819 for why we - # can't put 'java' in the name here. - generate_jni("j_test_jni_headers") { - testonly = true - sources = [ - "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java", - "android/javatests/src/org/chromium/url/OriginJavaTestHelper.java", - ] - } - } -} - -# Use this in robolectric_binary() targets if you just need GURL and //base -# functionality. Otherwise, define a custom shared_library(). -if (!is_cronet_build && target_os == "android") { - shared_library_with_jni("libgurl_robolectric") { - testonly = true - enable_target = is_robolectric - java_targets = [ - ":gurl_java", - ":url_java", - ] - deps = [ ":robolectric_jni_onload($robolectric_toolchain)" ] - } - if (is_robolectric) { - # Depend on this if you need to write a custom JNI_OnLoad() - source_set("gurl_test_init") { - testonly = true - sources = [ - "android/gurl_test_init.cc", - "android/gurl_test_init.h", - ] - deps = [ ":url" ] - } - - # Depend on this if you do not need to write a custom JNI_OnLoad() - source_set("robolectric_jni_onload") { - testonly = true - sources = [ "android/robolectric_jni_onload.cc" ] - deps = [ - ":gurl_test_init", - "//base", - ] - - # Make jni.h available. - configs += [ "//third_party/jdk" ] - } - } -}