BUILD.gn 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. # Copyright 2014 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/config/features.gni")
  5. import("//build/config/linux/pkg_config.gni")
  6. import("//build/config/ui.gni")
  7. import("//mojo/public/tools/bindings/mojom.gni")
  8. import("//testing/libfuzzer/fuzzer_test.gni")
  9. import("//testing/test.gni")
  10. import("//tools/json_schema_compiler/json_schema_api.gni")
  11. import("//ui/base/ui_features.gni")
  12. if (is_android) {
  13. import("//build/config/android/rules.gni")
  14. }
  15. if (is_win) {
  16. import("//build/toolchain/win/midl.gni")
  17. }
  18. mojom("ax_constants_mojo") {
  19. generate_java = true
  20. sources = [ "ax_constants.mojom" ]
  21. }
  22. mojom_component("ax_enums_mojo") {
  23. generate_java = true
  24. sources = [ "ax_enums.mojom" ]
  25. macro_prefix = "UI_ACCESSIBILITY_AX_MOJOM"
  26. output_prefix = "ui_accessibility_ax_mojom"
  27. }
  28. # A tiny subset of accessibility code that's allowed to be
  29. # included by Blink. The rule of thumb (for now) is that it's
  30. # anything platform-neutral (no platform/ directory) that
  31. # relates to a single accessibility node (no trees, etc.).
  32. component("ax_base") {
  33. defines = [ "AX_BASE_IMPLEMENTATION" ]
  34. sources = [
  35. "accessibility_features.cc",
  36. "accessibility_features.h",
  37. "accessibility_switches.cc",
  38. "accessibility_switches.h",
  39. "ax_action_data.cc",
  40. "ax_action_data.h",
  41. "ax_action_handler.cc",
  42. "ax_action_handler.h",
  43. "ax_action_handler_base.cc",
  44. "ax_action_handler_base.h",
  45. "ax_action_handler_registry.cc",
  46. "ax_action_handler_registry.h",
  47. "ax_base_export.h",
  48. "ax_enum_util.cc",
  49. "ax_enum_util.h",
  50. "ax_event.cc",
  51. "ax_event.h",
  52. "ax_event_intent.cc",
  53. "ax_event_intent.h",
  54. "ax_mode.cc",
  55. "ax_mode.h",
  56. "ax_node_data.cc",
  57. "ax_node_data.h",
  58. "ax_node_id_forward.h",
  59. "ax_relative_bounds.cc",
  60. "ax_relative_bounds.h",
  61. "ax_role_properties.cc",
  62. "ax_role_properties.h",
  63. "ax_text_attributes.cc",
  64. "ax_text_attributes.h",
  65. "ax_tree_data.cc",
  66. "ax_tree_data.h",
  67. "ax_tree_id.cc",
  68. "ax_tree_id.h",
  69. "ax_tree_update.cc",
  70. "ax_tree_update.h",
  71. "ax_tree_update_forward.h",
  72. ]
  73. if (!is_chromeos_ash) {
  74. sources += [
  75. "ax_enum_localization_util.cc",
  76. "ax_enum_localization_util.h",
  77. ]
  78. }
  79. public_deps = [
  80. ":ax_constants_mojo",
  81. ":ax_enums_mojo",
  82. "//base",
  83. "//ui/gfx",
  84. "//ui/gfx/geometry",
  85. ]
  86. if (!is_chromeos_ash) {
  87. public_deps += [
  88. "//base:i18n",
  89. "//ui/base",
  90. "//ui/strings",
  91. ]
  92. }
  93. deps = [ "//build:chromeos_buildflags" ]
  94. if (is_chromeos_ash) {
  95. deps += [ "//ash/constants" ]
  96. }
  97. }
  98. #if (is_win) {
  99. # midl("ichromeaccessible") {
  100. # sources = [
  101. # "platform/ichromeaccessible.idl",
  102. # ]
  103. # }
  104. #}
  105. component("accessibility") {
  106. defines = [ "AX_IMPLEMENTATION" ]
  107. sources = [
  108. "ax_action_target.h",
  109. "ax_active_popup.cc",
  110. "ax_active_popup.h",
  111. "ax_clipping_behavior.h",
  112. "ax_computed_node_data.cc",
  113. "ax_computed_node_data.h",
  114. "ax_coordinate_system.h",
  115. "ax_event_generator.cc",
  116. "ax_event_generator.h",
  117. "ax_export.h",
  118. "ax_hypertext.cc",
  119. "ax_hypertext.h",
  120. "ax_language_detection.cc",
  121. "ax_language_detection.h",
  122. "ax_live_region_tracker.cc",
  123. "ax_live_region_tracker.h",
  124. "ax_mode_observer.h",
  125. "ax_node.cc",
  126. "ax_node.h",
  127. "ax_node_position.cc",
  128. "ax_node_position.h",
  129. "ax_offscreen_result.h",
  130. "ax_position.h",
  131. "ax_range.h",
  132. "ax_serializable_tree.cc",
  133. "ax_serializable_tree.h",
  134. "ax_table_info.cc",
  135. "ax_table_info.h",
  136. "ax_text_utils.cc",
  137. "ax_text_utils.h",
  138. "ax_tree.cc",
  139. "ax_tree.h",
  140. "ax_tree_combiner.cc",
  141. "ax_tree_combiner.h",
  142. "ax_tree_manager.cc",
  143. "ax_tree_manager.h",
  144. "ax_tree_manager_base.cc",
  145. "ax_tree_manager_base.h",
  146. "ax_tree_manager_map.cc",
  147. "ax_tree_manager_map.h",
  148. "ax_tree_observer.cc",
  149. "ax_tree_observer.h",
  150. "ax_tree_serializer.cc",
  151. "ax_tree_serializer.h",
  152. "ax_tree_source.h",
  153. "ax_tree_source_annotator.h",
  154. "ax_tree_source_checker.h",
  155. "ax_tree_source_observer.h",
  156. "null_ax_action_target.cc",
  157. "null_ax_action_target.h",
  158. "test_ax_tree_manager.cc",
  159. "test_ax_tree_manager.h",
  160. ]
  161. deps = [
  162. "//base",
  163. "//components/crash/core/common:crash_key",
  164. "//third_party/cld_3/src/src:cld_3",
  165. ]
  166. public_deps = [
  167. ":ax_base",
  168. "//skia",
  169. "//ui/accessibility/platform",
  170. ]
  171. # Allows the files from //ui/accessibility/platform includes headers
  172. # from this directory.
  173. allow_circular_includes_from = [ "//ui/accessibility/platform" ]
  174. if (!is_ios) {
  175. sources += [
  176. "ax_param_traits.cc",
  177. "ax_param_traits.h",
  178. "ax_param_traits_macros.h",
  179. ]
  180. public_deps += [
  181. "//ipc",
  182. "//ui/gfx/ipc/skia",
  183. ]
  184. }
  185. if (is_fuchsia) {
  186. public_deps +=
  187. [ "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.accessibility.semantics" ]
  188. }
  189. if (use_aura) {
  190. sources += [
  191. "aura/aura_window_properties.cc",
  192. "aura/aura_window_properties.h",
  193. ]
  194. public_deps += [ "//ui/aura" ]
  195. }
  196. }
  197. source_set("ax_assistant") {
  198. sources = [
  199. "ax_assistant_structure.cc",
  200. "ax_assistant_structure.h",
  201. ]
  202. deps = [ ":accessibility" ]
  203. public_deps = [ ":ax_enums_mojo" ]
  204. }
  205. static_library("test_support") {
  206. testonly = true
  207. sources = [
  208. "platform/test_ax_tree_update.cc",
  209. "platform/test_ax_tree_update.h",
  210. "test_ax_node_helper.cc",
  211. "test_ax_node_helper.h",
  212. "test_ax_tree_update_json_reader.cc",
  213. "test_ax_tree_update_json_reader.h",
  214. "tree_generator.cc",
  215. "tree_generator.h",
  216. ]
  217. if (has_native_accessibility) {
  218. sources += [
  219. "platform/test_ax_node_wrapper.cc",
  220. "platform/test_ax_node_wrapper.h",
  221. ]
  222. }
  223. public_deps = [ ":accessibility" ]
  224. }
  225. test("accessibility_unittests") {
  226. testonly = true
  227. sources = [
  228. "ax_computed_node_data_unittest.cc",
  229. "ax_enum_util_unittest.cc",
  230. "ax_event_generator_unittest.cc",
  231. "ax_generated_tree_unittest.cc",
  232. "ax_language_detection_unittest.cc",
  233. "ax_node_data_unittest.cc",
  234. "ax_node_position_unittest.cc",
  235. "ax_node_unittest.cc",
  236. "ax_range_unittest.cc",
  237. "ax_role_properties_unittest.cc",
  238. "ax_table_info_unittest.cc",
  239. "ax_text_utils_unittest.cc",
  240. "ax_tree_combiner_unittest.cc",
  241. "ax_tree_id_unittest.cc",
  242. "ax_tree_manager_base_unittest.cc",
  243. "ax_tree_serializer_unittest.cc",
  244. "ax_tree_source_checker_unittest.cc",
  245. "ax_tree_unittest.cc",
  246. "mojom/ax_action_data_mojom_traits_unittest.cc",
  247. "mojom/ax_event_intent_mojom_traits_unittest.cc",
  248. "mojom/ax_event_mojom_traits_unittest.cc",
  249. "mojom/ax_node_data_mojom_traits_unittest.cc",
  250. "mojom/ax_relative_bounds_mojom_traits_unittest.cc",
  251. "mojom/ax_tree_data_mojom_traits_unittest.cc",
  252. "mojom/ax_tree_id_mojom_traits_unittest.cc",
  253. "mojom/ax_tree_update_mojom_traits_unittest.cc",
  254. "null_ax_action_target_unittest.cc",
  255. "platform/ax_platform_node_unittest.cc",
  256. "platform/ax_platform_node_unittest.h",
  257. "platform/ax_unique_id_unittest.cc",
  258. "platform/inspect/ax_inspect_scenario_unittest.cc",
  259. "platform/inspect/ax_inspect_test_helper_unittest.cc",
  260. "platform/inspect/ax_inspect_utils_unittest.cc",
  261. "platform/inspect/ax_property_node_unittest.cc",
  262. "platform/inspect/ax_script_instruction_unittest.cc",
  263. "run_all_unittests.cc",
  264. ]
  265. deps = [
  266. ":accessibility",
  267. ":test_support",
  268. "//base/test:test_support",
  269. "//ipc",
  270. "//mojo/core/embedder",
  271. "//mojo/core/test:test_support",
  272. "//mojo/public/cpp/test_support:test_utils",
  273. "//skia",
  274. "//testing/gmock",
  275. "//testing/gtest",
  276. "//ui/accessibility/mojom",
  277. "//ui/gfx:test_support",
  278. ]
  279. if (is_fuchsia) {
  280. sources += [
  281. "platform/fuchsia/accessibility_bridge_fuchsia_unittest.cc",
  282. "platform/fuchsia/semantic_provider_unittest.cc",
  283. ]
  284. deps += [
  285. "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.accessibility.semantics",
  286. "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.math",
  287. "//third_party/fuchsia-sdk/sdk/pkg/inspect",
  288. "//third_party/fuchsia-sdk/sdk/pkg/scenic_cpp",
  289. "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
  290. ]
  291. }
  292. if (has_native_accessibility) {
  293. # This test depends heavily on NativeViewAccessible, which is only
  294. # implemented on these platforms.
  295. sources += [ "platform/ax_platform_node_base_unittest.cc" ]
  296. if (is_win) {
  297. sources += [
  298. "platform/ax_fragment_root_win_unittest.cc",
  299. "platform/ax_platform_node_textchildprovider_win_unittest.cc",
  300. "platform/ax_platform_node_textprovider_win_unittest.cc",
  301. "platform/ax_platform_node_textrangeprovider_win_unittest.cc",
  302. "platform/ax_platform_node_win_unittest.cc",
  303. "platform/ax_platform_node_win_unittest.h",
  304. ]
  305. deps += [
  306. "//third_party/iaccessible2",
  307. "//ui/accessibility/platform:ichromeaccessible",
  308. ]
  309. libs = [
  310. "oleacc.lib",
  311. "uiautomationcore.lib",
  312. ]
  313. }
  314. if (use_atk) {
  315. sources += [
  316. "platform/atk_util_auralinux_unittest.cc",
  317. "platform/ax_platform_node_auralinux_unittest.cc",
  318. ]
  319. configs += [ "//build/config/linux/atk" ]
  320. }
  321. }
  322. }
  323. fuzzer_test("ax_tree_fuzzer") {
  324. sources = [ "ax_tree_fuzzer.cc" ]
  325. deps = [ ":accessibility" ]
  326. }
  327. fuzzer_test("ax_table_fuzzer") {
  328. sources = [ "ax_table_fuzzer.cc" ]
  329. deps = [ ":accessibility" ]
  330. seed_corpus = "fuzz_corpus"
  331. }
  332. fuzzer_test("ax_node_position_fuzzer") {
  333. sources = [
  334. "ax_node_position_fuzzer.cc",
  335. "ax_tree_fuzzer_util.cc",
  336. "ax_tree_fuzzer_util.h",
  337. ]
  338. deps = [ ":accessibility" ]
  339. }
  340. if (is_win) {
  341. fuzzer_test("ax_platform_node_textrangeprovider_win_fuzzer") {
  342. sources = [
  343. "ax_tree_fuzzer_util.cc",
  344. "ax_tree_fuzzer_util.h",
  345. "platform/ax_platform_node_textrangeprovider_win_fuzzer.cc",
  346. ]
  347. deps = [
  348. ":accessibility",
  349. ":test_support",
  350. "//base/test:test_support",
  351. ]
  352. }
  353. }
  354. test("accessibility_perftests") {
  355. testonly = true
  356. sources = [ "ax_node_position_perftest.cc" ]
  357. deps = [
  358. ":test_support",
  359. "//base",
  360. "//base/test:test_support",
  361. "//mojo/core/test:run_all_unittests",
  362. "//skia",
  363. "//testing/gmock",
  364. "//testing/gtest",
  365. "//testing/perf",
  366. "//ui/accessibility/mojom",
  367. ]
  368. }