blob: 4e7fe7d92a90837a9de50fb2938a8045dc91eef9 [file] [log] [blame]
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("//third_party/blink/renderer/build/scripts/scripts.gni")
blink_python_runner("make_generated_permissions_policy_features") {
script = "../renderer/build/scripts/make_permissions_policy_features.py"
inputs = scripts_for_json5_files + [
"../renderer/build/scripts/make_permissions_policy_features.py",
"../renderer/core/permissions_policy/permissions_policy_features.json5",
"../renderer/build/scripts/templates/permissions_policy_features.cc.tmpl",
]
outputs = [ "$root_gen_dir/third_party/blink/common/permissions_policy/permissions_policy_features.cc" ]
args = [
rebase_path(
"../renderer/core/permissions_policy/permissions_policy_features.json5",
root_build_dir),
"--output_dir",
rebase_path("$root_gen_dir/third_party/blink/common/permissions_policy",
root_build_dir),
]
}
blink_python_runner("make_generated_document_policy_features") {
script = "../renderer/build/scripts/make_document_policy_features.py"
inputs =
scripts_for_json5_files + [
"../renderer/build/scripts/make_document_policy_features.py",
"../renderer/build/scripts/make_document_policy_features_util.py",
"../renderer/core/permissions_policy/document_policy_features.json5",
"../renderer/build/scripts/templates/document_policy_features.cc.tmpl",
]
outputs = [ "$root_gen_dir/third_party/blink/common/permissions_policy/document_policy_features.cc" ]
args = [
rebase_path(
"../renderer/core/permissions_policy/document_policy_features.json5",
root_build_dir),
"--output_dir",
rebase_path("$root_gen_dir/third_party/blink/common/permissions_policy",
root_build_dir),
]
}
config("blink_common_implementation") {
defines = [ "BLINK_COMMON_IMPLEMENTATION=1" ]
}
source_set("common") {
# No target should directly depend on this target since this is just the
# source set rather than the actual component that can be linked to.
# Dependencies instead should be to //third_party/blink/public/common:common.
visibility = [
":*",
"//third_party/blink/public:all_blink",
"//third_party/blink/public/common",
]
configs += [
":blink_common_implementation",
"//build/config/compiler:noshadowing",
]
sources = [
# NOTE: Please do not add public headers that need to be referenced from
# outside WebKit, add them in public/common instead.
"associated_interfaces/associated_interface_provider.cc",
"associated_interfaces/associated_interface_registry.cc",
"blob/blob_utils.cc",
"bluetooth/web_bluetooth_device_id.cc",
"browser_interface_broker_proxy.cc",
"cache_storage/cache_storage_utils.cc",
"chrome_debug_urls.cc",
"client_hints/client_hints.cc",
"context_menu_data/context_menu_mojom_traits.cc",
"context_menu_data/context_menu_params_builder.cc",
"context_menu_data/untrustworthy_context_menu_params.cc",
"crash_helpers.cc",
"crash_helpers.h",
"custom_handlers/protocol_handler_utils.cc",
"device_memory/approximated_device_memory.cc",
"dom_storage/session_storage_namespace_id.cc",
"features.cc",
"fetch/fetch_api_request_body_mojom_traits.cc",
"frame/frame_ad_evidence.cc",
"frame/frame_ad_evidence_mojom_traits.cc",
"frame/frame_policy.cc",
"frame/frame_policy_mojom_traits.cc",
"frame/frame_visual_properties.cc",
"frame/frame_visual_properties_mojom_traits.cc",
"frame/from_ad_state.cc",
"frame/payment_request_token.cc",
"frame/transient_allow_fullscreen.cc",
"frame/user_activation_state.cc",
"indexeddb/indexed_db_default_mojom_traits.cc",
"indexeddb/indexeddb_key.cc",
"indexeddb/indexeddb_key_path.cc",
"indexeddb/indexeddb_key_range.cc",
"indexeddb/indexeddb_metadata.cc",
"input/synthetic_web_input_event_builders.cc",
"input/web_coalesced_input_event.cc",
"input/web_coalesced_input_event_mojom_traits.cc",
"input/web_gesture_event.cc",
"input/web_input_event.cc",
"input/web_keyboard_event.cc",
"input/web_mouse_event.cc",
"input/web_mouse_wheel_event.cc",
"input/web_pointer_event.cc",
"input/web_touch_event.cc",
"loader/inter_process_time_ticks_converter.cc",
"loader/loader_constants.cc",
"loader/mime_sniffing_throttle.cc",
"loader/mime_sniffing_url_loader.cc",
"loader/network_utils.cc",
"loader/record_load_histograms.cc",
"loader/referrer_utils.cc",
"loader/resource_type_util.cc",
"loader/throttling_url_loader.cc",
"loader/url_loader_factory_bundle.cc",
"loader/url_loader_factory_bundle_mojom_traits.cc",
"loader/url_loader_throttle.cc",
"logging/logging_utils.cc",
"manifest/manifest.cc",
"manifest/manifest_icon_selector.cc",
"manifest/manifest_util.cc",
"media/watch_time_component.cc",
"media/watch_time_reporter.cc",
"mediastream/media_devices.cc",
"mediastream/media_devices_mojom_traits.cc",
"mediastream/media_stream_controls.cc",
"mediastream/media_stream_mojom_traits.cc",
"mediastream/media_stream_request.cc",
"messaging/cloneable_message.cc",
"messaging/cloneable_message_mojom_traits.cc",
"messaging/message_port_channel.cc",
"messaging/message_port_descriptor.cc",
"messaging/message_port_descriptor_mojom_traits.cc",
"messaging/string_message_codec.cc",
"messaging/transferable_message.cc",
"messaging/transferable_message_mojom_traits.cc",
"messaging/web_message_port.cc",
"mime_util/mime_util.cc",
"mobile_metrics/mobile_friendliness.cc",
"native_io/native_io_utils.cc",
"navigation/impression.cc",
"navigation/impression_mojom_traits.cc",
"navigation/navigation_policy.cc",
"navigation/navigation_policy_mojom_traits.cc",
"net/ip_address_space_util.cc",
"notifications/notification_mojom_traits.cc",
"notifications/notification_resources.cc",
"notifications/platform_notification_data.cc",
"origin_trials/trial_token.cc",
"origin_trials/trial_token_result.cc",
"origin_trials/trial_token_validator.cc",
"page/content_to_visible_time_reporter.cc",
"page/drag_mojom_traits.cc",
"page/drag_operation.cc",
"page/page_zoom.cc",
"page_state/page_state.cc",
"page_state/page_state_serialization.cc",
"peerconnection/webrtc_ip_handling_policy.cc",
"permissions/permission_utils.cc",
"permissions_policy/document_policy.cc",
"permissions_policy/permissions_policy.cc",
"permissions_policy/permissions_policy_mojom_traits.cc",
"permissions_policy/policy_value.cc",
"renderer_preferences/renderer_preferences.cc",
"renderer_preferences/renderer_preferences_mojom_traits.cc",
"scheduler/web_scheduler_tracked_feature.cc",
"service_worker/service_worker_loader_helpers.cc",
"service_worker/service_worker_scope_match.cc",
"service_worker/service_worker_status_code.cc",
"service_worker/service_worker_type_converters.cc",
"storage_key/storage_key.cc",
"storage_key/storage_key_mojom_traits.cc",
"switches.cc",
"thread_safe_browser_interface_broker_proxy.cc",
"unique_name/unique_name_helper.cc",
"use_counter/use_counter_feature.cc",
"use_counter/use_counter_feature_tracker.cc",
"user_agent/user_agent_metadata.cc",
"web_package/signed_exchange_consts.cc",
"web_package/web_package_request_matcher.cc",
"web_preferences/web_preferences.cc",
"web_preferences/web_preferences_mojom_traits.cc",
"widget/device_emulation_params_mojom_traits.cc",
"widget/screen_info.cc",
"widget/screen_info_mojom_traits.cc",
"widget/screen_infos.cc",
"widget/screen_infos_mojom_traits.cc",
"widget/visual_properties.cc",
"widget/visual_properties_mojom_traits.cc",
]
sources += get_target_outputs(":make_generated_document_policy_features")
sources += get_target_outputs(":make_generated_permissions_policy_features")
public_deps = [
":make_generated_document_policy_features",
":make_generated_permissions_policy_features",
"//third_party/blink/common/privacy_budget:privacy_budget",
"//third_party/blink/public/common:common_export",
"//third_party/blink/public/common:headers",
]
deps = [
"//base",
"//build:chromeos_buildflags",
"//media/capture:capture_base",
"//media/capture/mojom:video_capture_mojom_support",
"//mojo/public/cpp/system",
"//net",
"//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/cpp:ukm_builders",
"//services/metrics/public/mojom:mojom",
"//services/network/public/cpp:cpp",
"//third_party/blink/public/common:buildflags",
"//third_party/blink/public/mojom:mobile_metrics_shared",
"//ui/base:base",
"//ui/base/dragdrop/mojom:mojom_shared",
"//ui/display",
"//ui/events:events_base",
"//ui/latency/mojom:shared_mojom_traits",
]
# iOS doesn't use and must not depend on //media
if (!is_ios) {
deps += [ "//media" ]
}
if (is_android || is_win) {
sources += [
"font_unique_name_lookup/font_table_matcher.cc",
"font_unique_name_lookup/font_table_persistence.cc",
"font_unique_name_lookup/icu_fold_case_util.cc",
]
deps += [ "//third_party/icu" ]
}
if (is_win) {
sources += [ "dwrite_rasterizer_support/dwrite_rasterizer_support.cc" ]
deps += [ "//ui/gfx/" ]
}
}
test("blink_common_unittests") {
visibility = [ "*" ]
deps = [
":common_unittests_sources",
"//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/cpp:ukm_builders",
"//services/metrics/public/mojom:mojom",
"//third_party/blink/common/privacy_budget:unit_tests",
"//third_party/blink/public/common",
"//ui/gfx:test_support",
]
if (is_android) {
deps += [
"//base:base_java",
"//media/base/android:media_java",
]
}
if (is_fuchsia) {
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
]
}
data_deps = [ ":common_unittests_data" ]
}
source_set("common_unittests_sources") {
testonly = true
sources = [
"bluetooth/web_bluetooth_device_id_unittest.cc",
"client_hints/client_hints_unittest.cc",
"device_memory/approximated_device_memory_unittest.cc",
"frame/transient_allow_fullscreen_unittest.cc",
"frame/user_activation_state_unittest.cc",
"indexeddb/indexeddb_key_unittest.cc",
"input/synthetic_web_input_event_builders_unittest.cc",
"input/web_input_event_unittest.cc",
"loader/inter_process_time_ticks_converter_unittest.cc",
"loader/mime_sniffing_throttle_unittest.cc",
"loader/referrer_utils_unittest.cc",
"loader/throttling_url_loader_unittest.cc",
"manifest/manifest_icon_selector_unittest.cc",
"manifest/manifest_util_unittest.cc",
"media/watch_time_component_unittest.cc",
"mediastream/media_devices_unittest.cc",
"messaging/message_port_descriptor_unittest.cc",
"mime_util/mime_util_unittest.cc",
"net/ip_address_space_util_unittest.cc",
"notifications/notification_mojom_traits_unittest.cc",
"origin_trials/trial_token_unittest.cc",
"origin_trials/trial_token_validator_unittest.cc",
"page/content_to_visible_time_reporter_unittest.cc",
"page_state/page_state_serialization_unittest.cc",
"permissions_policy/document_policy_unittest.cc",
"permissions_policy/permissions_policy_unittest.cc",
"permissions_policy/policy_value_unittest.cc",
"scheduler/web_scheduler_tracked_feature_unittest.cc",
"service_worker/service_worker_scope_match_unittest.cc",
"storage_key/storage_key_mojom_traits_unittest.cc",
"storage_key/storage_key_unittest.cc",
"test/run_all_unittests.cc",
"tokens/multi_token_unittest.cc",
"tokens/tokens_mojom_traits_unittest.cc",
"unique_name/unique_name_helper_unittest.cc",
"user_agent/user_agent_metadata_unittest.cc",
"web_package/web_package_request_matcher_unittest.cc",
"widget/screen_infos_mojom_traits_unittest.cc",
]
deps = [
"//base",
"//base/test:test_support",
"//media/capture:capture_base",
"//mojo/core/embedder",
"//mojo/public/cpp/test_support:test_utils",
"//net",
"//net:test_support",
"//services/device:test_support",
"//services/network:test_support",
"//services/viz/public/mojom",
"//skia/public/mojom",
"//testing/gmock",
"//testing/gtest",
"//third_party/blink/public/common:buildflags",
"//third_party/blink/public/common:headers",
"//third_party/blink/public/mojom/frame:frame_blink_headers",
"//third_party/blink/public/mojom/tokens:tokens_traits_headers",
"//third_party/boringssl",
"//url/mojom:url_mojom_gurl",
"//v8",
"//v8:v8_libplatform",
]
if (!is_android) {
# TODO(crbug.com/845384): Enable these tests also on Android. Currently
# they are excluded as they require V8 environment but V8 snapshot is
# not available in the current minimum test setting.
sources += [
"messaging/string_message_codec_unittest.cc",
"messaging/web_message_port_unittest.cc",
]
}
if (is_android || is_win) {
sources += [
"font_unique_name_lookup/font_table_matcher_unittest.cc",
"font_unique_name_lookup/icu_fold_case_util_unittest.cc",
]
}
}
group("common_unittests_data") {
data = [ "page_state/test_data/" ]
}