BUILD.gn 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  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/ozone.gni")
  6. import("//build/config/ui.gni")
  7. import("//testing/test.gni")
  8. import("//ui/base/ui_features.gni")
  9. if (is_android) {
  10. import("//build/config/android/rules.gni")
  11. }
  12. if (is_ios) {
  13. import("//ios/build/config.gni")
  14. }
  15. static_library("dom_keycode_converter") {
  16. public = [
  17. "keycodes/dom/dom_code.h",
  18. "keycodes/dom/dom_codes_array.h",
  19. "keycodes/dom/dom_key.h",
  20. "keycodes/dom/keycode_converter.h",
  21. ]
  22. sources = [
  23. "keycodes/dom/dom_code_data.inc",
  24. "keycodes/dom/dom_key_data.inc",
  25. "keycodes/dom/keycode_converter.cc",
  26. ]
  27. deps = [ "//base" ]
  28. if (!is_ios) {
  29. deps += [ "//ipc:param_traits" ]
  30. }
  31. }
  32. static_library("dom_keyboard_layout") {
  33. public = [
  34. "keycodes/dom/dom_keyboard_layout.h",
  35. "keycodes/dom/dom_keyboard_layout_manager.h",
  36. ]
  37. sources = [
  38. "keycodes/dom/dom_keyboard_layout.cc",
  39. "keycodes/dom/dom_keyboard_layout_manager.cc",
  40. ]
  41. deps = [
  42. ":dom_keycode_converter",
  43. ":events_base",
  44. "//base",
  45. ]
  46. if (is_win || is_mac || use_ozone) {
  47. public += [ "keycodes/dom/dom_keyboard_layout_map.h" ]
  48. sources += [
  49. "keycodes/dom/dom_keyboard_layout_map_base.cc",
  50. "keycodes/dom/dom_keyboard_layout_map_base.h",
  51. ]
  52. }
  53. # Make sure we don't compile two versions of dom_keyboard_layout_map*
  54. if (is_mac) {
  55. sources += [ "keycodes/dom/dom_keyboard_layout_map_mac.mm" ]
  56. } else if (is_win) {
  57. sources += [ "keycodes/dom/dom_keyboard_layout_map_win.cc" ]
  58. } else if (use_ozone) {
  59. sources += [ "keycodes/dom/dom_keyboard_layout_map_ozone.cc" ]
  60. deps += [ "//ui/events/ozone/layout" ]
  61. }
  62. if (!is_ios) {
  63. deps += [ "//ipc:param_traits" ]
  64. }
  65. # Expose the internals of this target to other packages in this BUILD file
  66. # so the unit tests can access the private header files.
  67. # Note: Only 'events_unittests' needs access in this file, however it uses a
  68. # template which generates different target names on different platforms.
  69. friend = [ ":*" ]
  70. }
  71. source_set("event_constants") {
  72. sources = [ "event_constants.h" ]
  73. }
  74. source_set("platform_event") {
  75. sources = [ "platform_event.h" ]
  76. public_deps = [ "//base" ]
  77. }
  78. component("events_base") {
  79. sources = [
  80. "base_event_utils.cc",
  81. "base_event_utils.h",
  82. "event_switches.cc",
  83. "event_switches.h",
  84. "events_base_export.h",
  85. "gesture_curve.h",
  86. "gesture_event_details.cc",
  87. "gesture_event_details.h",
  88. "gestures/fixed_velocity_curve.cc",
  89. "gestures/fixed_velocity_curve.h",
  90. "gestures/fling_curve.cc",
  91. "gestures/fling_curve.h",
  92. "gestures/physics_based_fling_curve.cc",
  93. "gestures/physics_based_fling_curve.h",
  94. "keycodes/dom_us_layout_data.h",
  95. "keycodes/keyboard_code_conversion.cc",
  96. "keycodes/keyboard_code_conversion.h",
  97. "keycodes/keyboard_codes.h",
  98. "mobile_scroller.cc",
  99. "mobile_scroller.h",
  100. "pointer_details.cc",
  101. "pointer_details.h",
  102. ]
  103. if (is_android) {
  104. sources += [
  105. "keycodes/keyboard_code_conversion_android.cc",
  106. "keycodes/keyboard_code_conversion_android.h",
  107. ]
  108. }
  109. if (is_mac) {
  110. sources += [
  111. "keycodes/keyboard_code_conversion_mac.h",
  112. "keycodes/keyboard_code_conversion_mac.mm",
  113. ]
  114. }
  115. if (is_win) {
  116. sources += [
  117. "keycodes/keyboard_code_conversion_win.cc",
  118. "keycodes/keyboard_code_conversion_win.h",
  119. "keycodes/keyboard_codes_win.h",
  120. "keycodes/keyboard_defines_win.h",
  121. ]
  122. }
  123. defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
  124. deps = [
  125. ":dom_keycode_converter",
  126. "//base/third_party/dynamic_annotations",
  127. "//build:chromeos_buildflags",
  128. ]
  129. public_deps = [
  130. ":event_constants",
  131. ":platform_event",
  132. "//base",
  133. "//ui/events/platform",
  134. "//ui/events/types:headers",
  135. "//ui/gfx/geometry",
  136. ]
  137. if (is_fuchsia) {
  138. sources += [
  139. "keycodes/keyboard_code_conversion_fuchsia.cc",
  140. "keycodes/keyboard_code_conversion_fuchsia.h",
  141. ]
  142. deps += [ "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.input3" ]
  143. }
  144. if (ozone_platform_x11) {
  145. public_deps += [ "//ui/events/keycodes:x11" ]
  146. # TODO(https://crbug.com/1076277): This dependency on //ui/gfx/x
  147. # is unnecessary and should be removed. It is included for now
  148. # to work around a bug in lld that introduces unnecessary
  149. # nondeterminism in the DSO (see c#6 on the bug for an
  150. # explanation).
  151. deps += [ "//ui/gfx/x" ]
  152. }
  153. if (!is_ios) {
  154. deps += [ "//ipc:param_traits" ]
  155. }
  156. if (is_mac) {
  157. frameworks = [
  158. "AppKit.framework",
  159. "Carbon.framework",
  160. ]
  161. }
  162. }
  163. component("events") {
  164. public = [
  165. "cocoa/cocoa_event_utils.h",
  166. "event.h",
  167. "event_dispatcher.h",
  168. "event_handler.h",
  169. "event_modifiers.h",
  170. "event_observer.h",
  171. "event_processor.h",
  172. "event_rewriter.h",
  173. "event_sink.h",
  174. "event_source.h",
  175. "event_target.h",
  176. "event_target_iterator.h",
  177. "event_targeter.h",
  178. "event_utils.h",
  179. "events_export.h",
  180. "gestures/gesture_recognizer.h",
  181. "gestures/gesture_types.h",
  182. "null_event_targeter.h",
  183. "scoped_target_handler.h",
  184. ]
  185. sources = [
  186. "event.cc",
  187. "event_dispatcher.cc",
  188. "event_handler.cc",
  189. "event_modifiers.cc",
  190. "event_processor.cc",
  191. "event_rewriter.cc",
  192. "event_rewriter_continuation.h",
  193. "event_source.cc",
  194. "event_target.cc",
  195. "event_utils.cc",
  196. "events_exports.cc",
  197. "events_stub.cc",
  198. "gestures/gesture_recognizer.cc",
  199. "gestures/gesture_types.cc",
  200. "null_event_targeter.cc",
  201. "scoped_target_handler.cc",
  202. ]
  203. if (is_win) {
  204. public += [
  205. "win/events_win_utils.h",
  206. "win/system_event_state_lookup.h",
  207. ]
  208. sources += [
  209. "keycodes/platform_key_map_win.cc",
  210. "keycodes/platform_key_map_win.h",
  211. "win/events_win.cc",
  212. "win/events_win_utils.cc",
  213. "win/system_event_state_lookup.cc",
  214. ]
  215. }
  216. if (is_mac) {
  217. public += [ "gestures/gesture_recognizer_impl_mac.h" ]
  218. sources += [
  219. "cocoa/cocoa_event_utils.mm",
  220. "cocoa/events_mac.mm",
  221. "gestures/gesture_recognizer_impl_mac.cc",
  222. ]
  223. }
  224. if (is_linux || is_chromeos || is_win) {
  225. public += [ "keyboard_event_counter.h" ]
  226. sources += [ "keyboard_event_counter.cc" ]
  227. }
  228. defines = [ "EVENTS_IMPLEMENTATION" ]
  229. public_deps = [
  230. ":events_base",
  231. "//ui/display",
  232. "//ui/latency",
  233. ]
  234. deps = [
  235. ":dom_keycode_converter",
  236. ":gesture_detection",
  237. "//base/third_party/dynamic_annotations",
  238. "//skia",
  239. "//ui/base:features",
  240. "//ui/gfx",
  241. "//ui/gfx/geometry",
  242. ]
  243. # Expose the internals of this target to other packages in this BUILD file
  244. # so the unit tests can access the private header files.
  245. # Note: Only 'events_unittests' needs access in this file, however it uses a
  246. # template which generates different target names on different platforms.
  247. friend = [ ":*" ]
  248. if (ozone_platform_x11) {
  249. public += [ "x/x11_event_translation.h" ]
  250. sources += [ "x/x11_event_translation.cc" ]
  251. deps += [
  252. "//ui/base:features",
  253. "//ui/events/devices",
  254. "//ui/events/devices/x11",
  255. "//ui/events/x",
  256. "//ui/gfx/x",
  257. ]
  258. }
  259. if (use_glib) {
  260. configs += [ "//build/config/linux:glib" ]
  261. }
  262. if (use_ozone) {
  263. sources += [ "events_default.cc" ]
  264. }
  265. if (is_win && use_ozone) {
  266. sources -= [ "win/events_win.cc" ]
  267. }
  268. if (use_ozone) {
  269. public += [ "ozone/events_ozone.h" ]
  270. sources += [ "ozone/events_ozone.cc" ]
  271. deps += [
  272. "//ui/base:features",
  273. "//ui/events/ozone/layout",
  274. ]
  275. }
  276. if (use_aura) {
  277. public += [
  278. "gestures/gesture_provider_aura.h",
  279. "gestures/gesture_recognizer_impl.h",
  280. "gestures/motion_event_aura.h",
  281. ]
  282. sources += [
  283. "gestures/gesture_provider_aura.cc",
  284. "gestures/gesture_recognizer_impl.cc",
  285. "gestures/motion_event_aura.cc",
  286. ]
  287. deps += [ "//build:chromeos_buildflags" ]
  288. }
  289. if (is_win || is_mac || use_ozone) {
  290. sources -= [ "events_stub.cc" ]
  291. }
  292. if (is_android) {
  293. public += [
  294. "android/drag_event_android.h",
  295. "android/event_handler_android.h",
  296. "android/gesture_event_android.h",
  297. "android/gesture_event_type.h",
  298. "android/key_event_android.h",
  299. "android/key_event_utils.h",
  300. "android/motion_event_android.h",
  301. ]
  302. sources += [
  303. "android/drag_event_android.cc",
  304. "android/event_handler_android.cc",
  305. "android/gesture_event_android.cc",
  306. "android/key_event_android.cc",
  307. "android/key_event_utils.cc",
  308. "android/motion_event_android.cc",
  309. ]
  310. deps += [
  311. ":keyevent_jni_headers",
  312. ":motionevent_jni_headers",
  313. ]
  314. }
  315. if (is_mac) {
  316. frameworks = [ "AppKit.framework" ]
  317. }
  318. if (is_fuchsia) {
  319. public += [
  320. "fuchsia/input_event_dispatcher.h",
  321. "fuchsia/input_event_sink.h",
  322. "fuchsia/pointer_events_handler.h",
  323. ]
  324. sources += [
  325. "fuchsia/input_event_dispatcher.cc",
  326. "fuchsia/pointer_events_handler.cc",
  327. ]
  328. public_deps += [
  329. "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.input",
  330. "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.pointer",
  331. ]
  332. }
  333. }
  334. component("keyboard_hook") {
  335. public = [ "keyboard_hook.h" ]
  336. defines = [ "IS_KEYBOARD_HOOK_IMPL" ]
  337. sources = [
  338. "keyboard_hook_base.cc",
  339. "keyboard_hook_base.h",
  340. ]
  341. deps = [
  342. "//base",
  343. "//ui/events",
  344. "//ui/events:dom_keycode_converter",
  345. "//ui/gfx",
  346. ]
  347. # Expose the internals of this target to other packages in this BUILD file
  348. # so the unit tests can access the private header files.
  349. friend = [ ":*" ]
  350. if (is_win) {
  351. public += [
  352. "win/keyboard_hook_monitor.h",
  353. "win/keyboard_hook_observer.h",
  354. ]
  355. sources += [
  356. "win/keyboard_hook_monitor_impl.cc",
  357. "win/keyboard_hook_monitor_impl.h",
  358. "win/keyboard_hook_win_base.cc",
  359. "win/keyboard_hook_win_base.h",
  360. "win/media_keyboard_hook_win.cc",
  361. "win/modifier_keyboard_hook_win.cc",
  362. ]
  363. }
  364. if (is_mac) {
  365. sources += [ "mac/keyboard_hook_mac.mm" ]
  366. }
  367. if (use_ozone) {
  368. public += [ "ozone/keyboard_hook_ozone.h" ]
  369. sources += [ "ozone/keyboard_hook_ozone.cc" ]
  370. deps += [
  371. "//ui/base:features",
  372. "//ui/ozone",
  373. ]
  374. }
  375. if (is_android) {
  376. sources += [ "android/keyboard_hook_android.cc" ]
  377. }
  378. }
  379. component("gesture_detection") {
  380. sources = [
  381. "gesture_detection/bitset_32.h",
  382. "gesture_detection/filtered_gesture_provider.cc",
  383. "gesture_detection/filtered_gesture_provider.h",
  384. "gesture_detection/gesture_configuration.cc",
  385. "gesture_detection/gesture_configuration.h",
  386. "gesture_detection/gesture_detection_export.h",
  387. "gesture_detection/gesture_detector.cc",
  388. "gesture_detection/gesture_detector.h",
  389. "gesture_detection/gesture_event_data.cc",
  390. "gesture_detection/gesture_event_data.h",
  391. "gesture_detection/gesture_event_data_packet.cc",
  392. "gesture_detection/gesture_event_data_packet.h",
  393. "gesture_detection/gesture_listeners.cc",
  394. "gesture_detection/gesture_listeners.h",
  395. "gesture_detection/gesture_provider.cc",
  396. "gesture_detection/gesture_provider.h",
  397. "gesture_detection/gesture_provider_config_helper.cc",
  398. "gesture_detection/gesture_provider_config_helper.h",
  399. "gesture_detection/gesture_touch_uma_histogram.cc",
  400. "gesture_detection/gesture_touch_uma_histogram.h",
  401. "gesture_detection/motion_event.cc",
  402. "gesture_detection/motion_event.h",
  403. "gesture_detection/motion_event_buffer.cc",
  404. "gesture_detection/motion_event_buffer.h",
  405. "gesture_detection/motion_event_generic.cc",
  406. "gesture_detection/motion_event_generic.h",
  407. "gesture_detection/scale_gesture_detector.cc",
  408. "gesture_detection/scale_gesture_detector.h",
  409. "gesture_detection/scale_gesture_listeners.cc",
  410. "gesture_detection/scale_gesture_listeners.h",
  411. "gesture_detection/snap_scroll_controller.cc",
  412. "gesture_detection/snap_scroll_controller.h",
  413. "gesture_detection/touch_disposition_gesture_filter.cc",
  414. "gesture_detection/touch_disposition_gesture_filter.h",
  415. "gesture_detection/velocity_tracker.cc",
  416. "gesture_detection/velocity_tracker.h",
  417. "gesture_detection/velocity_tracker_state.cc",
  418. "gesture_detection/velocity_tracker_state.h",
  419. ]
  420. deps = [
  421. ":events_base",
  422. "//base",
  423. "//base/third_party/dynamic_annotations",
  424. "//build:chromeos_buildflags",
  425. "//ui/display",
  426. "//ui/gfx",
  427. "//ui/gfx/geometry",
  428. ]
  429. defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
  430. if (is_android) {
  431. sources += [ "gesture_detection/gesture_configuration_android.cc" ]
  432. } else if (is_castos) {
  433. sources += [ "gesture_detection/gesture_configuration_cast.cc" ]
  434. } else if (use_aura) {
  435. sources += [ "gesture_detection/gesture_configuration_aura.cc" ]
  436. } else {
  437. sources += [ "gesture_detection/gesture_configuration_default.cc" ]
  438. }
  439. }
  440. static_library("test_support") {
  441. sources = [
  442. "test/event_generator.cc",
  443. "test/event_generator.h",
  444. "test/events_test_utils.cc",
  445. "test/events_test_utils.h",
  446. "test/keyboard_layout.cc",
  447. "test/keyboard_layout.h",
  448. "test/motion_event_test_utils.cc",
  449. "test/motion_event_test_utils.h",
  450. "test/platform_event_source_test_api.cc",
  451. "test/platform_event_source_test_api.h",
  452. "test/test_event.cc",
  453. "test/test_event.h",
  454. "test/test_event_handler.cc",
  455. "test/test_event_handler.h",
  456. "test/test_event_processor.cc",
  457. "test/test_event_processor.h",
  458. "test/test_event_rewriter.cc",
  459. "test/test_event_rewriter.h",
  460. "test/test_event_rewriter_continuation.h",
  461. "test/test_event_source.cc",
  462. "test/test_event_source.h",
  463. "test/test_event_target.cc",
  464. "test/test_event_target.h",
  465. "test/test_event_targeter.cc",
  466. "test/test_event_targeter.h",
  467. ]
  468. if (is_mac) {
  469. sources += [
  470. "test/cocoa_test_event_utils.h",
  471. "test/cocoa_test_event_utils.mm",
  472. "test/keyboard_layout_mac.cc",
  473. ]
  474. }
  475. public_deps = [
  476. ":dom_keycode_converter",
  477. ":events",
  478. ":events_base",
  479. ":gesture_detection",
  480. "//ui/events/devices",
  481. ]
  482. deps = [
  483. "//base",
  484. "//build:chromeos_buildflags",
  485. "//skia",
  486. "//ui/events/platform",
  487. "//ui/gfx",
  488. "//ui/gfx/geometry",
  489. ]
  490. if (is_win) {
  491. sources += [
  492. "test/keyboard_hook_monitor_utils.cc",
  493. "test/keyboard_hook_monitor_utils.h",
  494. "test/keyboard_layout_win.cc",
  495. ]
  496. deps += [ "//ui/events:keyboard_hook" ]
  497. }
  498. if (is_mac) {
  499. frameworks = [ "Carbon.framework" ]
  500. }
  501. if (ozone_platform_x11) {
  502. sources += [
  503. "test/events_test_utils_x11.cc",
  504. "test/events_test_utils_x11.h",
  505. "test/x11_event_waiter.cc",
  506. "test/x11_event_waiter.h",
  507. ]
  508. deps += [
  509. "//ui/events/devices/x11",
  510. "//ui/events/keycodes:x11",
  511. "//ui/events/platform/x11",
  512. "//ui/events/x",
  513. "//ui/gfx/x",
  514. ]
  515. }
  516. if (use_ozone) {
  517. deps += [
  518. "//ui/base:features",
  519. "//ui/events/ozone/layout",
  520. ]
  521. }
  522. if (is_fuchsia) {
  523. sources += [
  524. "fuchsia/fakes/fake_mouse_source.cc",
  525. "fuchsia/fakes/fake_mouse_source.h",
  526. "fuchsia/fakes/fake_touch_source.cc",
  527. "fuchsia/fakes/fake_touch_source.h",
  528. "fuchsia/fakes/pointer_event_utility.cc",
  529. "fuchsia/fakes/pointer_event_utility.h",
  530. ]
  531. deps += [ "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.pointer" ]
  532. }
  533. }
  534. if (!is_ios) {
  535. test("events_unittests") {
  536. use_xvfb = use_xvfb_in_this_config
  537. sources = [
  538. "blink/blink_event_util_unittest.cc",
  539. "blink/fling_booster_unittest.cc",
  540. "blink/web_input_event_traits_unittest.cc",
  541. "blink/web_input_event_unittest.cc",
  542. "event_dispatcher_unittest.cc",
  543. "event_processor_unittest.cc",
  544. "event_rewriter_unittest.cc",
  545. "event_target_unittest.cc",
  546. "event_unittest.cc",
  547. "gesture_detection/bitset_32_unittest.cc",
  548. "gesture_detection/filtered_gesture_provider_unittest.cc",
  549. "gesture_detection/gesture_event_data_packet_unittest.cc",
  550. "gesture_detection/gesture_provider_unittest.cc",
  551. "gesture_detection/motion_event_buffer_unittest.cc",
  552. "gesture_detection/motion_event_generic_unittest.cc",
  553. "gesture_detection/snap_scroll_controller_unittest.cc",
  554. "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
  555. "gesture_detection/velocity_tracker_unittest.cc",
  556. "gestures/blink/web_gesture_curve_impl_unittest.cc",
  557. "gestures/fling_curve_unittest.cc",
  558. "gestures/physics_based_fling_curve_unittest.cc",
  559. "keycodes/dom/keycode_converter_unittest.cc",
  560. "keycodes/keyboard_code_conversion_unittest.cc",
  561. "mobile_scroller_unittest.cc",
  562. "mojom/mojom_traits_unittest.cc",
  563. "platform/platform_event_source_unittest.cc",
  564. "scoped_target_handler_unittest.cc",
  565. ]
  566. if (is_mac) {
  567. sources += [ "cocoa/events_mac_unittest.mm" ]
  568. }
  569. if (is_linux || is_chromeos || is_win) {
  570. sources += [ "keyboard_event_counter_unittest.cc" ]
  571. }
  572. deps = [
  573. ":dom_keyboard_layout",
  574. ":dom_keycode_converter",
  575. ":events",
  576. ":events_base",
  577. ":gesture_detection",
  578. ":test_support",
  579. "//base",
  580. "//base/test:test_support",
  581. "//cc",
  582. "//ipc:test_support",
  583. "//mojo/core/test:run_all_unittests",
  584. "//mojo/public/cpp/bindings",
  585. "//mojo/public/cpp/test_support:test_utils",
  586. "//skia",
  587. "//testing/gmock",
  588. "//testing/gtest",
  589. "//third_party/blink/public:blink_headers",
  590. "//ui/base:test_support",
  591. "//ui/display",
  592. "//ui/events/blink",
  593. "//ui/events/devices",
  594. "//ui/events/gestures/blink",
  595. "//ui/events/mojom",
  596. "//ui/events/platform",
  597. "//ui/gfx/geometry/mojom:mojom_traits",
  598. "//ui/gfx/ipc/geometry",
  599. ]
  600. if (is_android) {
  601. sources += [ "android/motion_event_android_unittest.cc" ]
  602. deps += [ "//ui/android:ui_full_java" ]
  603. } else {
  604. data_deps = [ "//third_party/mesa_headers" ]
  605. }
  606. if (use_ozone) {
  607. sources += [ "devices/device_data_manager_unittest.cc" ]
  608. }
  609. if (use_ozone) {
  610. deps += [
  611. "//ui/events/ozone:unittests",
  612. "//ui/events/ozone/layout",
  613. ]
  614. }
  615. if (use_aura) {
  616. sources += [
  617. "gestures/gesture_provider_aura_unittest.cc",
  618. "gestures/motion_event_aura_unittest.cc",
  619. ]
  620. }
  621. if (is_win) {
  622. sources += [
  623. "blink/web_input_event_builders_win_unittest.cc",
  624. "keycodes/platform_key_map_win_unittest.cc",
  625. "win/event_utils_win_unittest.cc",
  626. "win/media_keyboard_hook_win_unittest.cc",
  627. "win/modifier_keyboard_hook_win_unittest.cc",
  628. ]
  629. deps += [ "//ui/events:keyboard_hook" ]
  630. }
  631. if (is_castos) {
  632. sources += [ "chromecast/scroller_unittest.cc" ]
  633. }
  634. if (is_fuchsia) {
  635. sources += [
  636. "fuchsia/input_event_dispatcher_unittest.cc",
  637. "fuchsia/pointer_events_handler_unittest.cc",
  638. "keycodes/keyboard_code_conversion_fuchsia_unittest.cc",
  639. ]
  640. deps += [
  641. "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.input",
  642. "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.input3",
  643. "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.pointer",
  644. ]
  645. }
  646. if (is_win || is_mac || use_ozone) {
  647. sources += [ "keycodes/dom/dom_keyboard_layout_map_unittest.cc" ]
  648. deps += [ ":dom_keyboard_layout" ]
  649. }
  650. }
  651. }
  652. if (is_android) {
  653. generate_jar_jni("motionevent_jni_headers") {
  654. classes = [ "android/view/MotionEvent.class" ]
  655. }
  656. generate_jar_jni("keyevent_jni_headers") {
  657. classes = [ "android/view/KeyEvent.class" ]
  658. }
  659. }
  660. # This target is added as a dependency of browser interactive_ui_tests. It must
  661. # be source_set, otherwise the linker will drop the tests as dead code.
  662. source_set("events_interactive_ui_tests") {
  663. testonly = true
  664. if (is_win) {
  665. sources = [ "win/media_keyboard_hook_win_interactive_test.cc" ]
  666. deps = [
  667. ":events",
  668. ":keyboard_hook",
  669. ":test_support",
  670. "//base/test:test_support",
  671. "//testing/gtest",
  672. ]
  673. }
  674. }