blob: 677d7020b2ea4dec0959fdd94ae2d9a2244e35c0 [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/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("//tools/json_schema_compiler/json_schema_api.gni")
import("//ui/base/ui_features.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
mojom_component("ax_enums_mojo") {
sources = [
"ax_enums.mojom",
]
macro_prefix = "UI_ACCESSIBILITY_AX_MOJOM"
output_prefix = "ui_accessibility_ax_mojom"
}
mojom("ax_constants_mojo") {
sources = [
"ax_constants.mojom",
]
}
jumbo_component("accessibility") {
sources = [
"accessibility_switches.cc",
"accessibility_switches.h",
"ax_action_data.cc",
"ax_action_data.h",
"ax_action_handler.cc",
"ax_action_handler.h",
"ax_enum_util.cc",
"ax_enum_util.h",
"ax_event.cc",
"ax_event.h",
"ax_event_bundle_sink.h",
"ax_event_generator.cc",
"ax_event_generator.h",
"ax_export.h",
"ax_language_info.cc",
"ax_language_info.h",
"ax_mode.cc",
"ax_mode.h",
"ax_mode_observer.h",
"ax_node.cc",
"ax_node.h",
"ax_node_data.cc",
"ax_node_data.h",
"ax_node_position.cc",
"ax_node_position.h",
"ax_position.h",
"ax_range.h",
"ax_relative_bounds.cc",
"ax_relative_bounds.h",
"ax_role_properties.cc",
"ax_role_properties.h",
"ax_serializable_tree.cc",
"ax_serializable_tree.h",
"ax_table_info.cc",
"ax_table_info.h",
"ax_text_utils.cc",
"ax_text_utils.h",
"ax_tree.cc",
"ax_tree.h",
"ax_tree_combiner.cc",
"ax_tree_combiner.h",
"ax_tree_data.cc",
"ax_tree_data.h",
"ax_tree_id.cc",
"ax_tree_id.h",
"ax_tree_id_registry.cc",
"ax_tree_id_registry.h",
"ax_tree_manager.h",
"ax_tree_manager_map.cc",
"ax_tree_manager_map.h",
"ax_tree_observer.cc",
"ax_tree_observer.h",
"ax_tree_serializer.cc",
"ax_tree_serializer.h",
"ax_tree_source.h",
"ax_tree_source_checker.h",
"ax_tree_update.h",
"platform/ax_android_constants.cc",
"platform/ax_android_constants.h",
"platform/ax_platform_node.cc",
"platform/ax_platform_node.h",
"platform/ax_platform_node_base.cc",
"platform/ax_platform_node_base.h",
"platform/ax_platform_node_delegate.h",
"platform/ax_platform_node_delegate_base.cc",
"platform/ax_platform_node_delegate_base.h",
"platform/ax_platform_node_test_helper.cc",
"platform/ax_platform_node_test_helper.h",
"platform/ax_unique_id.cc",
"platform/ax_unique_id.h",
"platform/compute_attributes.cc",
"platform/compute_attributes.h",
]
if (has_native_accessibility) {
sources += [
"platform/ax_fragment_root_win.cc",
"platform/ax_fragment_root_win.h",
"platform/ax_platform_node_mac.h",
"platform/ax_platform_node_mac.mm",
"platform/ax_platform_node_textprovider_win.cc",
"platform/ax_platform_node_textprovider_win.h",
"platform/ax_platform_node_textrangeprovider_win.cc",
"platform/ax_platform_node_textrangeprovider_win.h",
"platform/ax_platform_node_win.cc",
"platform/ax_platform_node_win.h",
"platform/ax_platform_relation_win.cc",
"platform/ax_platform_relation_win.h",
"platform/ax_system_caret_win.cc",
"platform/ax_system_caret_win.h",
]
}
defines = [ "ACCESSIBILITY_IMPLEMENTATION" ]
deps = [
"//third_party/cld_3/src/src:cld_3",
]
public_deps = [
":ax_constants_mojo",
":ax_enums_mojo",
"//base",
"//base:i18n",
"//ui/base",
"//ui/display",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/strings",
]
if (is_win) {
public_deps += [ "//third_party/iaccessible2" ]
libs = [
"oleacc.lib",
"uiautomationcore.lib",
]
}
if (is_mac) {
libs = [
"AppKit.framework",
"Foundation.framework",
]
}
if (use_atk) {
sources += [
"platform/atk_util_auralinux.cc",
"platform/atk_util_auralinux.h",
"platform/atk_util_auralinux_gtk.cc",
"platform/ax_platform_atk_hyperlink.cc",
"platform/ax_platform_atk_hyperlink.h",
"platform/ax_platform_node_auralinux.cc",
"platform/ax_platform_node_auralinux.h",
]
configs += [ "//build/config/linux/atk" ]
if (use_glib) {
configs += [ "//build/config/linux:glib" ]
}
if (use_x11) {
sources += [ "platform/atk_util_auralinux_x11.cc" ]
configs += [ "//build/config/linux:x11" ]
public_deps += [
"//ui/events/x",
"//ui/gfx/x",
]
}
}
if (use_aura) {
sources += [
"platform/aura_window_properties.cc",
"platform/aura_window_properties.h",
]
public_deps += [ "//ui/aura" ]
}
}
source_set("ax_assistant") {
sources = [
"ax_assistant_structure.cc",
"ax_assistant_structure.h",
]
deps = [
":accessibility",
]
}
static_library("test_support") {
testonly = true
sources = [
"platform/test_ax_node_wrapper.cc",
"platform/test_ax_node_wrapper.h",
"tree_generator.cc",
"tree_generator.h",
]
deps = [
":accessibility",
]
}
test("accessibility_unittests") {
testonly = true
sources = [
"ax_enum_util_unittest.cc",
"ax_event_generator_unittest.cc",
"ax_generated_tree_unittest.cc",
"ax_language_info_unittest.cc",
"ax_node_data_unittest.cc",
"ax_node_position_unittest.cc",
"ax_role_properties_unittest.cc",
"ax_table_info_unittest.cc",
"ax_text_utils_unittest.cc",
"ax_tree_combiner_unittest.cc",
"ax_tree_serializer_unittest.cc",
"ax_tree_unittest.cc",
"mojom/ax_action_data_mojom_traits_unittest.cc",
"mojom/ax_event_mojom_traits_unittest.cc",
"mojom/ax_node_data_mojom_traits_unittest.cc",
"mojom/ax_relative_bounds_mojom_traits_unittest.cc",
"mojom/ax_tree_data_mojom_traits_unittest.cc",
"mojom/ax_tree_id_mojom_traits_unittest.cc",
"mojom/ax_tree_update_mojom_traits_unittest.cc",
"platform/ax_fragment_root_win_unittest.cc",
"platform/ax_platform_node_textprovider_win_unittest.cc",
"platform/ax_platform_node_textrangeprovider_win_unittest.cc",
"platform/ax_platform_node_unittest.cc",
"platform/ax_platform_node_unittest.h",
"platform/ax_platform_node_win_unittest.cc",
"platform/ax_platform_node_win_unittest.h",
"platform/ax_unique_id_unittest.cc",
"run_all_unittests.cc",
]
deps = [
":accessibility",
":ax_constants_mojo",
":ax_enums_mojo",
":test_support",
"//base",
"//base/test:test_support",
"//mojo/core/embedder",
"//mojo/core/test:test_support",
"//mojo/public/cpp/test_support:test_utils",
"//skia",
"//testing/gmock",
"//testing/gtest",
"//ui/accessibility/mojom",
"//ui/base",
"//ui/gfx",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
]
if (is_win) {
deps += [ "//third_party/iaccessible2" ]
libs = [ "oleacc.lib" ]
}
if (use_atk) {
sources += [
"platform/atk_util_auralinux_unittest.cc",
"platform/ax_platform_node_auralinux_unittest.cc",
]
configs += [ "//build/config/linux/atk" ]
}
}
fuzzer_test("ax_tree_fuzzer") {
sources = [
"ax_tree_fuzzer.cc",
]
deps = [
":accessibility",
]
}
fuzzer_test("ax_table_fuzzer") {
sources = [
"ax_table_fuzzer.cc",
]
deps = [
":accessibility",
]
seed_corpus = "fuzz_corpus"
}
source_set("ax_host_manifest") {
sources = [
"ax_host_manifest.cc",
"ax_host_manifest.h",
]
deps = [
"//base",
"//services/service_manager/public/cpp",
"//ui/accessibility/mojom",
]
}