blob: 1af4168005fd3c640e189388ef56dddcef6093f8 [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_feature_policy_features") {
script = "../renderer/build/scripts/make_feature_policy_features.py"
inputs =
scripts_for_json5_files + [
"../renderer/build/scripts/make_feature_policy_features.py",
"../renderer/core/feature_policy/feature_policy_features.json5",
"../renderer/build/scripts/templates/feature_policy_features.cc.tmpl",
]
outputs = [ "$root_gen_dir/third_party/blink/common/feature_policy/feature_policy_features.cc" ]
args = [
rebase_path("../renderer/core/feature_policy/feature_policy_features.json5",
root_build_dir),
"--output_dir",
rebase_path("$root_gen_dir/third_party/blink/common/feature_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/feature_policy/document_policy_features.json5",
"../renderer/build/scripts/templates/document_policy_features.cc.tmpl",
]
outputs = [ "$root_gen_dir/third_party/blink/common/feature_policy/document_policy_features.cc" ]
args = [
rebase_path(
"../renderer/core/feature_policy/document_policy_features.json5",
root_build_dir),
"--output_dir",
rebase_path("$root_gen_dir/third_party/blink/common/feature_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/common",
"//third_party/blink/public:all_blink",
]
configs += [ ":blink_common_implementation" ]
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",
"bluetooth/web_bluetooth_device_id.h",
"bluetooth/web_bluetooth_device_id_mojom_traits.h",
"browser_interface_broker_proxy.cc",
"cache_storage/cache_storage_utils.cc",
"client_hints/client_hints.cc",
"custom_handlers/protocol_handler_utils.cc",
"device_memory/approximated_device_memory.cc",
"dom_storage/session_storage_namespace_id.cc",
"experiments/memory_ablation_experiment.cc",
"feature_policy/document_policy.cc",
"feature_policy/feature_policy.cc",
"feature_policy/feature_policy_mojom_traits.cc",
"feature_policy/policy_value.cc",
"features.cc",
"fetch/fetch_api_request_body_mojom_traits.cc",
"frame/frame_policy.cc",
"frame/frame_policy_mojom_traits.cc",
"frame/frame_visual_properties.cc",
"frame/from_ad_state.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/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",
"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",
"notifications/notification_mojom_traits.cc",
"notifications/notification_resources.cc",
"notifications/platform_notification_data.cc",
"origin_trials/trial_token.cc",
"origin_trials/trial_token_validator.cc",
"page/drag_mojom_traits.cc",
"page/page_zoom.cc",
"peerconnection/peer_connection_tracker_mojom_traits.cc",
"peerconnection/webrtc_ip_handling_policy.cc",
"permissions/permission_utils.cc",
"scheduler/web_scheduler_tracked_feature.cc",
"service_worker/service_worker_status_code.cc",
"service_worker/service_worker_type_converters.cc",
"service_worker/service_worker_utils.cc",
"switches.cc",
"thread_safe_browser_interface_broker_proxy.cc",
"tokens/tokens_mojom_traits.cc",
"user_agent/user_agent_metadata.cc",
"web_package/signed_exchange_consts.cc",
"web_package/web_package_request_matcher.cc",
"widget/device_emulation_params_mojom_traits.cc",
"widget/screen_info_mojom_traits.cc",
"widget/visual_properties_mojom_traits.cc",
]
sources += get_target_outputs(":make_generated_document_policy_features")
sources += get_target_outputs(":make_generated_feature_policy_features")
public_deps = [
":make_generated_document_policy_features",
":make_generated_feature_policy_features",
"//third_party/blink/common/privacy_budget:privacy_budget",
"//third_party/blink/public/common:headers",
]
deps = [
"//base",
"//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",
"//ui/events:events_base",
]
# 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",
]
}
}
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",
"feature_policy/document_policy_unittest.cc",
"feature_policy/feature_policy_unittest.cc",
"feature_policy/policy_value_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/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",
"mediastream/media_devices_unittest.cc",
"messaging/message_port_descriptor_unittest.cc",
"mime_util/mime_util_unittest.cc",
"notifications/notification_mojom_traits_unittest.cc",
"origin_trials/trial_token_unittest.cc",
"origin_trials/trial_token_validator_unittest.cc",
"test/run_all_unittests.cc",
"tokens/multi_token_unittest.cc",
"tokens/tokens_mojom_traits_unittest.cc",
"user_agent/user_agent_metadata_unittest.cc",
"web_package/web_package_request_matcher_unittest.cc",
]
deps = [
"//base",
"//base/test:test_support",
"//mojo/core/embedder",
"//net",
"//services/device:test_support",
"//services/network:test_support",
"//skia/public/mojom",
"//testing/gmock",
"//testing/gtest",
"//third_party/blink/public/common:headers",
"//third_party/blink/public/mojom/frame:frame_blink_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",
]
}
}