blob: a9cb6640f33dc5703c6e830b57e9a9d83ead65ac [file] [log] [blame]
Avi Drissman0db84842022-09-13 19:47:041# Copyright 2015 The Chromium Authors
tfarinacdc7e5d2015-02-23 09:52:242# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Yuta Hijikata57d60812020-10-24 01:00:555import("//build/config/chromeos/ui_mode.gni")
tfarinacdc7e5d2015-02-23 09:52:246import("//build/config/features.gni")
Scott Violetc8240b02018-03-08 22:03:597import("//device/vr/buildflags/buildflags.gni")
tfarinacdc7e5d2015-02-23 09:52:248import("//testing/test.gni")
9
scheib56010cc2015-06-25 01:29:4710if (is_android) {
mcasas649deb52017-04-28 01:55:5211 import("//build/config/android/config.gni")
Sam Maier2cb3f6d2023-09-08 14:50:2012 import("//build/config/android/rules.gni")
13 import("//third_party/jni_zero/jni_zero.gni")
scheib56010cc2015-06-25 01:29:4714}
15
erikchenceb2fff2015-04-27 17:50:5416if (is_mac) {
17 import("//build/config/mac/mac_sdk.gni")
18}
19
Sean McAllister224ef732020-08-04 17:27:5520is_linux_without_udev = (is_linux || is_chromeos) && !use_udev
scheib7a4cf042015-03-31 04:33:4421
tfarinacdc7e5d2015-02-23 09:52:2422test("device_unittests") {
23 sources = [
alexis.menardb39a30822016-09-30 15:14:3924 "base/synchronization/one_writer_seqlock_unittest.cc",
Julie Jeongeun Kimcc191202023-03-08 03:43:4025 "bluetooth/adapter_unittest.cc",
26 "bluetooth/advertisement_unittest.cc",
27 "bluetooth/bluetooth_adapter_unittest.cc",
28 "bluetooth/bluetooth_advertisement_unittest.cc",
29 "bluetooth/bluetooth_device_unittest.cc",
30 "bluetooth/bluetooth_discovery_filter_unittest.cc",
31 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
32 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
33 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
34 "bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc",
35 "bluetooth/bluetooth_remote_gatt_descriptor_unittest.cc",
36 "bluetooth/bluetooth_remote_gatt_service_unittest.cc",
37 "bluetooth/device_unittest.cc",
38 "bluetooth/public/cpp/bluetooth_uuid_unittest.cc",
39 "bluetooth/server_socket_unittest.cc",
40 "bluetooth/socket_unittest.cc",
41 "bluetooth/string_util_icu_unittest.cc",
42 "bluetooth/test/bluetooth_gatt_server_test.cc",
43 "bluetooth/test/bluetooth_gatt_server_test.h",
44 "bluetooth/test/bluetooth_test.cc",
45 "bluetooth/test/bluetooth_test.h",
46 "bluetooth/test/mock_pairing_delegate.cc",
47 "bluetooth/test/mock_pairing_delegate.h",
48 "bluetooth/test/test_bluetooth_adapter_observer.cc",
49 "bluetooth/test/test_bluetooth_adapter_observer.h",
50 "bluetooth/test/test_bluetooth_advertisement_observer.cc",
51 "bluetooth/test/test_bluetooth_advertisement_observer.h",
52 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc",
53 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.h",
Matt Reynolds7c498e52017-12-06 22:06:2454 "gamepad/abstract_haptic_gamepad_unittest.cc",
Matt Reynoldscdb73c32019-08-23 00:46:2955 "gamepad/dualshock4_controller_unittest.cc",
Matt Reynolds96bd76a2019-06-12 21:15:1656 "gamepad/gamepad_blocklist_unittest.cc",
Matt Reynolds054d99b2018-12-06 02:40:2457 "gamepad/gamepad_id_list_unittest.cc",
bajonesb9bb4c42016-07-07 00:10:5158 "gamepad/gamepad_provider_unittest.cc",
ke.hebee6a642016-12-10 01:56:1959 "gamepad/gamepad_service_unittest.cc",
Matt Reynolds27a13de2019-08-20 21:03:3360 "gamepad/hid_haptic_gamepad_unittest.cc",
Oksana Zhuravlova96b546c2018-08-08 19:01:3361 "gamepad/public/cpp/gamepad_mojom_traits_unittest.cc",
Matt Reynolds5fcd224792019-08-29 21:24:0162 "gamepad/xbox_hid_controller_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2463 "test/run_all_unittests.cc",
tfarinacdc7e5d2015-02-23 09:52:2464 ]
65
Julie Jeongeun Kimcc191202023-03-08 03:43:4066 if (is_apple) {
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:5467 sources += [
Julie Jeongeun Kimcc191202023-03-08 03:43:4068 "bluetooth/bluetooth_low_energy_adapter_apple_unittest.mm",
Sylvain Defresne72188072020-10-05 11:54:4169 "bluetooth/bluetooth_low_energy_advertisement_manager_mac_unittest.mm",
70 "bluetooth/test/bluetooth_test_mac.h",
71 "bluetooth/test/bluetooth_test_mac.mm",
72 "bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h",
73 "bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm",
74 "bluetooth/test/mock_bluetooth_cbdescriptor_mac.h",
75 "bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm",
76 "bluetooth/test/mock_bluetooth_cbperipheral_mac.h",
77 "bluetooth/test/mock_bluetooth_cbperipheral_mac.mm",
78 "bluetooth/test/mock_bluetooth_cbservice_mac.h",
79 "bluetooth/test/mock_bluetooth_cbservice_mac.mm",
80 "bluetooth/test/mock_bluetooth_central_manager_mac.h",
81 "bluetooth/test/mock_bluetooth_central_manager_mac.mm",
82 ]
83 }
84
Julie Jeongeun Kimcc191202023-03-08 03:43:4085 if (is_mac) {
86 sources += [ "bluetooth/bluetooth_adapter_mac_unittest.mm" ]
87 }
88
Sylvain Defresne72188072020-10-05 11:54:4189 if (is_android) {
90 sources += [
91 "bluetooth/bluetooth_adapter_android_unittest.cc",
92 "bluetooth/test/bluetooth_test_android.cc",
93 "bluetooth/test/bluetooth_test_android.h",
94 ]
95 }
96
97 if (is_win) {
98 sources += [
99 "bluetooth/bluetooth_adapter_win_unittest.cc",
100 "bluetooth/bluetooth_device_win_unittest.cc",
Sylvain Defresne72188072020-10-05 11:54:41101 "bluetooth/bluetooth_service_record_win_unittest.cc",
102 "bluetooth/bluetooth_task_manager_win_unittest.cc",
103 "bluetooth/test/bluetooth_test_win.cc",
104 "bluetooth/test/bluetooth_test_win.h",
Qiaofei Ye5a02f892021-02-05 01:49:15105 "gamepad/wgi_data_fetcher_win_unittest.cc",
Sylvain Defresne72188072020-10-05 11:54:41106 ]
107 }
108
Scott Grahambf77d352018-10-25 17:50:54109 if (is_fuchsia) {
110 sources += [
111 "bluetooth/test/bluetooth_test_fuchsia.cc",
112 "bluetooth/test/bluetooth_test_fuchsia.h",
113 ]
114 }
115
tfarinacdc7e5d2015-02-23 09:52:24116 deps = [
Ovidio Henriquez21095442019-03-06 18:22:55117 "//base",
tfarinacdc7e5d2015-02-23 09:52:24118 "//base/test:test_support",
alexis.menardb39a30822016-09-30 15:14:39119 "//base/third_party/dynamic_annotations:dynamic_annotations",
Yuta Hijikata57d60812020-10-24 01:00:55120 "//build:chromeos_buildflags",
Jun Choi3545f502018-03-14 01:30:00121 "//components/apdu",
Kim Paulhamus35995bb62018-01-05 11:47:04122 "//components/cbor",
Donna Wu4dc9df32019-05-20 03:56:21123 "//components/device_event_log",
Nina Satragno6eb69362024-02-12 23:30:36124 "//crypto:test_support",
Donna Wu4dc9df32019-05-20 03:56:21125 "//device/base",
alexis.menardb39a30822016-09-30 15:14:39126 "//device/base/synchronization",
Julie Jeongeun Kimcc191202023-03-08 03:43:40127 "//device/bluetooth",
128 "//device/bluetooth:deprecated_experimental_mojo",
129 "//device/bluetooth:fake_bluetooth",
130 "//device/bluetooth:mocks",
bajonesb9bb4c42016-07-07 00:10:51131 "//device/gamepad",
132 "//device/gamepad:test_helpers",
juncai2f298a82017-04-18 03:51:39133 "//device/gamepad/public/cpp:shared_with_blink",
James Hollyer24f30cb722021-06-18 21:22:24134 "//device/gamepad/public/cpp:switches",
Reilly Grantfa93b142018-02-01 02:13:48135 "//device/gamepad/public/mojom",
Ken Rockot9b26bc52018-07-04 19:57:49136 "//mojo/core/embedder",
rockot85dce0862015-11-13 01:33:59137 "//mojo/public/cpp/bindings",
Oksana Zhuravlova96b546c2018-08-08 19:01:33138 "//mojo/public/cpp/test_support:test_utils",
tfarinacdc7e5d2015-02-23 09:52:24139 "//net",
140 "//testing/gmock",
141 "//testing/gtest",
Blink Reformata30d4232018-04-07 15:31:06142 "//third_party/blink/public:blink_headers",
Ovidio Henriquez21095442019-03-06 18:22:55143 "//ui/base",
tfarinacdc7e5d2015-02-23 09:52:24144 "//url",
145 ]
146
Ovidio Henriquez21095442019-03-06 18:22:55147 data_deps = [
Julie Jeongeun Kimcc191202023-03-08 03:43:40148 "bluetooth/strings:bluetooth_test_strings",
Haiyang Pan1c813ca2021-11-24 18:52:16149 "//testing/buildbot/filters:device_unittests_filters",
Ovidio Henriquez21095442019-03-06 18:22:55150 "//ui/resources:ui_test_pak_data",
151 ]
152
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:54153 if (!is_ios) {
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:54154 deps += [
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:54155 "//device/fido",
156 "//device/fido:test_support",
157 ]
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:54158 }
159
Nina Satragno1867ead2020-06-15 18:38:13160 # Most of the FIDO implementation is not compiled in for Android.
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:54161 if (!is_android && !is_ios) {
Nina Satragno1867ead2020-06-15 18:38:13162 sources += [
163 "fido/attestation_statement_formats_unittest.cc",
Martin Kreichgauerdc572252020-10-16 17:46:10164 "fido/auth_token_requester_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13165 "fido/bio/enrollment_handler_unittest.cc",
166 "fido/ble_adapter_manager_unittest.cc",
167 "fido/cable/fido_ble_connection_unittest.cc",
168 "fido/cable/fido_ble_frames_unittest.cc",
169 "fido/cable/fido_ble_transaction_unittest.cc",
170 "fido/cable/fido_cable_device_unittest.cc",
171 "fido/cable/fido_cable_discovery_unittest.cc",
172 "fido/cable/fido_cable_handshake_handler_unittest.cc",
173 "fido/cable/v2_handshake_unittest.cc",
174 "fido/cbor_extract_unittest.cc",
175 "fido/credential_management_handler_unittest.cc",
176 "fido/ctap_request_unittest.cc",
177 "fido/ctap_response_unittest.cc",
Ken Buchanan414814902023-11-28 21:15:18178 "fido/enclave/enclave_protocol_utils_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13179 "fido/fake_fido_discovery_unittest.cc",
Nina Satragno395c0fb2020-09-14 22:30:07180 "fido/fido_device_authenticator_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13181 "fido/fido_device_discovery_unittest.cc",
182 "fido/fido_parsing_utils_unittest.cc",
183 "fido/fido_request_handler_unittest.cc",
Adam Langley051b97932021-01-11 19:11:23184 "fido/filter_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13185 "fido/get_assertion_handler_unittest.cc",
186 "fido/get_assertion_task_unittest.cc",
187 "fido/hid/fido_hid_message_unittest.cc",
Nina Satragno395c0fb2020-09-14 22:30:07188 "fido/large_blob_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13189 "fido/make_credential_handler_unittest.cc",
190 "fido/make_credential_task_unittest.cc",
Martin Kreichgauer0787dc32020-10-05 17:44:11191 "fido/pin_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13192 "fido/test_callback_receiver_unittest.cc",
193 "fido/u2f_command_constructor_unittest.cc",
194 "fido/u2f_register_operation_unittest.cc",
195 "fido/u2f_sign_operation_unittest.cc",
Ken Buchanan4a4700e82023-09-21 22:47:50196 "fido/value_response_conversions_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13197 "fido/virtual_ctap2_device_unittest.cc",
Nina Satragnob4edd6762022-05-16 20:51:47198 "fido/virtual_fido_device_authenticator_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13199 "fido/virtual_u2f_device_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13200 ]
201
Nina Satragno7f33f9b2023-01-31 22:09:03202 deps += [
Ken Buchanan414814902023-11-28 21:15:18203 "//components/sync/protocol:protocol",
Nina Satragno7f33f9b2023-01-31 22:09:03204 "//device/fido:mocks",
205 "//services/data_decoder/public/cpp:test_support",
206 ]
Martin Kreichgauer108eb102022-06-29 23:08:41207
Katherine Lai5595158a2023-08-12 02:18:08208 if (is_chromeos_lacros) {
209 deps += [ "//chromeos/startup" ]
210 }
211
Martin Kreichgauer108eb102022-06-29 23:08:41212 if (is_mac) {
213 data_deps += [ "fido/strings:fido_test_strings" ]
214 }
Nina Satragno1867ead2020-06-15 18:38:13215 }
216
Sylvain Defresne72188072020-10-05 11:54:41217 if (is_mac) {
218 sources += [
Avi Drissman36cfbd8d2023-06-13 19:37:25219 "fido/mac/authenticator_unittest.mm",
220 "fido/mac/browsing_data_deletion_unittest.mm",
Sylvain Defresne72188072020-10-05 11:54:41221 "fido/mac/credential_metadata_unittest.cc",
Avi Drissman36cfbd8d2023-06-13 19:37:25222 "fido/mac/credential_store_unittest.mm",
223 "fido/mac/get_assertion_operation_unittest_mac.mm",
224 "fido/mac/icloud_keychain_unittest.mm",
225 "fido/mac/make_credential_operation_unittest_mac.mm",
Sylvain Defresne72188072020-10-05 11:54:41226 "fido/mac/util_unittest.cc",
227 ]
Avi Drissman36cfbd8d2023-06-13 19:37:25228 deps += [ "//device/fido:icloud_keychain_test_support" ]
Sylvain Defresne72188072020-10-05 11:54:41229 }
230
231 if (is_win) {
Nina Satragno115ceadb2022-05-25 20:59:46232 sources += [
233 "fido/win/authenticator_unittest.cc",
234 "fido/win/type_conversions_unittest.cc",
235 ]
Sylvain Defresne72188072020-10-05 11:54:41236 }
237
Nina Satragno1867ead2020-06-15 18:38:13238 # FIDO HID:
scheibcfdca0e2015-04-01 05:27:58239 # Android doesn't compile.
scheib7a4cf042015-03-31 04:33:44240 # Linux, requires udev.
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:54241 if (!is_linux_without_udev && !is_android && !is_ios) {
scheib7a4cf042015-03-31 04:33:44242 sources += [
Kim Paulhamus534308e2018-07-23 20:58:43243 "fido/hid/fido_hid_device_unittest.cc",
244 "fido/hid/fido_hid_discovery_unittest.cc",
scheib7a4cf042015-03-31 04:33:44245 ]
246 deps += [
jdoerrie3e747742018-02-05 16:04:16247 "//device/fido:test_support",
Matt Reynolds11d261c2022-07-22 23:42:48248 "//services/device/public/cpp:test_support",
scheib7a4cf042015-03-31 04:33:44249 ]
250 }
251
252 if (use_udev) {
Matt Reynoldsd4103e72020-05-07 21:33:50253 sources += [
254 "udev_linux/udev_unittest.cc",
255 "udev_linux/udev_watcher_unittest.cc",
256 ]
Zentaro Kavanagh8c7826f2020-04-30 22:11:03257 deps += [
258 "//device/udev_linux",
259 "//device/udev_linux:test_support",
260 ]
scheib7a4cf042015-03-31 04:33:44261 }
262
scheib56010cc2015-06-25 01:29:47263 if (is_android) {
agrieve97176362015-12-01 16:36:19264 deps += [
265 ":bluetooth_test_java",
266 ":bluetooth_test_jni_headers",
267 ]
scheib56010cc2015-06-25 01:29:47268 }
269
Nico Weberd73c90382022-03-30 20:37:50270 if (is_chromeos) {
Michael Hansen3d4544f2021-07-19 20:37:56271 sources += [
272 "bluetooth/bluetooth_low_energy_scan_filter_unittest.cc",
Theo Johnson-Kanue80a4f22021-07-21 15:59:45273 "bluetooth/chromeos/bluetooth_connection_logger_unittest.cc",
Michael Hansen3d4544f2021-07-19 20:37:56274 "bluetooth/chromeos/bluetooth_utils_unittest.cc",
275 ]
Samuel Huang471ff9c2021-12-02 14:30:03276 deps += [ "//chromeos/constants" ]
Kyle Horimoto419ea9a2022-05-13 02:10:08277 if (is_chromeos_ash) {
Chad Duffinf7166572023-07-17 17:37:15278 deps += [
279 "//ash/constants",
280 "//chromeos/ash/services/nearby/public/cpp/",
281 "//chromeos/ash/services/secure_channel/public/cpp/shared",
282 ]
Kyle Horimoto419ea9a2022-05-13 02:10:08283 }
Samuel Huang471ff9c2021-12-02 14:30:03284 if (is_chromeos_lacros) {
285 deps += [ "//chromeos/lacros:test_support" ]
286 }
Ryan Hansberry27c9c582019-03-22 04:38:52287 }
288
dnicoara59acb3022015-12-17 18:13:16289 if ((is_chromeos || is_linux) && use_dbus) {
agrieve95ba4442016-04-25 15:47:13290 configs += [ "//build/config/linux/dbus" ]
rkc41077042015-11-06 07:20:58291
292 sources += [
Michael Hansend7b356d2022-03-10 22:42:45293 "bluetooth/bluez/bluetooth_adapter_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08294 "bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc",
295 "bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08296 "bluetooth/bluez/bluetooth_bluez_unittest.cc",
297 "bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc",
rkc2ffd5612016-06-24 02:00:22298 "bluetooth/bluez/bluetooth_service_attribute_value_bluez_unittest.cc",
299 "bluetooth/bluez/bluetooth_service_record_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08300 "bluetooth/bluez/bluetooth_socket_bluez_unittest.cc",
rkca7a149d2016-04-29 08:15:37301 "bluetooth/dbus/bluetooth_gatt_application_service_provider_unittest.cc",
Chris Mumford6627ae42021-05-03 18:54:40302 "bluetooth/dbus/bluetooth_gatt_characteristic_service_provider_unittest.cc",
Sonny Sasaka4840018f2021-10-19 20:31:06303 "bluetooth/floss/bluetooth_floss_unittest.cc",
Abhishek Pandit-Subedif88888a2022-10-19 16:29:48304 "bluetooth/floss/bluetooth_gatt_floss_unittest.cc",
Abhishek Pandit-Subedi7d053582022-08-20 05:15:29305 "bluetooth/floss/bluetooth_socket_floss_unittest.cc",
Sonny Sasaka54ac834a2022-08-09 19:59:11306 "bluetooth/floss/exported_callback_manager_unittest.cc",
Abhishek Pandit-Subedi61837982021-08-23 17:19:39307 "bluetooth/floss/floss_adapter_client_unittest.cc",
howardchungcc9f7702022-11-11 09:02:59308 "bluetooth/floss/floss_admin_client_unittest.cc",
John Laic3f3d5f2022-10-26 08:28:12309 "bluetooth/floss/floss_advertiser_client_unittest.cc",
Jesse Melhuishf9d0feb2022-11-03 01:25:26310 "bluetooth/floss/floss_battery_manager_client_unittest.cc",
WhaleChangfccdf2f42023-08-02 07:41:14311 "bluetooth/floss/floss_bluetooth_telephony_client_unittest.cc",
Sonny Sasakab0d8c3f32022-09-30 01:23:14312 "bluetooth/floss/floss_dbus_client_unittest.cc",
Yun-Hao Chungd20ee712023-10-04 05:11:49313 "bluetooth/floss/floss_dbus_manager_unittest.cc",
Sarveshc94e10db2023-01-31 22:05:58314 "bluetooth/floss/floss_gatt_manager_client_unittest.cc",
Katherine Lai579c4672022-09-09 19:22:30315 "bluetooth/floss/floss_lescan_client_unittest.cc",
Abhishek Pandit-Subedidf109c62021-08-18 19:30:55316 "bluetooth/floss/floss_manager_client_unittest.cc",
Abhishek Pandit-Subedi3cba9a5d2022-08-11 17:55:11317 "bluetooth/floss/floss_socket_manager_unittest.cc",
Ying Hsu0fd253f2023-10-16 18:10:56318 "bluetooth/floss/floss_version_unittest.cc",
rkc519a20c62016-04-16 23:18:07319 "bluetooth/test/bluetooth_test_bluez.cc",
320 "bluetooth/test/bluetooth_test_bluez.h",
rkc41077042015-11-06 07:20:58321 ]
322
Claudius van der Merwe0e6ac6162021-08-16 11:52:21323 deps += [
324 "//dbus",
325 "//dbus:test_support",
326 ]
James Hollyer976d3eea2019-10-02 06:21:09327
Nico Weberd73c90382022-03-30 20:37:50328 if (is_chromeos) {
Claudius van der Merwed844d9f2021-08-23 19:37:19329 sources += [
330 "bluetooth/dbus/bluetooth_advertisement_monitor_application_service_provider_unittest.cc",
331 "bluetooth/dbus/bluetooth_advertisement_monitor_service_provider_unittest.cc",
332 ]
James Hollyer976d3eea2019-10-02 06:21:09333 deps += [ "//services/data_decoder/public/mojom" ]
334 }
rkc41077042015-11-06 07:20:58335 }
336
Ryan Keane2a3aa8e92022-06-09 18:51:32337 if (is_castos) {
338 # Cast does not support GATT server mode.
339 sources -= [
340 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
341 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
342 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
343 ]
Stephen Lanhamccd5c252018-04-10 04:21:56344
Ryan Keane2a3aa8e92022-06-09 18:51:32345 sources += [
346 "bluetooth/cast/bluetooth_adapter_cast_unittest.cc",
347 "bluetooth/cast/bluetooth_utils_unittest.cc",
348 "bluetooth/test/bluetooth_test_cast.cc",
349 "bluetooth/test/bluetooth_test_cast.h",
350 ]
Stephen Lanhamccd5c252018-04-10 04:21:56351
Ryan Keane2a3aa8e92022-06-09 18:51:32352 deps += [
353 "//chromecast/device/bluetooth:util",
354 "//chromecast/device/bluetooth/le",
355 "//chromecast/device/bluetooth/le:test_support",
356 "//chromecast/device/bluetooth/shlib:mock_shlib",
357 ]
Pavel Kalinnikov9f6591002017-11-01 22:09:18358 }
359
Julie Jeongeun Kimcc191202023-03-08 03:43:40360 if (is_apple) {
krstnmnlsn332a71cf2015-07-17 18:59:58361 deps += [ "//third_party/ocmock" ]
362 ldflags = [ "-ObjC" ]
Robert Sesek95a026b2020-06-30 23:22:01363 frameworks = [
Robert Seseke55299452020-02-19 15:18:14364 "CoreBluetooth.framework",
rsesekdbb69c72016-05-11 17:26:35365 "IOKit.framework",
Martin Kreichgauere11b8a992022-06-23 17:08:26366 "Foundation.framework",
Julie Jeongeun Kimcc191202023-03-08 03:43:40367 ]
368 }
369
370 if (is_mac) {
371 frameworks += [
372 "IOBluetooth.framework",
Martin Kreichgauere11b8a992022-06-23 17:08:26373 "Security.framework",
Adam Langley0436ac22023-05-12 04:47:39374 "AuthenticationServices.framework",
rsesekdbb69c72016-05-11 17:26:35375 ]
tfarinacdc7e5d2015-02-23 09:52:24376 }
gogeraldcab31232016-02-03 21:20:33377
378 if (is_win) {
379 sources += [
gogeraldb8c706a2016-02-05 01:07:37380 "bluetooth/bluetooth_classic_win_fake.cc",
381 "bluetooth/bluetooth_classic_win_fake.h",
Jan Wilken Doerriecc0bd292018-05-14 12:28:28382 "bluetooth/test/fake_bluetooth_adapter_winrt.cc",
383 "bluetooth/test/fake_bluetooth_adapter_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18384 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.cc",
385 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.h",
Jan Wilken Doerrief397e842018-08-23 17:40:17386 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.cc",
387 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.h",
388 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.cc",
389 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.h",
Jan Wilken Dörried4dc7782018-06-04 09:38:13390 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.cc",
391 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.h",
392 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.cc",
393 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.h",
394 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.cc",
395 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43396 "bluetooth/test/fake_bluetooth_le_device_winrt.cc",
397 "bluetooth/test/fake_bluetooth_le_device_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18398 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.cc",
399 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41400 "bluetooth/test/fake_device_information_custom_pairing_winrt.cc",
401 "bluetooth/test/fake_device_information_custom_pairing_winrt.h",
Jan Wilken Doerrie9092f832018-08-14 07:05:11402 "bluetooth/test/fake_device_information_pairing_winrt.cc",
403 "bluetooth/test/fake_device_information_pairing_winrt.h",
Jan Wilken Doerrie7c0e41dc2018-05-16 08:37:52404 "bluetooth/test/fake_device_information_winrt.cc",
405 "bluetooth/test/fake_device_information_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41406 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.cc",
407 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.h",
408 "bluetooth/test/fake_device_pairing_result_winrt.cc",
409 "bluetooth/test/fake_device_pairing_result_winrt.h",
Jan Wilken Doerriebcd90ba2018-08-30 12:36:29410 "bluetooth/test/fake_device_watcher_winrt.cc",
411 "bluetooth/test/fake_device_watcher_winrt.h",
Jan Wilken Doerried66e0a92018-07-07 10:48:19412 "bluetooth/test/fake_gatt_characteristic_winrt.cc",
413 "bluetooth/test/fake_gatt_characteristic_winrt.h",
414 "bluetooth/test/fake_gatt_characteristics_result_winrt.cc",
415 "bluetooth/test/fake_gatt_characteristics_result_winrt.h",
Jan Wilken Doerrie2a3e6c92018-07-31 08:39:16416 "bluetooth/test/fake_gatt_descriptor_winrt.cc",
417 "bluetooth/test/fake_gatt_descriptor_winrt.h",
418 "bluetooth/test/fake_gatt_descriptors_result_winrt.cc",
419 "bluetooth/test/fake_gatt_descriptors_result_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43420 "bluetooth/test/fake_gatt_device_service_winrt.cc",
421 "bluetooth/test/fake_gatt_device_service_winrt.h",
422 "bluetooth/test/fake_gatt_device_services_result_winrt.cc",
423 "bluetooth/test/fake_gatt_device_services_result_winrt.h",
Jan Wilken Doerrie1bd49ee2018-07-30 10:59:00424 "bluetooth/test/fake_gatt_read_result_winrt.cc",
425 "bluetooth/test/fake_gatt_read_result_winrt.h",
Martin Kreichgauer3d6c10d2020-06-16 17:25:51426 "bluetooth/test/fake_gatt_session_winrt.cc",
427 "bluetooth/test/fake_gatt_session_winrt.h",
Jan Wilken Dörriee0029d12018-08-06 14:06:08428 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.cc",
429 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.h",
Jan Wilken Doerrief5b008c42018-08-01 08:12:56430 "bluetooth/test/fake_gatt_write_result_winrt.cc",
431 "bluetooth/test/fake_gatt_write_result_winrt.h",
Jan Wilken Dörriedc7c81c2018-06-12 07:34:38432 "bluetooth/test/fake_radio_winrt.cc",
433 "bluetooth/test/fake_radio_winrt.h",
gogeraldcab31232016-02-03 21:20:33434 ]
435 }
bajones7ab52ec32016-08-19 19:54:25436
Bill Orr1862b4f2018-05-10 17:56:45437 if (enable_vr) {
Michael Thiessen21e56152017-10-16 18:55:17438 sources += [
Anna Maria114d35052017-12-08 23:13:29439 "vr/orientation/orientation_device_provider_unittest.cc",
440 "vr/orientation/orientation_device_unittest.cc",
Bill Orrb35b4cd82019-03-05 00:13:39441 "vr/util/fps_meter_unittest.cc",
442 "vr/util/sliding_average_unittest.cc",
Alex Cooper93f1c752019-11-22 23:58:02443 "vr/util/stage_utils_unittest.cc",
Michael Thiessen21e56152017-10-16 18:55:17444 "vr/vr_device_base_unittest.cc",
Michael Thiessen21e56152017-10-16 18:55:17445 ]
bajones7ab52ec32016-08-19 19:54:25446
Bill Orr1862b4f2018-05-10 17:56:45447 defines = [ "DEVICE_VR_IMPLEMENTATION" ]
448
bajones7ab52ec32016-08-19 19:54:25449 deps += [
450 "//device/vr",
Alexander Cooper53e25812020-04-01 17:35:58451 "//device/vr:vr_fakes",
Alex Cooper51ea2f3c2021-02-18 03:51:26452 "//device/vr:vr_util",
Alexander Coopercb573b02020-04-21 22:16:35453 "//device/vr/orientation",
Rafael Cintron5b95b8d2020-11-04 01:58:10454 "//device/vr/public/mojom:isolated_xr_service",
Anna Maria114d35052017-12-08 23:13:29455 "//services/device/public/cpp/generic_sensor",
456 "//ui/display",
Roman Karasev72254172018-04-05 18:10:03457 "//ui/display:test_support",
bajones7ab52ec32016-08-19 19:54:25458 ]
459 }
Matt Reynoldsb37eb1292019-03-19 22:19:40460
461 # Some gamepad tests require the HID service. Only build these tests on
462 # platforms where the HID service is enabled.
Julie Jeongeun Kim0c67cfe2023-03-07 03:40:54463 if (!is_android && !is_fuchsia && !is_ios) {
Matt Reynoldsb37eb1292019-03-19 22:19:40464 sources += [ "gamepad/nintendo_data_fetcher_unittest.cc" ]
465
466 deps += [
467 "//services/device:test_support",
468 "//services/device/hid",
Matt Reynolds11d261c2022-07-22 23:42:48469 "//services/device/public/cpp:test_support",
Matt Reynoldsb37eb1292019-03-19 22:19:40470 ]
471 }
Martin Kreichgauerd15e7e42021-02-26 06:54:22472
Howard Yang72a1412b2022-04-13 00:16:02473 if (is_chromeos) {
Martin Kreichgauerd15e7e42021-02-26 06:54:22474 deps += [ "//chromeos/dbus/u2f" ]
475 }
tfarinacdc7e5d2015-02-23 09:52:24476}
scheib56010cc2015-06-25 01:29:47477
478if (is_android) {
Matt Reynolds7c498e52017-12-06 22:06:24479 bluetooth_java_sources_needing_jni = [
480 "bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java",
James Hollyerf8e00682019-11-20 02:11:21481 "bluetooth/test/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothScanFilter.java",
Matt Reynolds7c498e52017-12-06 22:06:24482 ]
scheib56010cc2015-06-25 01:29:47483
484 generate_jni("bluetooth_test_jni_headers") {
Eric Stevenson4c4d6342019-10-04 20:02:47485 testonly = true
scheib56010cc2015-06-25 01:29:47486 sources = bluetooth_java_sources_needing_jni
scheib56010cc2015-06-25 01:29:47487 }
488
489 android_library("bluetooth_test_java") {
Shimi Zhang0d7b74af2018-02-08 17:28:02490 testonly = true
Andrew Grieveff870b02023-06-13 20:50:36491
Natalie Chouinard8b9cf7c2019-12-20 02:21:40492 sources = bluetooth_java_sources_needing_jni
scheib56010cc2015-06-25 01:29:47493 deps = [
494 "//base:base_java",
ortuno5966ddb2016-07-01 02:07:25495 "//components/location/android:location_java",
scheib56010cc2015-06-25 01:29:47496 "//device/bluetooth:java",
Peter Wen22bc3ec2019-03-28 22:18:02497 "//third_party/android_sdk:android_test_mock_java",
Peter Kotwicz04093722021-02-13 00:35:37498 "//third_party/androidx:androidx_annotation_annotation_java",
Sam Maier1fcc2d52023-10-17 18:34:53499 "//third_party/jni_zero:jni_zero_java",
scheib56010cc2015-06-25 01:29:47500 ]
ortunocc9b46d12016-08-25 16:47:23501
Andrew Grieveff870b02023-06-13 20:50:36502 srcjar_deps = [
503 ":bluetooth_test_javagen",
504 ":bluetooth_test_jni_headers",
505 ]
scheib56010cc2015-06-25 01:29:47506 }
bajonesb9bb4c42016-07-07 00:10:51507
Mohamed Heikalbf107d92022-06-24 20:42:00508 robolectric_binary("device_junit_tests") {
Matt Reynolds29cbad52021-03-19 23:37:55509 sources = [
510 "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadDeviceTest.java",
511 "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java",
512 ]
bajonesb9bb4c42016-07-07 00:10:51513 deps = [
mcasas649deb52017-04-28 01:55:52514 "$google_play_services_package:google_play_services_base_java",
515 "$google_play_services_package:google_play_services_basement_java",
516 "$google_play_services_package:google_play_services_location_java",
bajonesb9bb4c42016-07-07 00:10:51517 "//base:base_java_test_support",
Andrew Grieve916bc9b2018-02-02 01:38:59518 "//base:base_junit_test_support",
bajonesb9bb4c42016-07-07 00:10:51519 "//device/gamepad:java",
alexander.shalamov55ac6a4c2016-11-30 09:04:17520 "//mojo/public/java:bindings_java",
Peter Kotwicz04093722021-02-13 00:35:37521 "//third_party/androidx:androidx_annotation_annotation_java",
Andrew Walbrand8f55c92020-07-01 17:09:03522 "//third_party/hamcrest:hamcrest_java",
bajonesb9bb4c42016-07-07 00:10:51523 ]
524 srcjar_deps = [ "//device/gamepad:java_enums_srcjar" ]
525 }
ortunocc9b46d12016-08-25 16:47:23526
527 java_cpp_enum("bluetooth_test_javagen") {
Nico Weberb355af2e2020-01-14 03:27:58528 sources = [ "bluetooth/test/bluetooth_test.h" ]
ortunocc9b46d12016-08-25 16:47:23529 }
scheib56010cc2015-06-25 01:29:47530}