blob: 45f66622729b84cdc7ec6a2e03905c8ca5ff3ad1 [file] [log] [blame]
# Copyright 2014 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("//build/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/ui.gni")
import("//build/toolchain/toolchain.gni")
import("//media/media_options.gni")
import("//printing/buildflags/buildflags.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/blink/renderer/bindings/bindings.gni")
import("//third_party/blink/renderer/bindings/scripts/scripts.gni")
import("//third_party/blink/renderer/build/scripts/scripts.gni")
import("//third_party/blink/renderer/config.gni")
import("//third_party/blink/renderer/core/accessibility/build.gni")
import("//third_party/blink/renderer/core/animation/build.gni")
import("//third_party/blink/renderer/core/animation_frame/build.gni")
import("//third_party/blink/renderer/core/aom/build.gni")
import("//third_party/blink/renderer/core/app_history/build.gni")
import("//third_party/blink/renderer/core/clipboard/build.gni")
import("//third_party/blink/renderer/core/content_capture/build.gni")
import("//third_party/blink/renderer/core/context_features/build.gni")
import("//third_party/blink/renderer/core/core.gni")
import("//third_party/blink/renderer/core/css/build.gni")
import("//third_party/blink/renderer/core/display_lock/build.gni")
import("//third_party/blink/renderer/core/document_transition/build.gni")
import("//third_party/blink/renderer/core/dom/build.gni")
import("//third_party/blink/renderer/core/editing/build.gni")
import("//third_party/blink/renderer/core/events/build.gni")
import("//third_party/blink/renderer/core/execution_context/build.gni")
import("//third_party/blink/renderer/core/fetch/build.gni")
import("//third_party/blink/renderer/core/fileapi/build.gni")
import("//third_party/blink/renderer/core/fragment_directive/build.gni")
import("//third_party/blink/renderer/core/frame/build.gni")
import("//third_party/blink/renderer/core/fullscreen/build.gni")
import("//third_party/blink/renderer/core/geometry/build.gni")
import("//third_party/blink/renderer/core/highlight/build.gni")
import("//third_party/blink/renderer/core/html/build.gni")
import("//third_party/blink/renderer/core/imagebitmap/build.gni")
import("//third_party/blink/renderer/core/input/build.gni")
import("//third_party/blink/renderer/core/inspector/build.gni")
import("//third_party/blink/renderer/core/intersection_observer/build.gni")
import("//third_party/blink/renderer/core/layout/build.gni")
import("//third_party/blink/renderer/core/loader/build.gni")
import("//third_party/blink/renderer/core/mathml/build.gni")
import("//third_party/blink/renderer/core/messaging/build.gni")
import("//third_party/blink/renderer/core/mobile_metrics/build.gni")
import("//third_party/blink/renderer/core/mojo/build.gni")
import("//third_party/blink/renderer/core/offscreencanvas/build.gni")
import("//third_party/blink/renderer/core/origin_trials/build.gni")
import("//third_party/blink/renderer/core/page/build.gni")
import("//third_party/blink/renderer/core/paint/build.gni")
import("//third_party/blink/renderer/core/peerconnection/build.gni")
import("//third_party/blink/renderer/core/permissions_policy/build.gni")
import("//third_party/blink/renderer/core/resize_observer/build.gni")
import("//third_party/blink/renderer/core/script/build.gni")
import("//third_party/blink/renderer/core/scroll/build.gni")
import("//third_party/blink/renderer/core/speculation_rules/build.gni")
import("//third_party/blink/renderer/core/streams/build.gni")
import("//third_party/blink/renderer/core/style/build.gni")
import("//third_party/blink/renderer/core/svg/build.gni")
import("//third_party/blink/renderer/core/timezone/build.gni")
import("//third_party/blink/renderer/core/timing/build.gni")
import("//third_party/blink/renderer/core/trustedtypes/build.gni")
import("//third_party/blink/renderer/core/typed_arrays/build.gni")
import("//third_party/blink/renderer/core/url/build.gni")
import("//third_party/blink/renderer/core/workers/build.gni")
import("//third_party/blink/renderer/core/xml/build.gni")
import("//third_party/blink/renderer/core/xmlhttprequest/build.gni")
import("//third_party/blink/renderer/platform/platform_generated.gni")
import("//third_party/protobuf/proto_library.gni")
visibility = [
"//third_party/blink/public/*",
"//third_party/blink/renderer/*",
]
rel_blink_core_gen_dir = rebase_path(blink_core_output_dir, root_build_dir)
# arguments for code that builds as part of core.
declare_args() {
# Set to true to enable the clang layout plugin that help you to follow the
# layout-related restrictions during compilation.
use_layout_plugin = true
}
# Config for code that builds as part of core.
config("config") {
cflags = []
defines = [ "BLINK_CORE_IMPLEMENTATION=1" ]
if (is_clang && clang_use_chrome_plugins) {
if (use_layout_plugin) {
cflags += [
"-Xclang",
"-plugin-arg-find-bad-constructs",
"-Xclang",
"check-layout-object-methods",
]
}
}
}
config("core_include_dirs") {
include_dirs = []
}
import("//build/config/pch.gni")
config("blink_core_pch") {
# Add precompiled header (pch) support when enabled, possible and
# making sense.
if (enable_precompiled_headers) {
if (is_win) {
# This is a string rather than a file GN knows about. It has to match
# exactly what's in the /FI flag below, and what might appear in the
# source code in quotes for an #include directive.
precompiled_header = rebase_path("precompile_core.h", root_build_dir)
# This is a file that GN will compile with the above header. It will be
# implicitly added to the sources (potentially multiple times, with one
# variant for each language used in the target).
precompiled_source =
"//third_party/blink/renderer/core/win/precompile_core.cc"
# Force include the header.
cflags = [ "/FI$precompiled_header" ]
} else if (is_mac || is_linux) {
precompiled_source = "//third_party/blink/renderer/core/precompile_core.h"
}
}
}
core_config_add += [ ":blink_core_pch" ]
source_set("core_common") {
sources = [ "core_export.h" ]
}
source_set("prerequisites") {
public_deps = [
"//services/network/public/cpp:cpp",
"//services/network/public/mojom",
"//services/service_manager/public/cpp",
"//skia",
"//third_party/blink/public/mojom:color_scheme_mojo_bindings",
"//third_party/blink/public/mojom:mojom_broadcastchannel_bindings_blink",
"//third_party/blink/renderer/bindings/core/v8:generated",
"//third_party/blink/renderer/core/animation:buildflags",
"//third_party/blink/renderer/core/inspector:generated",
"//third_party/blink/renderer/core/probe:generated",
"//third_party/blink/renderer/platform",
"//third_party/iccjpeg",
"//third_party/icu",
"//third_party/libpng",
"//third_party/libwebp",
"//third_party/libxml",
"//third_party/libxslt",
"//third_party/ots",
"//third_party/snappy",
"//third_party/zlib",
"//ui/accessibility/mojom:mojom_blink",
"//ui/base:features",
"//ui/base/ime/mojom",
"//ui/display/mojom:mojom_blink",
"//ui/events:dom_keycode_converter",
"//ui/gfx/geometry",
"//ui/latency",
"//ui/native_theme",
"//url",
"//v8",
]
deps = [ "//third_party/blink/public:scaled_resources" ]
public_configs = [
":core_include_dirs",
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
]
}
component("core") {
output_name = "blink_core"
visibility = [] # Allow re-assignment of list.
visibility = [ "//third_party/blink/*" ]
sources = [
"core_initializer.cc",
"core_initializer.h",
]
sources += blink_core_sources_bindings
# If you create a new subdirectory 'foo', make 'foo/build.gni' to define
# blink_core_sources_foo, and include it here. Add any dependencies in the
# deps section below. For unit tests, do the same thing in the "unit_tests"
# component. If the directory contains sources that should be compiled with
# extra optimization flags, see the "core_hot" target below.
sources += rebase_path(blink_core_sources_accessibility, "", "accessibility")
sources +=
rebase_path(blink_core_sources_animation_frame, "", "animation_frame")
sources += rebase_path(blink_core_sources_aom, "", "aom")
sources += rebase_path(blink_core_sources_app_history, "", "app_history")
sources += rebase_path(blink_core_sources_clipboard, "", "clipboard")
sources +=
rebase_path(blink_core_sources_content_capture, "", "content_capture")
sources +=
rebase_path(blink_core_sources_context_features, "", "context_features")
sources += rebase_path(blink_core_sources_css, "", "css")
sources += rebase_path(blink_core_sources_display_lock, "", "display_lock")
sources += rebase_path(blink_core_sources_document_transition,
"",
"document_transition")
sources += rebase_path(blink_core_sources_dom, "", "dom")
sources += rebase_path(blink_core_sources_editing, "", "editing")
sources += rebase_path(blink_core_sources_events, "", "events")
sources +=
rebase_path(blink_core_sources_execution_context, "", "execution_context")
sources += rebase_path(blink_core_sources_permissions_policy,
"",
"permissions_policy")
sources += rebase_path(blink_core_sources_fetch, "", "fetch")
sources += rebase_path(blink_core_sources_fileapi, "", "fileapi")
sources += rebase_path(blink_core_sources_fragment_directive,
"",
"fragment_directive")
sources += rebase_path(blink_core_sources_frame, "", "frame")
sources += rebase_path(blink_core_sources_fullscreen, "", "fullscreen")
sources += rebase_path(blink_core_sources_geometry, "", "geometry")
sources += rebase_path(blink_core_sources_highlight, "", "highlight")
sources += rebase_path(blink_core_sources_html, "", "html")
sources += rebase_path(blink_core_sources_imagebitmap, "", "imagebitmap")
sources += rebase_path(blink_core_sources_input, "", "input")
sources += rebase_path(blink_core_sources_inspector, "", "inspector")
sources += rebase_path(blink_core_sources_intersection_observer,
"",
"intersection_observer")
sources += rebase_path(blink_core_sources_layout, "", "layout")
sources += rebase_path(blink_core_sources_loader, "", "loader")
sources += rebase_path(blink_core_sources_mathml, "", "mathml")
sources += rebase_path(blink_core_sources_messaging, "", "messaging")
sources +=
rebase_path(blink_core_sources_mobile_metrics, "", "mobile_metrics")
sources += rebase_path(blink_core_sources_mojo, "", "mojo")
sources +=
rebase_path(blink_core_sources_offscreencanvas, "", "offscreencanvas")
sources += rebase_path(blink_core_sources_origin_trials, "", "origin_trials")
sources += rebase_path(blink_core_sources_page, "", "page")
sources += rebase_path(blink_core_sources_paint, "", "paint")
sources +=
rebase_path(blink_core_sources_peerconnection, "", "peerconnection")
sources +=
rebase_path(blink_core_sources_resize_observer, "", "resize_observer")
sources +=
rebase_path(blink_core_sources_speculation_rules, "", "speculation_rules")
sources += rebase_path(blink_core_sources_script, "", "script")
sources += rebase_path(blink_core_sources_scroll, "", "scroll")
sources += rebase_path(blink_core_sources_streams, "", "streams")
sources += rebase_path(blink_core_sources_style, "", "style")
sources += rebase_path(blink_core_sources_svg, "", "svg")
sources += rebase_path(blink_core_sources_timezone, "", "timezone")
sources += rebase_path(blink_core_sources_timing, "", "timing")
sources += rebase_path(blink_core_sources_trustedtypes, "", "trustedtypes")
sources += rebase_path(blink_core_sources_typed_arrays, "", "typed_arrays")
sources += rebase_path(blink_core_sources_url, "", "url")
sources += rebase_path(blink_core_sources_workers, "", "workers")
sources += rebase_path(blink_core_sources_xml, "", "xml")
sources +=
rebase_path(blink_core_sources_xmlhttprequest, "", "xmlhttprequest")
configs -= core_config_remove
configs += core_config_add
configs += [
"//tools/v8_context_snapshot:use_v8_context_snapshot",
"//v8:external_startup_data",
]
public_deps = [
":core_generated",
":core_hot",
"//cc",
"//skia",
"//third_party/blink/public/mojom:mobile_metrics_blink",
"//third_party/blink/public/mojom:mojom_broadcastchannel_bindings_blink",
"//third_party/blink/public/mojom:mojom_core_blink",
"//third_party/blink/renderer/bindings/core/v8",
"//third_party/blink/renderer/core/animation",
"//third_party/blink/renderer/core/exported",
"//third_party/blink/renderer/core/probe",
"//third_party/blink/renderer/core/xml:xpath_generated",
"//third_party/blink/renderer/platform",
"//third_party/blink/renderer/platform/wtf",
"//ui/accessibility:ax_base",
"//ui/base/cursor",
"//ui/base/dragdrop/mojom:mojom_blink_headers",
"//ui/base/dragdrop/mojom:mojom_shared",
"//url",
"//v8",
]
deps = [
":generated_settings_macros",
"//build:chromeos_buildflags",
"//components/paint_preview/common",
"//components/performance_manager/public/mojom:mojom_blink",
"//components/power_scheduler",
"//components/shared_highlighting/core/common",
"//gin",
"//gpu/config",
"//mojo/public/cpp/bindings:bindings",
"//mojo/public/cpp/system",
"//printing/buildflags",
"//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/cpp:ukm_builders",
"//services/metrics/public/mojom",
"//services/service_manager/public/cpp",
"//skia",
"//skia:skcms",
"//storage/common",
"//third_party/blink/public:buildflags",
"//third_party/blink/public:image_resources_grit",
"//third_party/blink/public:resources",
"//third_party/blink/public/common",
"//third_party/blink/public/mojom:web_feature_mojo_bindings",
"//third_party/blink/public/strings",
"//ui/base/cursor/mojom:cursor_type_blink",
"//ui/base/dragdrop/mojom:mojom_blink",
"//ui/gfx/geometry",
"//ui/gfx/geometry:geometry_skia",
]
if (is_mac) {
deps += [ "//ui/base/mojom" ]
}
if (enable_basic_printing) {
deps += [ "//printing:metafile" ]
}
allow_circular_includes_from = [
":core_generated",
":core_hot",
"//third_party/blink/renderer/core/animation",
"//third_party/blink/renderer/core/exported",
"//third_party/blink/renderer/core/probe",
"//third_party/blink/renderer/core/xml:xpath_generated",
]
public_configs = [ ":core_include_dirs" ]
if (is_mac) {
frameworks = [
"AppKit.framework",
"Carbon.framework",
]
}
}
# Certain sources should be compiled with heavy optimization enabled.
# Define them in 'foo/build.gni' as blink_core_hot_sources_foo, and include it
# here.
blink_core_sources("core_hot") {
sources = []
sources += rebase_path(blink_core_hot_sources_dom, "", "dom")
sources += rebase_path(blink_core_hot_sources_html, "", "html")
# TODO(ajwong) this is of mirror
# https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/core.gni;l=26
# to undo the configs which is fragile. Find a better way.
if (!is_debug && optimize_for_size) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
deps = [
"//services/metrics/public/cpp:ukm_builders",
"//third_party/blink/renderer/core/probe:probe",
]
}
source_set("testing") {
testonly = true
configs += [
":blink_core_pch",
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
]
deps = [
":core",
":generated_testing_idls",
"//build:chromeos_buildflags",
"//components/ukm:test_support",
"//third_party/blink/renderer/bindings/core/v8:testing",
"//third_party/blink/renderer/platform:test_support",
"//ui/base/cursor",
"//ui/base/cursor/mojom:cursor_type_blink",
]
sources = [
"$blink_core_output_dir/testing/internal_settings_generated.cc",
"$blink_core_output_dir/testing/internal_settings_generated.h",
"dom/testing/internals_storage_access.cc",
"dom/testing/internals_storage_access.h",
"fetch/testing/internals_fetch.cc",
"fetch/testing/internals_fetch.h",
"fetch/testing/worker_internals_fetch.cc",
"fetch/testing/worker_internals_fetch.h",
"html/forms/mock_file_chooser.h",
"streams/test_underlying_source.h",
"testing/callback_function_test.cc",
"testing/callback_function_test.h",
"testing/color_scheme_helper.cc",
"testing/color_scheme_helper.h",
"testing/death_aware_script_wrappable.cc",
"testing/death_aware_script_wrappable.h",
"testing/dictionary_test.cc",
"testing/dictionary_test.h",
"testing/dummy_modulator.cc",
"testing/dummy_modulator.h",
"testing/dummy_page_holder.cc",
"testing/dummy_page_holder.h",
"testing/fake_local_frame_host.cc",
"testing/fake_local_frame_host.h",
"testing/fake_remote_frame_host.cc",
"testing/fake_remote_frame_host.h",
"testing/fake_remote_main_frame_host.cc",
"testing/fake_remote_main_frame_host.h",
"testing/garbage_collected_script_wrappable.cc",
"testing/garbage_collected_script_wrappable.h",
"testing/gc_object_liveness_observer.h",
"testing/gc_observation.cc",
"testing/gc_observation.h",
"testing/hit_test_layer_rect.h",
"testing/hit_test_layer_rect_list.cc",
"testing/hit_test_layer_rect_list.h",
"testing/internal_settings.cc",
"testing/internal_settings.h",
"testing/internals.cc",
"testing/internals.h",
"testing/internals_delete_all_cookies.cc",
"testing/internals_delete_all_cookies.h",
"testing/intersection_observer_test_helper.h",
"testing/mock_clipboard_host.cc",
"testing/mock_clipboard_host.h",
"testing/mock_function_scope.cc",
"testing/mock_function_scope.h",
"testing/mock_hyphenation.cc",
"testing/mock_hyphenation.h",
"testing/mock_policy_container_host.cc",
"testing/mock_policy_container_host.h",
"testing/null_execution_context.cc",
"testing/null_execution_context.h",
"testing/origin_trials_test.cc",
"testing/origin_trials_test.h",
"testing/origin_trials_test_global.h",
"testing/origin_trials_test_partial.h",
"testing/record_test.cc",
"testing/record_test.h",
"testing/scoped_fake_ukm_recorder.cc",
"testing/scoped_fake_ukm_recorder.h",
"testing/scoped_mock_overlay_scrollbars.h",
"testing/sequence_test.cc",
"testing/sequence_test.h",
"testing/static_selection.cc",
"testing/static_selection.h",
"testing/type_conversions.h",
"testing/union_types_test.cc",
"testing/union_types_test.h",
"testing/v8/web_core_test_support.cc",
"testing/v8/web_core_test_support.h",
"testing/wait_for_event.cc",
"testing/wait_for_event.h",
"testing/worker_internals.cc",
"testing/worker_internals.h",
"timing/internals_profiler.cc",
"timing/internals_profiler.h",
]
public_deps = [ "//testing/gmock:gmock" ]
}
# generate_event_interfaces ----------------------------------------------------
generate_event_interfaces("core_event_interfaces") {
sources = [
"app_history/app_history_current_change_event.idl",
"app_history/app_history_navigate_event.idl",
"css/font_face_set_load_event.idl",
"css/media_query_list_event.idl",
"dom/events/custom_event.idl",
"dom/events/event.idl",
"editing/ime/character_bounds_update_event.idl",
"editing/ime/text_format.idl",
"editing/ime/text_format_update_event.idl",
"editing/ime/text_update_event.idl",
"events/animation_event.idl",
"events/animation_playback_event.idl",
"events/before_create_policy_event.idl",
"events/before_unload_event.idl",
"events/clipboard_event.idl",
"events/composition_event.idl",
"events/drag_event.idl",
"events/error_event.idl",
"events/focus_event.idl",
"events/hash_change_event.idl",
"events/input_event.idl",
"events/keyboard_event.idl",
"events/message_event.idl",
"events/mouse_event.idl",
"events/mutation_event.idl",
"events/overscroll_event.idl",
"events/page_transition_event.idl",
"events/pointer_event.idl",
"events/pop_state_event.idl",
"events/progress_event.idl",
"events/promise_rejection_event.idl",
"events/resource_progress_event.idl",
"events/security_policy_violation_event.idl",
"events/text_event.idl",
"events/touch_event.idl",
"events/transition_event.idl",
"events/ui_event.idl",
"events/wheel_event.idl",
"html/forms/form_data_event.idl",
"html/forms/submit_event.idl",
"html/track/track_event.idl",
"mojo/test/mojo_interface_request_event.idl",
]
output_file = "core/event_interface_names.json5"
}
# generated_testing_idls -------------------------------------------------------
group("generated_testing_idls") {
public_deps = [
":generated_settings_macros",
":generated_testing_idls_internal_runtime_flags",
":generated_testing_idls_settings",
]
}
blink_python_runner("generated_settings_macros") {
script = "../build/scripts/make_settings.py"
inputs = scripts_for_json5_files + [
"../build/scripts/make_settings.py",
"../build/scripts/templates/settings_macros.h.tmpl",
"frame/settings.json5",
]
outputs = [ "$blink_core_output_dir/settings_macros.h" ]
args = [
rebase_path("frame/settings.json5", root_build_dir),
"--output_dir",
rel_blink_core_gen_dir,
]
}
blink_python_runner("generated_testing_idls_settings") {
script = "../build/scripts/make_internal_settings.py"
inputs = scripts_for_json5_files + [
"../build/scripts/make_internal_settings.py",
"../build/scripts/templates/internal_settings_generated.idl.tmpl",
"../build/scripts/templates/internal_settings_generated.cc.tmpl",
"../build/scripts/templates/internal_settings_generated.h.tmpl",
"frame/settings.json5",
]
args = [
rebase_path("frame/settings.json5", root_build_dir),
"--output_dir",
"$rel_blink_core_gen_dir/testing",
]
outputs = [
"$blink_core_output_dir/testing/internal_settings_generated.idl",
"$blink_core_output_dir/testing/internal_settings_generated.cc",
"$blink_core_output_dir/testing/internal_settings_generated.h",
]
}
blink_python_runner("generated_testing_idls_internal_runtime_flags") {
script = "../build/scripts/make_internal_runtime_flags.py"
inputs = scripts_for_json5_files + [
"../build/scripts/make_internal_runtime_flags.py",
"../platform/runtime_enabled_features.json5",
"../build/scripts/templates/internal_runtime_flags.h.tmpl",
"../build/scripts/templates/internal_runtime_flags.idl.tmpl",
]
args = [
rebase_path("../platform/runtime_enabled_features.json5", root_build_dir),
"--output_dir",
"$rel_blink_core_gen_dir/testing",
]
outputs = [
"$blink_core_output_dir/testing/internal_runtime_flags.idl",
"$blink_core_output_dir/testing/internal_runtime_flags.h",
]
}
css_properties("make_core_generated_computed_style_initial_values") {
script = "../build/scripts/core/style/make_computed_style_initial_values.py"
in_files = [ "style/computed_style_extra_fields.json5" ]
other_inputs = [ "../build/scripts/core/style/templates/computed_style_initial_values.h.tmpl" ]
outputs = [ "$blink_core_output_dir/style/computed_style_initial_values.h" ]
}
css_properties("make_core_generated_computed_style_base") {
script = "../build/scripts/core/style/make_computed_style_base.py"
in_files = [
"style/computed_style_extra_fields.json5",
"style/computed_style_diff_functions.json5",
"css/css_value_keywords.json5",
"css/css_properties_ranking.json5",
"css/css_group_config.json5",
]
other_inputs = [
"../build/scripts/core/style/templates/computed_style_base.cc.tmpl",
"../build/scripts/core/style/templates/computed_style_base.h.tmpl",
"../build/scripts/core/style/templates/computed_style_base_constants.h.tmpl",
"../build/scripts/templates/fields/field.tmpl",
"../build/scripts/templates/fields/group.tmpl",
"../build/scripts/templates/fields/base.tmpl",
"../build/scripts/templates/fields/keyword.tmpl",
"../build/scripts/templates/fields/pointer.tmpl",
"../build/scripts/templates/fields/primitive.tmpl",
"../build/scripts/templates/fields/monotonic_flag.tmpl",
"../build/scripts/templates/fields/external.tmpl",
"../build/scripts/keyword_utils.py",
]
outputs = [
"$blink_core_output_dir/style/computed_style_base.cc",
"$blink_core_output_dir/style/computed_style_base.h",
"$blink_core_output_dir/style/computed_style_base_constants.h",
]
}
css_properties("make_core_generated_css_value_id_mappings") {
script = "../build/scripts/core/css/make_css_value_id_mappings.py"
in_files = [ "css/css_value_keywords.json5" ]
other_inputs = [
"../build/scripts/core/css/templates/css_value_id_mappings_generated.h.tmpl",
"../build/scripts/keyword_utils.py",
]
outputs = [ "$blink_core_output_dir/css/css_value_id_mappings_generated.h" ]
}
css_properties("make_core_generated_css_property_instances") {
script = "../build/scripts/core/css/properties/make_css_property_instances.py"
other_inputs = [
"../build/scripts/core/css/properties/templates/css_property_instances.cc.tmpl",
"../build/scripts/core/css/properties/templates/css_property_instances.h.tmpl",
]
outputs = [
"$blink_core_output_dir/css/properties/css_property_instances.cc",
"$blink_core_output_dir/css/properties/css_property_instances.h",
]
}
css_properties("make_core_generated_css_subclasses") {
script =
"../build/scripts/core/css/properties/make_css_property_subclasses.py"
in_files = [ "css/properties/css_property_methods.json5" ]
other_inputs = [
"../build/scripts/core/css/properties/templates/css_properties.h.tmpl",
"../build/scripts/core/css/properties/templates/css_properties.cc.tmpl",
]
outputs = [
"$blink_core_output_dir/css/properties/longhands.cc",
"$blink_core_output_dir/css/properties/longhands.h",
"$blink_core_output_dir/css/properties/shorthands.cc",
"$blink_core_output_dir/css/properties/shorthands.h",
]
}
css_properties("make_core_generated_css_property_names") {
script = "../build/scripts/core/css/make_css_property_names.py"
other_inputs = [
"../build/scripts/gperf.py",
"../build/scripts/core/css/templates/css_property_names.cc.tmpl",
"../build/scripts/core/css/templates/css_property_names.h.tmpl",
]
outputs = [
"$blink_core_output_dir/css/css_property_names.cc",
"$blink_core_output_dir/css/css_property_names.h",
]
}
code_generator("make_core_generated_atrule_names") {
script = "../build/scripts/core/css/parser/make_atrule_names.py"
json_inputs = [ "css/parser/at_rule_names.json5" ]
other_inputs = [ "../build/scripts/gperf.py" ]
templates = [
"../build/scripts/core/css/parser/templates/at_rule_descriptors.cc.tmpl",
"../build/scripts/core/css/parser/templates/at_rule_descriptors.h.tmpl",
]
outputs = [
"$blink_core_output_dir/css/parser/at_rule_descriptors.cc",
"$blink_core_output_dir/css/parser/at_rule_descriptors.h",
]
other_args = [
"--gperf",
gperf_exe,
]
}
code_generator("make_core_generated_media_features") {
script = "../build/scripts/core/css/make_media_features.py"
json_inputs = [ "css/media_feature_names.json5" ]
other_inputs =
scripts_for_json5_files + [ "../build/scripts/media_feature_symbol.py" ]
templates = [ "../build/scripts/core/css/templates/media_features.h.tmpl" ]
outputs = [ "$blink_core_output_dir/css/media_features.h" ]
}
css_properties("make_core_generated_style_property_shorthand") {
script = "../build/scripts/core/css/make_style_shorthands.py"
other_inputs = [
"../build/scripts/core/css/templates/style_property_shorthand.cc.tmpl",
"../build/scripts/core/css/templates/style_property_shorthand.h.tmpl",
]
outputs = [
"$blink_core_output_dir/style_property_shorthand.cc",
"$blink_core_output_dir/style_property_shorthand.h",
]
}
css_properties("make_core_generated_cssom_types") {
script = "../build/scripts/core/css/make_cssom_types.py"
other_inputs = [
"../build/scripts/core/css/templates/cssom_keywords.cc.tmpl",
"../build/scripts/core/css/templates/cssom_types.cc.tmpl",
]
outputs = [
"$blink_core_output_dir/cssom_keywords.cc",
"$blink_core_output_dir/cssom_types.cc",
]
}
code_generator("make_core_generated_css_value_keywords") {
script = "../build/scripts/core/css/make_css_value_keywords.py"
json_inputs = [ "css/css_value_keywords.json5" ]
other_inputs = [ "../build/scripts/gperf.py" ]
templates = [
"../build/scripts/core/css/templates/css_value_keywords.cc.tmpl",
"../build/scripts/core/css/templates/css_value_keywords.h.tmpl",
]
outputs = [
"$blink_core_output_dir/css_value_keywords.cc",
"$blink_core_output_dir/css_value_keywords.h",
]
other_args = [
"--gperf",
gperf_exe,
]
}
process_json5_files("make_core_generated_html_element_factory") {
script = "../build/scripts/make_element_factory.py"
in_files = [
"html/aria_properties.json5",
"html/html_tag_names.json5",
"html/html_attribute_names.json5",
]
other_inputs = make_element_factory_files
outputs = [
"$blink_core_output_dir/html_element_factory.cc",
"$blink_core_output_dir/html_element_factory.h",
"$blink_core_output_dir/html_names.cc",
"$blink_core_output_dir/html_names.h",
]
}
process_json5_files("make_core_generated_html_element_type_helpers") {
script = "../build/scripts/make_element_type_helpers.py"
in_files = [ "html/html_tag_names.json5" ]
other_inputs = make_element_type_helpers_files
outputs = [
"$blink_core_output_dir/html_element_type_helpers.cc",
"$blink_core_output_dir/html_element_type_helpers.h",
]
}
process_json5_files("make_core_generated_mathml_names") {
script = "../build/scripts/make_element_factory.py"
in_files = [
"mathml/mathml_tag_names.json5",
"mathml/mathml_attribute_names.json5",
]
other_inputs = make_element_factory_files
outputs = [
"$blink_core_output_dir/mathml_element_factory.cc",
"$blink_core_output_dir/mathml_element_factory.h",
"$blink_core_output_dir/mathml_names.cc",
"$blink_core_output_dir/mathml_names.h",
]
}
process_json5_files("make_core_generated_mathml_element_type_helpers") {
script = "../build/scripts/make_element_type_helpers.py"
in_files = [ "mathml/mathml_tag_names.json5" ]
other_inputs = make_element_type_helpers_files
outputs = [
"$blink_core_output_dir/mathml_element_type_helpers.cc",
"$blink_core_output_dir/mathml_element_type_helpers.h",
]
}
process_json5_files("make_core_generated_svg_names") {
script = "../build/scripts/make_element_factory.py"
in_files = [
"svg/svg_tag_names.json5",
"svg/svg_attribute_names.json5",
]
other_inputs = make_element_factory_files
outputs = [
"$blink_core_output_dir/svg_element_factory.cc",
"$blink_core_output_dir/svg_element_factory.h",
"$blink_core_output_dir/svg_names.cc",
"$blink_core_output_dir/svg_names.h",
]
}
process_json5_files("make_core_generated_svg_element_type_helpers") {
script = "../build/scripts/make_element_type_helpers.py"
in_files = [ "svg/svg_tag_names.json5" ]
other_inputs = make_element_type_helpers_files
outputs = [ "$blink_core_output_dir/svg_element_type_helpers.h" ]
}
# make_event_factory -----------------------------------------------------------
make_event_factory("make_core_generated_event_factory") {
in_files = [
"$blink_core_output_dir/event_interface_names.json5",
"events/event_interface_aliases.json5",
]
outputs = [ "$blink_core_output_dir/event_factory.cc" ]
}
# make_names -------------------------------------------------------------------
code_generator("make_core_generated_media_feature_names") {
script = "../build/scripts/core/css/make_media_feature_names.py"
json_inputs = [ "css/media_feature_names.json5" ]
templates = [
"../build/scripts/templates/make_names.cc.tmpl",
"../build/scripts/templates/make_names.h.tmpl",
]
other_inputs =
make_names_files + [ "../build/scripts/media_feature_symbol.py" ]
outputs = [
"$blink_core_output_dir/css/media_feature_names.cc",
"$blink_core_output_dir/css/media_feature_names.h",
]
}
make_names("make_core_generated_media_type_names") {
in_files = [ "css/media_type_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_event_names") {
in_files = [ "$blink_core_output_dir/event_interface_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_event_target_names") {
in_files = [ "events/event_target_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_event_type_names") {
in_files = [ "events/event_type_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_html_tokenizer_names") {
in_files = [ "html/parser/html_tokenizer_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_input_type_names") {
in_files = [ "html/forms/input_type_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_keywords") {
in_files = [ "html/keywords.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_performance_entry_names") {
in_files = [ "timing/performance_entry_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_pointer_type_names") {
in_files = [ "events/pointer_type_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_script_type_names") {
in_files = [ "script/script_type_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_securitypolicyviolation_disposition_names") {
in_files = [ "events/securitypolicyviolation_disposition_names.json5" ]
output_dir = blink_core_output_dir
}
make_names("make_core_generated_shadow_element_names") {
in_files = [ "html/shadow/shadow_element_names.json5" ]
output_dir = "$blink_core_output_dir/html/shadow"
}
# make_qualified_names ---------------------------------------------------------
make_qualified_names("make_core_generated_xlink_names") {
in_files = [ "svg/xlink_attribute_names.json5" ]
outputs = [
"$blink_core_output_dir/xlink_names.cc",
"$blink_core_output_dir/xlink_names.h",
]
}
make_qualified_names("make_core_generated_xml_ns_names") {
in_files = [ "xml/xmlns_attribute_names.json5" ]
outputs = [
"$blink_core_output_dir/xmlns_names.cc",
"$blink_core_output_dir/xmlns_names.h",
]
}
make_qualified_names("make_core_generated_xml_names") {
in_files = [ "xml/xml_attribute_names.json5" ]
outputs = [
"$blink_core_output_dir/xml_names.cc",
"$blink_core_output_dir/xml_names.h",
]
}
# One-off scripts --------------------------------------------------------------
action("make_core_generated_html_entity_table") {
visibility = [] # Allow re-assignment of list.
visibility = [ ":*" ]
script = "../build/scripts/make_html_entity_table.py"
inputs = [ "html/parser/html_entity_names.csv" ]
outputs = [ "$blink_core_output_dir/html_entity_table.cc" ]
args = [ "-o" ] + rebase_path(outputs, root_build_dir)
args += rebase_path(inputs, root_build_dir)
deps = make_core_generated_deps
}
blink_python_runner("make_core_generated_css_tokenizer_codepoints") {
visibility = [] # Allow re-assignment of list.
visibility = [ ":*" ]
script = "../build/scripts/core/css/make_css_tokenizer_codepoints.py"
outputs = [ "$blink_core_output_dir/css/css_tokenizer_codepoints.cc" ]
args = [
"--output_dir",
"$rel_blink_core_gen_dir/css",
]
deps = make_core_generated_deps
}
blink_python_runner("make_core_generated_css_primitive_value_unit_trie") {
visibility = [] # Allow re-assignment of list.
visibility = [ ":*" ]
script = "../build/scripts/core/css/make_css_primitive_value_unit_trie.py"
input_file = "css/css_primitive_value_units.json5"
inputs = make_trie_helpers_files + [
input_file,
"../build/scripts/core/css/templates/css_primitive_value_unit_trie.cc.tmpl",
]
outputs = [ "$blink_core_output_dir/css/css_primitive_value_unit_trie.cc" ]
args = [
rebase_path(input_file, root_build_dir),
"--output_dir",
"$rel_blink_core_gen_dir/css",
]
deps = make_core_generated_deps
}
blink_python_runner("make_core_generated_permissions_policy_helper") {
script = "../build/scripts/make_policy_helper.py"
inputs = scripts_for_json5_files + [
"../build/scripts/make_policy_helper.py",
"./permissions_policy/permissions_policy_features.json5",
"./permissions_policy/document_policy_features.json5",
"../platform/runtime_enabled_features.json5",
"../build/scripts/templates/policy_helper.cc.tmpl",
]
outputs = [ "$blink_core_output_dir/permissions_policy/policy_helper.cc" ]
args = [
rebase_path("../platform/runtime_enabled_features.json5", root_build_dir),
rebase_path("./permissions_policy/permissions_policy_features.json5",
root_build_dir),
rebase_path("./permissions_policy/document_policy_features.json5",
root_build_dir),
"--output_dir",
"$rel_blink_core_gen_dir/permissions_policy",
]
}
blink_python_runner("make_core_generated_html_element_lookup_trie") {
visibility = [] # Allow re-assignment of list.
visibility = [ ":*" ]
script = "../build/scripts/make_element_lookup_trie.py"
input_file = "html/html_tag_names.json5"
inputs = make_trie_helpers_files + [
input_file,
"../build/scripts/templates/element_lookup_trie.cc.tmpl",
"../build/scripts/templates/element_lookup_trie.h.tmpl",
]
outputs = [
"$blink_core_output_dir/html_element_lookup_trie.cc",
"$blink_core_output_dir/html_element_lookup_trie.h",
]
args = [
rebase_path(input_file, root_build_dir),
"--output_dir",
rel_blink_core_gen_dir,
]
deps = make_core_generated_deps
}
blink_python_runner("make_core_generated_web_origin_trials") {
script = "../build/scripts/make_web_origin_trials.py"
inputs = scripts_for_json5_files + [
"../build/scripts/make_web_origin_trials.py",
"../platform/runtime_enabled_features.json5",
"../build/scripts/templates/web_origin_trials.cc.tmpl",
]
outputs = [ "$blink_core_output_dir/exported/web_origin_trials.cc" ]
args = [
rebase_path("../platform/runtime_enabled_features.json5", root_build_dir),
"--output_dir",
"$rel_blink_core_gen_dir/exported",
]
}
# Targets from above that generate outputs that need to be compiled.
# All sources declared as outputs from these targets will be compiled into one
# target.
targets_generating_sources = [
":make_core_generated_atrule_names",
":make_core_generated_computed_style_base",
":make_core_generated_computed_style_initial_values",
":make_core_generated_css_primitive_value_unit_trie",
":make_core_generated_css_property_instances",
":make_core_generated_css_property_names",
":make_core_generated_css_subclasses",
":make_core_generated_css_value_id_mappings",
":make_core_generated_css_value_keywords",
":make_core_generated_cssom_types",
":make_core_generated_event_factory",
":make_core_generated_event_names",
":make_core_generated_event_target_names",
":make_core_generated_event_type_names",
":make_core_generated_html_element_factory",
":make_core_generated_html_element_lookup_trie",
":make_core_generated_html_element_type_helpers",
":make_core_generated_html_entity_table",
":make_core_generated_html_tokenizer_names",
":make_core_generated_input_type_names",
":make_core_generated_keywords",
":make_core_generated_mathml_element_type_helpers",
":make_core_generated_mathml_names",
":make_core_generated_media_feature_names",
":make_core_generated_media_features",
":make_core_generated_media_type_names",
":make_core_generated_performance_entry_names",
":make_core_generated_permissions_policy_helper",
":make_core_generated_pointer_type_names",
":make_core_generated_script_type_names",
":make_core_generated_securitypolicyviolation_disposition_names",
":make_core_generated_shadow_element_names",
":make_core_generated_style_property_shorthand",
":make_core_generated_svg_element_type_helpers",
":make_core_generated_svg_names",
":make_core_generated_web_origin_trials",
":make_core_generated_xlink_names",
":make_core_generated_xml_names",
":make_core_generated_xml_ns_names",
]
group("all_generators") {
public_deps = targets_generating_sources
public_deps += [
# This target's generated source is #included into another source file.
# So we don't want to list it in the "generating sources" list above,
# but it does need to be listed as a dependency here.
":make_core_generated_css_tokenizer_codepoints",
]
}
# Compiles the code generated by the targets above.
if (is_component_build) {
# To get exported symbols correct in component builds, the files must be in
# source sets.
core_generated_target_type = "source_set"
} else {
core_generated_target_type = "static_library"
}
target(core_generated_target_type, "core_generated") {
# Add all sources generated by the targets above.
sources = []
foreach(current, targets_generating_sources) {
sources += get_target_outputs(current)
}
deps = [
"//services/metrics/public/cpp:ukm_builders",
"//third_party/blink/renderer/core/probe:probe",
]
public_deps = [ ":all_generators" ]
configs -= core_config_remove
configs += core_config_add + [ "..:inside_blink" ]
# Dependencies required to compile the sources.
public_deps += [
":prerequisites",
"//gin",
"//skia",
"//third_party/blink/renderer/platform:make_platform_generated",
"//third_party/blink/renderer/platform/wtf",
"//third_party/iccjpeg",
"//third_party/libpng",
"//third_party/libwebp",
"//third_party/libxml",
"//third_party/libxslt",
"//url",
"//v8",
]
allow_circular_includes_from =
[ "//third_party/blink/renderer/core/probe:probe" ]
configs += [ ":core_include_dirs" ]
cflags = []
defines = []
if (is_win && is_component_build) {
defines += [ "USING_V8_SHARED" ]
}
if (is_win) {
cflags += [
# In generated bindings code: "switch contains default but no case".
# 4701 and 4702 are disabled because of issues in Bison-generated
# XPathGrammar.cpp.
"/wd4065",
"/wd4701",
"/wd4702",
]
}
if (is_debug || dcheck_always_on) {
deps += [ "//components/crash/core/common:crash_key" ]
}
}
# Fuzzer for blink::TextResourceDecoder.
fuzzer_test("text_resource_decoder_fuzzer") {
sources = [
"html/parser/text_resource_decoder_for_fuzzing.h",
"html/parser/text_resource_decoder_fuzzer.cc",
]
deps = [
":core",
"../platform:blink_fuzzer_test_support",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"accessibility/ax_context_test.cc",
"app_history/app_history_test.cc",
"clipboard/clipboard_utilities_test.cc",
"content_capture/content_capture_test.cc",
"css/css_revert_layer_value_test.cc",
"css/css_revert_value_test.cc",
"css/css_test_helpers.cc",
"css/css_test_helpers.h",
"css/css_uri_value_test.cc",
"css/css_value_test_helper.h",
"css/font_display_auto_lcp_align_test.cc",
"css/mock_css_paint_image_generator.h",
"display_lock/display_lock_context_test.cc",
"display_lock/display_lock_utilities_test.cc",
"document_transition/document_transition_test.cc",
"editing/caret_display_item_client_test.cc",
"editing/finder/text_finder_test.cc",
"editing/keyboard_test.cc",
"editing/link_selection_test.cc",
"events/message_event_test.cc",
"events/mouse_event_test.cc",
"events/pointer_event_factory_test.cc",
"events/pointer_event_util_test.cc",
"events/touch_event_test.cc",
"events/web_input_event_conversion_test.cc",
"execution_context/execution_context_lifecycle_state_observer_test.cc",
"exported/web_document_subresource_filter_test.cc",
"exported/web_document_test.cc",
"exported/web_drag_data_test.cc",
"exported/web_element_test.cc",
"exported/web_frame_serializer_sanitization_test.cc",
"exported/web_frame_serializer_test.cc",
"exported/web_frame_serializer_test_helper.cc",
"exported/web_frame_serializer_test_helper.h",
"exported/web_image_test.cc",
"exported/web_meaningful_layouts_test.cc",
"exported/web_node_test.cc",
"exported/web_plugin_container_test.cc",
"exported/web_range_test.cc",
"exported/web_scoped_window_focus_allowed_indicator_test.cc",
"exported/web_searchable_form_data_test.cc",
"exported/web_selector_test.cc",
"exported/web_view_test.cc",
"fetch/blob_bytes_consumer_test.cc",
"fetch/body_stream_buffer_test.cc",
"fetch/bytes_consumer_tee_test.cc",
"fetch/bytes_consumer_test_util.cc",
"fetch/bytes_consumer_test_util.h",
"fetch/bytes_uploader_test.cc",
"fetch/fetch_data_loader_test.cc",
"fetch/fetch_header_list_test.cc",
"fetch/fetch_request_data_test.cc",
"fetch/fetch_response_data_test.cc",
"fetch/form_data_bytes_consumer_test.cc",
"fetch/multipart_parser_test.cc",
"fetch/place_holder_bytes_consumer_test.cc",
"fetch/readable_stream_bytes_consumer_test.cc",
"fetch/request_test.cc",
"fetch/response_test.cc",
"fragment_directive/css_selector_fragment_anchor_test.cc",
"fragment_directive/text_fragment_anchor_metrics_test.cc",
"fragment_directive/text_fragment_anchor_test.cc",
"fragment_directive/text_fragment_finder_test.cc",
"fragment_directive/text_fragment_generation_navigation_test.cc",
"fragment_directive/text_fragment_handler_test.cc",
"fragment_directive/text_fragment_selector_generator_test.cc",
"fragment_directive/text_fragment_selector_test.cc",
"frame/ad_tracker_test.cc",
"frame/browser_controls_test.cc",
"frame/child_frame_compositing_helper_test.cc",
"frame/csp/content_security_policy_test.cc",
"frame/csp/conversion_util_test.cc",
"frame/csp/csp_directive_list_test.cc",
"frame/csp/csp_source_test.cc",
"frame/csp/source_list_directive_test.cc",
"frame/csp/trusted_types_directive_test.cc",
"frame/deprecation_report_body_test.cc",
"frame/document_loading_rendering_test.cc",
"frame/document_policy_violation_report_body_test.cc",
"frame/dom_timer_test.cc",
"frame/find_in_page_test.cc",
"frame/frame_content_as_text_test.cc",
"frame/frame_overlay_test.cc",
"frame/frame_serializer_test.cc",
"frame/frame_test.cc",
"frame/history_util_test.cc",
"frame/local_dom_window_test.cc",
"frame/local_frame_back_forward_cache_test.cc",
"frame/local_frame_client_impl_test.cc",
"frame/local_frame_test.cc",
"frame/local_frame_ukm_aggregator_test.cc",
"frame/local_frame_view_test.cc",
"frame/location_report_body_test.cc",
"frame/mhtml_archive_test.cc",
"frame/mhtml_loading_test.cc",
"frame/performance_monitor_test.cc",
"frame/policy_container_test.cc",
"frame/report_test.cc",
"frame/reporting_context_test.cc",
"frame/root_frame_viewport_test.cc",
"frame/rotation_viewport_anchor_test.cc",
"frame/use_counter_impl_test.cc",
"frame/visual_viewport_test.cc",
"frame/web_frame_test.cc",
"frame/web_frame_widget_test.cc",
"frame/web_local_frame_client_test.cc",
"fullscreen/scoped_allow_fullscreen_test.cc",
"geometry/dom_matrix_test.cc",
"imagebitmap/image_bitmap_test.cc",
"input/event_handler_test.cc",
"input/ime_on_focus_test.cc",
"input/overscroll_behavior_test.cc",
"input/pointer_event_manager_test.cc",
"input/scroll_snap_test.cc",
"input/touch_action_test.cc",
"input/touch_event_manager_test.cc",
"inspector/agent_registry_test.cc",
"inspector/inspector_contrast_test.cc",
"inspector/inspector_emulation_agent_test.cc",
"inspector/inspector_highlight_test.cc",
"inspector/inspector_history_test.cc",
"inspector/inspector_media_context_impl_unittest.cc",
"inspector/inspector_session_state_test.cc",
"inspector/inspector_style_resolver_test.cc",
"inspector/main_thread_debugger_test.cc",
"inspector/protocol_parser_test.cc",
"inspector/protocol_unittest.cc",
"intersection_observer/intersection_observer_test.cc",
"loader/alternate_signed_exchange_resource_info_test.cc",
"loader/base_fetch_context_test.cc",
"loader/cookie_jar_unittest.cc",
"loader/document_load_timing_test.cc",
"loader/document_loader_test.cc",
"loader/font_preload_manager_test.cc",
"loader/frame_fetch_context_test.cc",
"loader/frame_loader_test.cc",
"loader/frame_resource_fetcher_properties_test.cc",
"loader/idleness_detector_test.cc",
"loader/image_loader_test.cc",
"loader/interactive_detector_test.cc",
"loader/link_loader_test.cc",
"loader/long_task_detector_test.cc",
"loader/mixed_content_checker_test.cc",
"loader/mock_content_security_notifier.h",
"loader/modulescript/module_script_loader_test.cc",
"loader/modulescript/module_tree_linker_test.cc",
"loader/navigation_policy_test.cc",
"loader/ping_loader_test.cc",
"loader/prerender_test.cc",
"loader/programmatic_scroll_test.cc",
"loader/progress_tracker_test.cc",
"loader/resource/css_style_sheet_resource_test.cc",
"loader/resource/font_resource_test.cc",
"loader/resource/image_resource_test.cc",
"loader/resource/mock_font_resource_client.cc",
"loader/resource/mock_font_resource_client.h",
"loader/resource/mock_image_resource_observer.cc",
"loader/resource/mock_image_resource_observer.h",
"loader/resource/multipart_image_resource_parser_test.cc",
"loader/resource/resource_loader_code_cache_test.cc",
"loader/resource/script_resource_test.cc",
"loader/resource_load_observer_for_frame_test.cc",
"loader/threadable_loader_test.cc",
"loader/threaded_icon_loader_test.cc",
"loader/web_associated_url_loader_impl_test.cc",
"loader/web_bundle/script_web_bundle_rule_test.cc",
"messaging/blink_transferable_message_mojom_traits_test.cc",
"messaging/message_port_descriptor_mojom_traits_test.cc",
"mobile_metrics/mobile_friendliness_checker_test.cc",
"origin_trials/origin_trial_context_test.cc",
"page/autoscroll_controller_test.cc",
"page/chrome_client_impl_test.cc",
"page/chrome_client_test.cc",
"page/context_menu_controller_test.cc",
"page/drag_controller_test.cc",
"page/drag_image_test.cc",
"page/focus_controller_test.cc",
"page/named_pages_mapper_test.cc",
"page/page_popup_client_test.cc",
"page/plugin_data_test.cc",
"page/print_context_test.cc",
"page/scrolling/element_fragment_anchor_test.cc",
"page/scrolling/main_thread_scrolling_reasons_test.cc",
"page/scrolling/root_scroller_test.cc",
"page/scrolling/scroll_into_view_test.cc",
"page/scrolling/scroll_metrics_test.cc",
"page/scrolling/scroll_state_test.cc",
"page/scrolling/scrolling_test.cc",
"page/scrolling/snap_coordinator_test.cc",
"page/slot_scoped_traversal_test.cc",
"page/spatial_navigation_test.cc",
"page/touch_adjustment_test.cc",
"page/validation_message_overlay_delegate_test.cc",
"page/viewport_test.cc",
"page/window_features_test.cc",
"paint/block_painter_test.cc",
"paint/box_paint_invalidator_test.cc",
"paint/box_painter_test.cc",
"paint/clip_path_clipper_test.cc",
"paint/clip_rect_test.cc",
"paint/compositing/compositing_reason_finder_test.cc",
"paint/compositing/compositing_test.cc",
"paint/css_mask_painter_test.cc",
"paint/cull_rect_updater_test.cc",
"paint/first_meaningful_paint_detector_test.cc",
"paint/fragment_data_test.cc",
"paint/highlight_painting_utils_test.cc",
"paint/html_canvas_painter_test.cc",
"paint/image_element_timing_test.cc",
"paint/image_paint_timing_detector_test.cc",
"paint/inline_text_box_painter_test.cc",
"paint/largest_contentful_paint_calculator_test.cc",
"paint/link_highlight_impl_test.cc",
"paint/ng/ng_box_fragment_painter_test.cc",
"paint/ng/ng_text_fragment_painter_test.cc",
"paint/nine_piece_image_grid_test.cc",
"paint/object_paint_invalidator_test.cc",
"paint/outline_painter_test.cc",
"paint/paint_and_raster_invalidation_test.cc",
"paint/paint_and_raster_invalidation_test.h",
"paint/paint_controller_paint_test.cc",
"paint/paint_controller_paint_test.h",
"paint/paint_layer_clipper_test.cc",
"paint/paint_layer_painter_test.cc",
"paint/paint_layer_scrollable_area_test.cc",
"paint/paint_layer_test.cc",
"paint/paint_property_tree_builder_test.cc",
"paint/paint_property_tree_builder_test.h",
"paint/paint_property_tree_printer_test.cc",
"paint/paint_property_tree_update_tests.cc",
"paint/paint_timing_test_helper.h",
"paint/pre_paint_tree_walk_test.cc",
"paint/scrollable_area_painter_test.cc",
"paint/selection_bounds_recorder_test.cc",
"paint/svg_container_painter_test.cc",
"paint/table_painter_test.cc",
"paint/text_paint_timing_detector_test.cc",
"paint/text_painter_test.cc",
"paint/text_selection_repaint_test.cc",
"paint/video_painter_test.cc",
"paint/view_painter_test.cc",
"permissions_policy/document_policy_parser_test.cc",
"permissions_policy/document_policy_sim_test.cc",
"permissions_policy/permissions_policy_devtools_support_test.cc",
"permissions_policy/permissions_policy_test.cc",
"permissions_policy/policy_test.cc",
"resize_observer/resize_observer_test.cc",
"scheduler_integration_tests/frame_scheduler_test.cc",
"scheduler_integration_tests/frame_throttling_test.cc",
"scheduler_integration_tests/scheduler_affecting_features_test.cc",
"scheduler_integration_tests/throttling_test.cc",
"scheduler_integration_tests/virtual_time_test.cc",
"script/document_modulator_impl_test.cc",
"script/dynamic_module_resolver_test.cc",
"script/module_map_test.cc",
"script/module_record_resolver_impl_test.cc",
"script/module_script_test.cc",
"script/script_runner_test.cc",
"speculation_rules/speculation_rule_set_test.cc",
"speculation_rules/speculation_rules_origin_trial_test.cc",
"streams/miscellaneous_operations_test.cc",
"streams/queue_with_sizes_test.cc",
"streams/readable_stream_test.cc",
"streams/stream_promise_resolver_test.cc",
"streams/test_utils.cc",
"streams/test_utils.h",
"streams/transferable_streams_test.cc",
"streams/transform_stream_test.cc",
"streams/writable_stream_test.cc",
"svg/animation/priority_queue_test.cc",
"svg/animation/smil_time_container_test.cc",
"svg/animation/svg_smil_element_test.cc",
"svg/graphics/svg_image_test.cc",
"svg/svg_element_test.cc",
"svg/svg_foreign_object_element_test.cc",
"svg/svg_path_parser_test.cc",
"svg/svg_path_query_test.cc",
"svg/svg_resource_document_content_test.cc",
"svg/svg_text_content_element_test.cc",
"svg/svg_use_element_test.cc",
"svg/unsafe_svg_attribute_sanitization_test.cc",
"timing/background_tracing_helper_test.cc",
"timing/memory_info_test.cc",
"timing/performance_mark_test.cc",
"timing/performance_navigation_timing_test.cc",
"timing/performance_observer_test.cc",
"timing/performance_resource_timing_test.cc",
"timing/performance_test.cc",
"timing/profiler_group_test.cc",
"timing/time_clamper_test.cc",
"timing/window_performance_test.cc",
"trustedtypes/trusted_types_util_test.cc",
"typed_arrays/array_buffer/array_buffer_contents_test.cc",
"typed_arrays/dom_array_buffer_test.cc",
"url/url_search_params_test.cc",
"workers/dedicated_worker_test.cc",
"workers/dedicated_worker_test.h",
"workers/main_thread_worklet_test.cc",
"workers/threaded_worklet_test.cc",
"workers/worker_thread_test.cc",
"workers/worklet_global_scope_test_helper.h",
"workers/worklet_module_responses_map_test.cc",
"xml/parser/shared_buffer_reader_test.cc",
"xml/parser/xml_document_parser_test.cc",
"xml/xpath_functions_test.cc",
]
# If you create a new subdirectory 'foo' that contains unit tests, list them in
# 'foo/build.gni' to define blink_core_tests_foo, and add any dependencies in
# the deps section below.
sources += rebase_path(blink_core_tests_accessibility, "", "accessibility")
sources += rebase_path(blink_core_tests_animation, "", "animation")
sources += rebase_path(blink_core_tests_clipboard, "", "clipboard")
sources += rebase_path(blink_core_tests_css, "", "css")
sources += rebase_path(blink_core_tests_dom, "", "dom")
sources += rebase_path(blink_core_tests_editing, "", "editing")
sources += rebase_path(blink_core_tests_fileapi, "", "fileapi")
sources += rebase_path(blink_core_tests_html, "", "html")
sources += rebase_path(blink_core_tests_layout, "", "layout")
sources += rebase_path(blink_core_tests_scroll, "", "scroll")
sources += rebase_path(blink_core_tests_style, "", "style")
if (is_debug || dcheck_always_on) {
sources += [ "exported/web_disallow_transition_scope_test.cc" ]
}
configs += [
":blink_core_pch",
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
]
deps = [
":core",
":unit_test_support",
"//build:chromeos_buildflags",
"//cc",
"//components/paint_preview/common:common",
"//components/shared_highlighting/core/common",
"//components/shared_highlighting/core/common:data_driven_testing",
"//components/ukm:test_support",
"//components/viz/test:test_support",
"//content/test:test_support",
"//gpu/command_buffer/client:raster",
"//gpu/config",
"//mojo/public/cpp/system",
"//mojo/public/cpp/test_support:test_utils",
"//services/metrics/public/cpp:ukm_builders",
"//services/network/trust_tokens:test_support",
"//skia",
"//skia:skcms",
"//testing/gmock",
"//testing/gtest",
"//third_party/blink/public:buildflags",
"//third_party/blink/public:test_headers",
"//third_party/blink/public/mojom:mobile_metrics",
"//third_party/blink/renderer/controller:blink_bindings_test_sources",
"//third_party/blink/renderer/core",
"//third_party/blink/renderer/core:testing",
"//third_party/blink/renderer/core:unit_test_support",
"//third_party/blink/renderer/platform:test_support",
"//third_party/blink/renderer/platform:unit_tests",
"//ui/accessibility:ax_base",
"//ui/base/cursor",
"//ui/base/cursor/mojom:cursor_type_blink",
"//ui/base/dragdrop/mojom:mojom_blink",
"//ui/gfx:test_support",
]
data_deps = [ ":unit_tests_data" ]
if (use_aura) {
sources += [ "scroll/scrollbar_theme_aura_test.cc" ]
}
if (media_use_ffmpeg || !is_android) {
sources += [ "exported/web_media_player_impl_unittest.cc" ]
data = [ "//media/test/data/" ]
deps += [
"//media",
"//media:test_support",
"//media/mojo/services",
"//third_party/blink/public:blink",
"//third_party/blink/public:test_support",
"//third_party/blink/public/common/tokens:tokens_headers",
"//third_party/blink/public/platform/media",
"//third_party/blink/renderer/platform/media",
"//ui/gfx/geometry",
]
}
}
group("unit_tests_data") {
data = [
"//third_party/blink/web_tests/svg/animations/path-animation.svg",
"//third_party/blink/web_tests/svg/stroke/zero-length-path-linecap-rendering.svg",
"//third_party/blink/web_tests/svg/foreignObject/fixed-position.svg",
"//third_party/blink/web_tests/svg/clip-path/clip-in-mask.svg",
]
}
copy("form_controls_pickers_js") {
testonly = true
sources = [ "html/forms/resources/color_picker.js" ]
outputs = [ "{{source_gen_dir}}/{{source_file_part}}" ]
}
group("js_files_for_form_controls_web_tests") {
testonly = true
visibility = [] # Allow re-assignment of list.
visibility = [ "*" ]
data_deps = [ ":form_controls_pickers_js" ]
}
source_set("perf_tests") {
testonly = true
sources = [
"layout/svg/svg_hit_test_perftest.cc",
"layout/visual_rect_mapping_perftest.cc",
]
configs += [
":blink_core_pch",
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
]
deps = [
":core",
":unit_test_support",
"//mojo/public/cpp/system",
"//testing/gmock",
"//testing/gtest",
"//third_party/blink/renderer/platform:test_support",
]
}
source_set("unit_test_support") {
testonly = true
sources = [
"frame/frame_test_helpers.cc",
"frame/frame_test_helpers.h",
"html/media/html_media_test_helper.cc",
"html/media/html_media_test_helper.h",
"script/mock_script_element_base.h",
"testing/core_unit_test_helper.cc",
"testing/core_unit_test_helper.h",
"testing/fake_web_plugin.cc",
"testing/fake_web_plugin.h",
"testing/module_test_base.cc",
"testing/module_test_base.h",
"testing/page_test_base.cc",
"testing/page_test_base.h",
"testing/scoped_fake_plugin_registry.cc",
"testing/scoped_fake_plugin_registry.h",
"testing/sim/sim_canvas.cc",
"testing/sim/sim_canvas.h",
"testing/sim/sim_compositor.cc",
"testing/sim/sim_compositor.h",
"testing/sim/sim_network.cc",
"testing/sim/sim_network.h",
"testing/sim/sim_page.cc",
"testing/sim/sim_page.h",
"testing/sim/sim_request.cc",
"testing/sim/sim_request.h",
"testing/sim/sim_test.cc",
"testing/sim/sim_test.h",
"testing/sim/sim_web_frame_widget.cc",
"testing/sim/sim_web_frame_widget.h",
"workers/worker_thread_test_helper.h",
]
configs += [
":blink_core_pch",
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:inside_blink",
]
deps = [
":core",
"//content/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/blink/renderer/core:testing",
"//third_party/blink/renderer/platform:test_support",
]
}
# Fuzzer for blink::StyleSheetContents
fuzzer_test("stylesheet_contents_fuzzer") {
sources = [ "css/style_sheet_contents_fuzzer.cc" ]
deps = [
":core",
"../platform:blink_fuzzer_test_support",
]
dict = "//third_party/blink/renderer/core/css/css.dict"
seed_corpus = "//third_party/blink/web_tests/fast/css/resources"
libfuzzer_options = [ "max_len=1024" ]
}
# Fuzzer for blink::CSSParserFastPaths
fuzzer_test("css_parser_fast_paths_fuzzer") {
sources = [ "css/parser/css_parser_fast_paths_fuzzer.cc" ]
deps = [
":core",
"../platform:blink_fuzzer_test_support",
]
dict = "//third_party/blink/renderer/core/css/css.dict"
libfuzzer_options = [ "max_len=128" ]
}
# Fuzzer for blink::HTMLPreloadScanner.
fuzzer_test("html_preload_scanner_fuzzer") {
sources = [
"html/parser/html_preload_scanner_fuzzer.cc",
"html/parser/text_resource_decoder_for_fuzzing.h",
]
seed_corpus = "//third_party/blink/web_tests/fast/parser"
deps = [
":core",
"../platform:blink_fuzzer_test_support",
]
}
fuzzer_test("content_security_policy_conversion_util_fuzzer") {
sources = [ "frame/csp/conversion_util_fuzzer.cc" ]
deps = [
":core",
"//third_party/blink/renderer/core:testing",
"//third_party/blink/renderer/platform:blink_fuzzer_test_support",
]
dict = "//testing/libfuzzer/fuzzers/dicts/content_security_policy.dict"
seed_corpus = "//testing/libfuzzer/fuzzers/content_security_policy_corpus"
}
css_properties("make_css_proto") {
script = "../build/scripts/core/css/parser/make_proto.py"
in_files = [ "css/css_value_keywords.json5" ]
other_inputs = [
"../build/scripts/core/css/parser/templates/css.proto.tmpl",
"../build/scripts/core/css/parser/templates/css_proto_converter_generated.h.tmpl",
]
outputs = [
"$blink_core_output_dir/css/parser/css.proto",
"$blink_core_output_dir/css/parser/css_proto_converter_generated.h",
]
}
fuzzer_test("css_parser_proto_fuzzer") {
sources = [
"css/parser/css_parser_proto_fuzzer.cc",
"css/parser/css_proto_converter.cc",
"css/parser/css_proto_converter.h",
]
deps = [
":core",
":css_proto",
"//third_party/blink/renderer/platform:blink_fuzzer_test_support",
"//third_party/libprotobuf-mutator",
]
dict = "//third_party/blink/renderer/core/css/css.dict"
}
proto_library("css_proto") {
sources = [ "$blink_core_output_dir/css/parser/css.proto" ]
proto_out_dir = "third_party/blink/renderer/core/css/parser"
deps = [ ":make_css_proto" ]
}
fuzzer_test("blink_html_tokenizer_fuzzer") {
sources = [ "html/parser/html_tokenizer_fuzzer.cc" ]
deps = [
":core",
"//third_party/blink/renderer/platform:blink_fuzzer_test_support",
]
}
# Fuzzers for blink::PermissionsPolicy.
fuzzer_test("feature_policy_fuzzer") {
sources = [ "permissions_policy/feature_policy_fuzzer.cc" ]
deps = [
"//third_party/blink/renderer/core",
"//third_party/blink/renderer/platform:blink_fuzzer_test_support",
"//third_party/icu",
]
dict =
"//third_party/blink/renderer/core/permissions_policy/feature_policy.dict"
seed_corpus = "//third_party/blink/renderer/core/permissions_policy/feature_policy_corpus"
}
fuzzer_test("permissions_policy_attr_fuzzer") {
sources = [ "permissions_policy/permissions_policy_attr_fuzzer.cc" ]
deps = [
"//third_party/blink/renderer/core",
"//third_party/blink/renderer/platform:blink_fuzzer_test_support",
"//third_party/icu",
]
dict =
"//third_party/blink/renderer/core/permissions_policy/feature_policy.dict"
seed_corpus = "//third_party/blink/renderer/core/permissions_policy/feature_policy_corpus"
}
fuzzer_test("document_policy_fuzzer") {
sources = [ "permissions_policy/document_policy_fuzzer.cc" ]
deps = [
"//third_party/blink/renderer/core",
"//third_party/blink/renderer/platform:blink_fuzzer_test_support",
"//third_party/icu",
]
dict = "//third_party/blink/renderer/core/permissions_policy/document_policy.dict"
seed_corpus = "//third_party/blink/renderer/core/permissions_policy/document_policy_corpus"
}
fuzzer_test("permissions_policy_fuzzer") {
sources = [ "permissions_policy/permissions_policy_fuzzer.cc" ]
deps = [
"//third_party/blink/renderer/core",
"//third_party/blink/renderer/platform:blink_fuzzer_test_support",
"//third_party/icu",
]
dict = "//third_party/blink/renderer/core/permissions_policy/permissions_policy.dict"
seed_corpus = "//third_party/blink/renderer/core/permissions_policy/permissions_policy_corpus"
}