blob: fb86a3d65b8288812129a3bb99c0a5b5bc5980d3 [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")
scheib56010cc2015-06-25 01:29:4712 import("//build/config/android/rules.gni") # For generate_jni().
13}
14
erikchenceb2fff2015-04-27 17:50:5415if (is_mac) {
16 import("//build/config/mac/mac_sdk.gni")
17}
18
Sean McAllister224ef732020-08-04 17:27:5519is_linux_without_udev = (is_linux || is_chromeos) && !use_udev
scheib7a4cf042015-03-31 04:33:4420
tfarinacdc7e5d2015-02-23 09:52:2421test("device_unittests") {
22 sources = [
alexis.menardb39a30822016-09-30 15:14:3923 "base/synchronization/one_writer_seqlock_unittest.cc",
Ryan Hansberry5918b492020-09-15 03:14:0024 "bluetooth/adapter_unittest.cc",
25 "bluetooth/advertisement_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2426 "bluetooth/bluetooth_adapter_unittest.cc",
ortuno945c90d2015-09-01 01:47:0827 "bluetooth/bluetooth_advertisement_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2428 "bluetooth/bluetooth_device_unittest.cc",
jpawlowskif54d01542015-04-13 22:24:4329 "bluetooth/bluetooth_discovery_filter_unittest.cc",
rkc3fb9aa6d2016-05-03 20:39:4430 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
31 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
rkc907af5d2016-05-10 00:20:0232 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
rkc122239752016-04-20 23:59:0833 "bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc",
34 "bluetooth/bluetooth_remote_gatt_descriptor_unittest.cc",
35 "bluetooth/bluetooth_remote_gatt_service_unittest.cc",
mbrunson32391c12016-11-18 23:42:1536 "bluetooth/device_unittest.cc",
Jason Majors47659c42019-07-08 18:23:2837 "bluetooth/public/cpp/bluetooth_uuid_unittest.cc",
Ryan Hansberryf750e142020-08-20 05:51:1738 "bluetooth/server_socket_unittest.cc",
Ryan Hansberrya39051bb2020-08-06 02:55:1939 "bluetooth/socket_unittest.cc",
ortunob755ff32016-08-25 21:29:3040 "bluetooth/string_util_icu_unittest.cc",
rkc3fb9aa6d2016-05-03 20:39:4441 "bluetooth/test/bluetooth_gatt_server_test.cc",
42 "bluetooth/test/bluetooth_gatt_server_test.h",
scheib545d7fd2015-06-30 22:26:5843 "bluetooth/test/bluetooth_test.cc",
44 "bluetooth/test/bluetooth_test.h",
Chris Mumford3067dae2021-08-05 23:33:3745 "bluetooth/test/mock_pairing_delegate.cc",
46 "bluetooth/test/mock_pairing_delegate.h",
scheib42e6b49d2015-04-29 21:46:5747 "bluetooth/test/test_bluetooth_adapter_observer.cc",
48 "bluetooth/test/test_bluetooth_adapter_observer.h",
Jan Wilken Doerried5832e62018-08-28 16:39:5049 "bluetooth/test/test_bluetooth_advertisement_observer.cc",
50 "bluetooth/test/test_bluetooth_advertisement_observer.h",
rkc3fb9aa6d2016-05-03 20:39:4451 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc",
52 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.h",
Matt Reynolds7c498e52017-12-06 22:06:2453 "gamepad/abstract_haptic_gamepad_unittest.cc",
Matt Reynoldscdb73c32019-08-23 00:46:2954 "gamepad/dualshock4_controller_unittest.cc",
Matt Reynolds96bd76a2019-06-12 21:15:1655 "gamepad/gamepad_blocklist_unittest.cc",
Matt Reynolds054d99b2018-12-06 02:40:2456 "gamepad/gamepad_id_list_unittest.cc",
bajonesb9bb4c42016-07-07 00:10:5157 "gamepad/gamepad_provider_unittest.cc",
ke.hebee6a642016-12-10 01:56:1958 "gamepad/gamepad_service_unittest.cc",
Matt Reynolds27a13de2019-08-20 21:03:3359 "gamepad/hid_haptic_gamepad_unittest.cc",
Oksana Zhuravlova96b546c2018-08-08 19:01:3360 "gamepad/public/cpp/gamepad_mojom_traits_unittest.cc",
Matt Reynolds5fcd224792019-08-29 21:24:0161 "gamepad/xbox_hid_controller_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2462 "test/run_all_unittests.cc",
tfarinacdc7e5d2015-02-23 09:52:2463 ]
64
Sylvain Defresne72188072020-10-05 11:54:4165 if (is_mac) {
66 sources += [
67 "bluetooth/bluetooth_adapter_mac_metrics_unittest.mm",
68 "bluetooth/bluetooth_adapter_mac_unittest.mm",
69 "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
85 if (is_android) {
86 sources += [
87 "bluetooth/bluetooth_adapter_android_unittest.cc",
88 "bluetooth/test/bluetooth_test_android.cc",
89 "bluetooth/test/bluetooth_test_android.h",
90 ]
91 }
92
93 if (is_win) {
94 sources += [
95 "bluetooth/bluetooth_adapter_win_unittest.cc",
96 "bluetooth/bluetooth_device_win_unittest.cc",
97 "bluetooth/bluetooth_low_energy_win_unittest.cc",
98 "bluetooth/bluetooth_service_record_win_unittest.cc",
99 "bluetooth/bluetooth_task_manager_win_unittest.cc",
100 "bluetooth/test/bluetooth_test_win.cc",
101 "bluetooth/test/bluetooth_test_win.h",
Qiaofei Ye5a02f892021-02-05 01:49:15102 "gamepad/wgi_data_fetcher_win_unittest.cc",
Sylvain Defresne72188072020-10-05 11:54:41103 ]
104 }
105
Scott Grahambf77d352018-10-25 17:50:54106 if (is_fuchsia) {
107 sources += [
108 "bluetooth/test/bluetooth_test_fuchsia.cc",
109 "bluetooth/test/bluetooth_test_fuchsia.h",
110 ]
111 }
112
tfarinacdc7e5d2015-02-23 09:52:24113 deps = [
Ovidio Henriquez21095442019-03-06 18:22:55114 "//base",
tfarinacdc7e5d2015-02-23 09:52:24115 "//base/test:test_support",
alexis.menardb39a30822016-09-30 15:14:39116 "//base/third_party/dynamic_annotations:dynamic_annotations",
Yuta Hijikata57d60812020-10-24 01:00:55117 "//build:chromeos_buildflags",
Jun Choi3545f502018-03-14 01:30:00118 "//components/apdu",
Kim Paulhamus35995bb62018-01-05 11:47:04119 "//components/cbor",
Donna Wu4dc9df32019-05-20 03:56:21120 "//components/device_event_log",
121 "//device/base",
alexis.menardb39a30822016-09-30 15:14:39122 "//device/base/synchronization",
tfarinacdc7e5d2015-02-23 09:52:24123 "//device/bluetooth",
Vincent Scheibdbe693bee2017-12-06 00:54:18124 "//device/bluetooth:deprecated_experimental_mojo",
Ryan Hansberryf750e142020-08-20 05:51:17125 "//device/bluetooth:fake_bluetooth",
brettw011138d2015-10-21 03:05:38126 "//device/bluetooth:mocks",
jdoerrie3e747742018-02-05 16:04:16127 "//device/fido",
Balazs Engedy83dc0822018-03-07 14:33:55128 "//device/fido:test_support",
bajonesb9bb4c42016-07-07 00:10:51129 "//device/gamepad",
130 "//device/gamepad:test_helpers",
juncai2f298a82017-04-18 03:51:39131 "//device/gamepad/public/cpp:shared_with_blink",
James Hollyer24f30cb722021-06-18 21:22:24132 "//device/gamepad/public/cpp:switches",
Reilly Grantfa93b142018-02-01 02:13:48133 "//device/gamepad/public/mojom",
Ken Rockot9b26bc52018-07-04 19:57:49134 "//mojo/core/embedder",
rockot85dce0862015-11-13 01:33:59135 "//mojo/public/cpp/bindings",
Oksana Zhuravlova96b546c2018-08-08 19:01:33136 "//mojo/public/cpp/test_support:test_utils",
tfarinacdc7e5d2015-02-23 09:52:24137 "//net",
138 "//testing/gmock",
139 "//testing/gtest",
Blink Reformata30d4232018-04-07 15:31:06140 "//third_party/blink/public:blink_headers",
Ovidio Henriquez21095442019-03-06 18:22:55141 "//ui/base",
tfarinacdc7e5d2015-02-23 09:52:24142 "//url",
143 ]
144
Ovidio Henriquez21095442019-03-06 18:22:55145 data_deps = [
146 "bluetooth/strings:bluetooth_test_strings",
Haiyang Pan1c813ca2021-11-24 18:52:16147 "//testing/buildbot/filters:device_unittests_filters",
Ovidio Henriquez21095442019-03-06 18:22:55148 "//ui/resources:ui_test_pak_data",
149 ]
150
Nina Satragno1867ead2020-06-15 18:38:13151 # Most of the FIDO implementation is not compiled in for Android.
152 if (!is_android) {
153 sources += [
154 "fido/attestation_statement_formats_unittest.cc",
Martin Kreichgauerdc572252020-10-16 17:46:10155 "fido/auth_token_requester_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13156 "fido/bio/enrollment_handler_unittest.cc",
157 "fido/ble_adapter_manager_unittest.cc",
158 "fido/cable/fido_ble_connection_unittest.cc",
159 "fido/cable/fido_ble_frames_unittest.cc",
160 "fido/cable/fido_ble_transaction_unittest.cc",
161 "fido/cable/fido_cable_device_unittest.cc",
162 "fido/cable/fido_cable_discovery_unittest.cc",
163 "fido/cable/fido_cable_handshake_handler_unittest.cc",
164 "fido/cable/v2_handshake_unittest.cc",
165 "fido/cbor_extract_unittest.cc",
166 "fido/credential_management_handler_unittest.cc",
167 "fido/ctap_request_unittest.cc",
168 "fido/ctap_response_unittest.cc",
169 "fido/fake_fido_discovery_unittest.cc",
Nina Satragno395c0fb2020-09-14 22:30:07170 "fido/fido_device_authenticator_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13171 "fido/fido_device_discovery_unittest.cc",
172 "fido/fido_parsing_utils_unittest.cc",
173 "fido/fido_request_handler_unittest.cc",
Adam Langley051b97932021-01-11 19:11:23174 "fido/filter_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13175 "fido/get_assertion_handler_unittest.cc",
176 "fido/get_assertion_task_unittest.cc",
177 "fido/hid/fido_hid_message_unittest.cc",
Nina Satragno395c0fb2020-09-14 22:30:07178 "fido/large_blob_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13179 "fido/make_credential_handler_unittest.cc",
180 "fido/make_credential_task_unittest.cc",
Martin Kreichgauer0787dc32020-10-05 17:44:11181 "fido/pin_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13182 "fido/test_callback_receiver_unittest.cc",
183 "fido/u2f_command_constructor_unittest.cc",
184 "fido/u2f_register_operation_unittest.cc",
185 "fido/u2f_sign_operation_unittest.cc",
186 "fido/virtual_ctap2_device_unittest.cc",
Nina Satragnob4edd6762022-05-16 20:51:47187 "fido/virtual_fido_device_authenticator_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13188 "fido/virtual_u2f_device_unittest.cc",
Nina Satragno1867ead2020-06-15 18:38:13189 ]
190
191 deps += [ "//device/fido:mocks" ]
Martin Kreichgauer108eb102022-06-29 23:08:41192
193 if (is_mac) {
194 data_deps += [ "fido/strings:fido_test_strings" ]
195 }
Nina Satragno1867ead2020-06-15 18:38:13196 }
197
Sylvain Defresne72188072020-10-05 11:54:41198 if (is_mac) {
199 sources += [
200 "fido/mac/browsing_data_deletion_unittest.mm",
201 "fido/mac/credential_metadata_unittest.cc",
Martin Kreichgauere11b8a992022-06-23 17:08:26202 "fido/mac/credential_store_unittest.mm",
Sylvain Defresne72188072020-10-05 11:54:41203 "fido/mac/get_assertion_operation_unittest_mac.mm",
204 "fido/mac/make_credential_operation_unittest_mac.mm",
205 "fido/mac/util_unittest.cc",
206 ]
207 }
208
209 if (is_win) {
Nina Satragno115ceadb2022-05-25 20:59:46210 sources += [
211 "fido/win/authenticator_unittest.cc",
212 "fido/win/type_conversions_unittest.cc",
213 ]
Sylvain Defresne72188072020-10-05 11:54:41214 }
215
Nina Satragno1867ead2020-06-15 18:38:13216 # FIDO HID:
scheibcfdca0e2015-04-01 05:27:58217 # Android doesn't compile.
scheib7a4cf042015-03-31 04:33:44218 # Linux, requires udev.
scheibcfdca0e2015-04-01 05:27:58219 if (!is_linux_without_udev && !is_android) {
scheib7a4cf042015-03-31 04:33:44220 sources += [
Kim Paulhamus534308e2018-07-23 20:58:43221 "fido/hid/fido_hid_device_unittest.cc",
222 "fido/hid/fido_hid_discovery_unittest.cc",
scheib7a4cf042015-03-31 04:33:44223 ]
224 deps += [
jdoerrie3e747742018-02-05 16:04:16225 "//device/fido:test_support",
Matt Reynolds11d261c2022-07-22 23:42:48226 "//services/device/public/cpp:test_support",
scheib7a4cf042015-03-31 04:33:44227 ]
228 }
229
230 if (use_udev) {
Matt Reynoldsd4103e72020-05-07 21:33:50231 sources += [
232 "udev_linux/udev_unittest.cc",
233 "udev_linux/udev_watcher_unittest.cc",
234 ]
Zentaro Kavanagh8c7826f2020-04-30 22:11:03235 deps += [
236 "//device/udev_linux",
237 "//device/udev_linux:test_support",
238 ]
scheib7a4cf042015-03-31 04:33:44239 }
240
scheib56010cc2015-06-25 01:29:47241 if (is_android) {
agrieve97176362015-12-01 16:36:19242 deps += [
243 ":bluetooth_test_java",
244 ":bluetooth_test_jni_headers",
245 ]
scheib56010cc2015-06-25 01:29:47246 }
247
Nico Weberd73c90382022-03-30 20:37:50248 if (is_chromeos) {
Michael Hansen3d4544f2021-07-19 20:37:56249 sources += [
250 "bluetooth/bluetooth_low_energy_scan_filter_unittest.cc",
Theo Johnson-Kanue80a4f22021-07-21 15:59:45251 "bluetooth/chromeos/bluetooth_connection_logger_unittest.cc",
Michael Hansen3d4544f2021-07-19 20:37:56252 "bluetooth/chromeos/bluetooth_utils_unittest.cc",
253 ]
Samuel Huang471ff9c2021-12-02 14:30:03254 deps += [ "//chromeos/constants" ]
Kyle Horimoto419ea9a2022-05-13 02:10:08255 if (is_chromeos_ash) {
256 deps += [ "//ash/constants" ]
257 }
Samuel Huang471ff9c2021-12-02 14:30:03258 if (is_chromeos_lacros) {
259 deps += [ "//chromeos/lacros:test_support" ]
260 }
Ryan Hansberry27c9c582019-03-22 04:38:52261 }
262
dnicoara59acb3022015-12-17 18:13:16263 if ((is_chromeos || is_linux) && use_dbus) {
agrieve95ba4442016-04-25 15:47:13264 configs += [ "//build/config/linux/dbus" ]
rkc41077042015-11-06 07:20:58265
266 sources += [
Michael Hansend7b356d2022-03-10 22:42:45267 "bluetooth/bluez/bluetooth_adapter_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08268 "bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc",
269 "bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08270 "bluetooth/bluez/bluetooth_bluez_unittest.cc",
271 "bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc",
rkc2ffd5612016-06-24 02:00:22272 "bluetooth/bluez/bluetooth_service_attribute_value_bluez_unittest.cc",
273 "bluetooth/bluez/bluetooth_service_record_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08274 "bluetooth/bluez/bluetooth_socket_bluez_unittest.cc",
rkca7a149d2016-04-29 08:15:37275 "bluetooth/dbus/bluetooth_gatt_application_service_provider_unittest.cc",
Chris Mumford6627ae42021-05-03 18:54:40276 "bluetooth/dbus/bluetooth_gatt_characteristic_service_provider_unittest.cc",
Sonny Sasaka4840018f2021-10-19 20:31:06277 "bluetooth/floss/bluetooth_floss_unittest.cc",
Abhishek Pandit-Subedi7d053582022-08-20 05:15:29278 "bluetooth/floss/bluetooth_socket_floss_unittest.cc",
Sonny Sasaka54ac834a2022-08-09 19:59:11279 "bluetooth/floss/exported_callback_manager_unittest.cc",
Abhishek Pandit-Subedi61837982021-08-23 17:19:39280 "bluetooth/floss/floss_adapter_client_unittest.cc",
Sonny Sasakab0d8c3f32022-09-30 01:23:14281 "bluetooth/floss/floss_dbus_client_unittest.cc",
Abhishek Pandit-Subedid4b2acc2022-08-29 18:32:15282 "bluetooth/floss/floss_gatt_client_unittest.cc",
Katherine Lai579c4672022-09-09 19:22:30283 "bluetooth/floss/floss_lescan_client_unittest.cc",
Abhishek Pandit-Subedidf109c62021-08-18 19:30:55284 "bluetooth/floss/floss_manager_client_unittest.cc",
Abhishek Pandit-Subedi3cba9a5d2022-08-11 17:55:11285 "bluetooth/floss/floss_socket_manager_unittest.cc",
rkc519a20c62016-04-16 23:18:07286 "bluetooth/test/bluetooth_test_bluez.cc",
287 "bluetooth/test/bluetooth_test_bluez.h",
rkc41077042015-11-06 07:20:58288 ]
289
Claudius van der Merwe0e6ac6162021-08-16 11:52:21290 deps += [
291 "//dbus",
292 "//dbus:test_support",
293 ]
James Hollyer976d3eea2019-10-02 06:21:09294
Nico Weberd73c90382022-03-30 20:37:50295 if (is_chromeos) {
Claudius van der Merwed844d9f2021-08-23 19:37:19296 sources += [
297 "bluetooth/dbus/bluetooth_advertisement_monitor_application_service_provider_unittest.cc",
298 "bluetooth/dbus/bluetooth_advertisement_monitor_service_provider_unittest.cc",
299 ]
James Hollyer976d3eea2019-10-02 06:21:09300 deps += [ "//services/data_decoder/public/mojom" ]
301 }
rkc41077042015-11-06 07:20:58302 }
303
Ryan Keane2a3aa8e92022-06-09 18:51:32304 if (is_castos) {
305 # Cast does not support GATT server mode.
306 sources -= [
307 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
308 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
309 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
310 ]
Stephen Lanhamccd5c252018-04-10 04:21:56311
Ryan Keane2a3aa8e92022-06-09 18:51:32312 sources += [
313 "bluetooth/cast/bluetooth_adapter_cast_unittest.cc",
314 "bluetooth/cast/bluetooth_utils_unittest.cc",
315 "bluetooth/test/bluetooth_test_cast.cc",
316 "bluetooth/test/bluetooth_test_cast.h",
317 ]
Stephen Lanhamccd5c252018-04-10 04:21:56318
Ryan Keane2a3aa8e92022-06-09 18:51:32319 deps += [
320 "//chromecast/device/bluetooth:util",
321 "//chromecast/device/bluetooth/le",
322 "//chromecast/device/bluetooth/le:test_support",
323 "//chromecast/device/bluetooth/shlib:mock_shlib",
324 ]
Pavel Kalinnikov9f6591002017-11-01 22:09:18325 }
326
tfarinacdc7e5d2015-02-23 09:52:24327 if (is_mac) {
krstnmnlsn332a71cf2015-07-17 18:59:58328 deps += [ "//third_party/ocmock" ]
329 ldflags = [ "-ObjC" ]
Robert Sesek95a026b2020-06-30 23:22:01330 frameworks = [
Robert Seseke55299452020-02-19 15:18:14331 "CoreBluetooth.framework",
rsesekdbb69c72016-05-11 17:26:35332 "IOBluetooth.framework",
333 "IOKit.framework",
Martin Kreichgauere11b8a992022-06-23 17:08:26334 "Foundation.framework",
335 "Security.framework",
rsesekdbb69c72016-05-11 17:26:35336 ]
tfarinacdc7e5d2015-02-23 09:52:24337 }
gogeraldcab31232016-02-03 21:20:33338
339 if (is_win) {
340 sources += [
gogeraldb8c706a2016-02-05 01:07:37341 "bluetooth/bluetooth_classic_win_fake.cc",
342 "bluetooth/bluetooth_classic_win_fake.h",
gogeraldcab31232016-02-03 21:20:33343 "bluetooth/bluetooth_low_energy_win_fake.cc",
344 "bluetooth/bluetooth_low_energy_win_fake.h",
Jan Wilken Doerriecc0bd292018-05-14 12:28:28345 "bluetooth/test/fake_bluetooth_adapter_winrt.cc",
346 "bluetooth/test/fake_bluetooth_adapter_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18347 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.cc",
348 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.h",
Jan Wilken Doerrief397e842018-08-23 17:40:17349 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.cc",
350 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.h",
351 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.cc",
352 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.h",
Jan Wilken Dörried4dc7782018-06-04 09:38:13353 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.cc",
354 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.h",
355 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.cc",
356 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.h",
357 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.cc",
358 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43359 "bluetooth/test/fake_bluetooth_le_device_winrt.cc",
360 "bluetooth/test/fake_bluetooth_le_device_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18361 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.cc",
362 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41363 "bluetooth/test/fake_device_information_custom_pairing_winrt.cc",
364 "bluetooth/test/fake_device_information_custom_pairing_winrt.h",
Jan Wilken Doerrie9092f832018-08-14 07:05:11365 "bluetooth/test/fake_device_information_pairing_winrt.cc",
366 "bluetooth/test/fake_device_information_pairing_winrt.h",
Jan Wilken Doerrie7c0e41dc2018-05-16 08:37:52367 "bluetooth/test/fake_device_information_winrt.cc",
368 "bluetooth/test/fake_device_information_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41369 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.cc",
370 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.h",
371 "bluetooth/test/fake_device_pairing_result_winrt.cc",
372 "bluetooth/test/fake_device_pairing_result_winrt.h",
Jan Wilken Doerriebcd90ba2018-08-30 12:36:29373 "bluetooth/test/fake_device_watcher_winrt.cc",
374 "bluetooth/test/fake_device_watcher_winrt.h",
Jan Wilken Doerried66e0a92018-07-07 10:48:19375 "bluetooth/test/fake_gatt_characteristic_winrt.cc",
376 "bluetooth/test/fake_gatt_characteristic_winrt.h",
377 "bluetooth/test/fake_gatt_characteristics_result_winrt.cc",
378 "bluetooth/test/fake_gatt_characteristics_result_winrt.h",
Jan Wilken Doerrie2a3e6c92018-07-31 08:39:16379 "bluetooth/test/fake_gatt_descriptor_winrt.cc",
380 "bluetooth/test/fake_gatt_descriptor_winrt.h",
381 "bluetooth/test/fake_gatt_descriptors_result_winrt.cc",
382 "bluetooth/test/fake_gatt_descriptors_result_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43383 "bluetooth/test/fake_gatt_device_service_winrt.cc",
384 "bluetooth/test/fake_gatt_device_service_winrt.h",
385 "bluetooth/test/fake_gatt_device_services_result_winrt.cc",
386 "bluetooth/test/fake_gatt_device_services_result_winrt.h",
Jan Wilken Doerrie1bd49ee2018-07-30 10:59:00387 "bluetooth/test/fake_gatt_read_result_winrt.cc",
388 "bluetooth/test/fake_gatt_read_result_winrt.h",
Martin Kreichgauer3d6c10d2020-06-16 17:25:51389 "bluetooth/test/fake_gatt_session_winrt.cc",
390 "bluetooth/test/fake_gatt_session_winrt.h",
Jan Wilken Dörriee0029d12018-08-06 14:06:08391 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.cc",
392 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.h",
Jan Wilken Doerrief5b008c42018-08-01 08:12:56393 "bluetooth/test/fake_gatt_write_result_winrt.cc",
394 "bluetooth/test/fake_gatt_write_result_winrt.h",
Jan Wilken Dörriedc7c81c2018-06-12 07:34:38395 "bluetooth/test/fake_radio_winrt.cc",
396 "bluetooth/test/fake_radio_winrt.h",
gogeraldcab31232016-02-03 21:20:33397 ]
398 }
bajones7ab52ec32016-08-19 19:54:25399
Bill Orr1862b4f2018-05-10 17:56:45400 if (enable_vr) {
Michael Thiessen21e56152017-10-16 18:55:17401 sources += [
Anna Maria114d35052017-12-08 23:13:29402 "vr/orientation/orientation_device_provider_unittest.cc",
403 "vr/orientation/orientation_device_unittest.cc",
Bill Orrb35b4cd82019-03-05 00:13:39404 "vr/util/fps_meter_unittest.cc",
405 "vr/util/sliding_average_unittest.cc",
Alex Cooper93f1c752019-11-22 23:58:02406 "vr/util/stage_utils_unittest.cc",
Michael Thiessen21e56152017-10-16 18:55:17407 "vr/vr_device_base_unittest.cc",
Michael Thiessen21e56152017-10-16 18:55:17408 ]
bajones7ab52ec32016-08-19 19:54:25409
Bill Orr1862b4f2018-05-10 17:56:45410 defines = [ "DEVICE_VR_IMPLEMENTATION" ]
411
bajones7ab52ec32016-08-19 19:54:25412 deps += [
413 "//device/vr",
Alexander Cooper53e25812020-04-01 17:35:58414 "//device/vr:vr_fakes",
Alex Cooper51ea2f3c2021-02-18 03:51:26415 "//device/vr:vr_util",
Alexander Coopercb573b02020-04-21 22:16:35416 "//device/vr/orientation",
Rafael Cintron5b95b8d2020-11-04 01:58:10417 "//device/vr/public/mojom:isolated_xr_service",
Anna Maria114d35052017-12-08 23:13:29418 "//services/device/public/cpp/generic_sensor",
419 "//ui/display",
Roman Karasev72254172018-04-05 18:10:03420 "//ui/display:test_support",
bajones7ab52ec32016-08-19 19:54:25421 ]
422 }
Matt Reynoldsb37eb1292019-03-19 22:19:40423
424 # Some gamepad tests require the HID service. Only build these tests on
425 # platforms where the HID service is enabled.
426 if (!is_android && !is_fuchsia) {
427 sources += [ "gamepad/nintendo_data_fetcher_unittest.cc" ]
428
429 deps += [
430 "//services/device:test_support",
431 "//services/device/hid",
Matt Reynolds11d261c2022-07-22 23:42:48432 "//services/device/public/cpp:test_support",
Matt Reynoldsb37eb1292019-03-19 22:19:40433 ]
434 }
Martin Kreichgauerd15e7e42021-02-26 06:54:22435
Howard Yang72a1412b2022-04-13 00:16:02436 if (is_chromeos) {
Martin Kreichgauerd15e7e42021-02-26 06:54:22437 deps += [ "//chromeos/dbus/u2f" ]
438 }
tfarinacdc7e5d2015-02-23 09:52:24439}
scheib56010cc2015-06-25 01:29:47440
441if (is_android) {
Matt Reynolds7c498e52017-12-06 22:06:24442 bluetooth_java_sources_needing_jni = [
443 "bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java",
James Hollyerf8e00682019-11-20 02:11:21444 "bluetooth/test/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothScanFilter.java",
Matt Reynolds7c498e52017-12-06 22:06:24445 ]
scheib56010cc2015-06-25 01:29:47446
447 generate_jni("bluetooth_test_jni_headers") {
Eric Stevenson4c4d6342019-10-04 20:02:47448 testonly = true
scheib56010cc2015-06-25 01:29:47449 sources = bluetooth_java_sources_needing_jni
scheib56010cc2015-06-25 01:29:47450 }
451
452 android_library("bluetooth_test_java") {
Shimi Zhang0d7b74af2018-02-08 17:28:02453 testonly = true
Natalie Chouinard8b9cf7c2019-12-20 02:21:40454 sources = bluetooth_java_sources_needing_jni
scheib56010cc2015-06-25 01:29:47455 deps = [
456 "//base:base_java",
Peter Wen8a196c162022-04-29 22:55:06457 "//base:jni_java",
ortuno5966ddb2016-07-01 02:07:25458 "//components/location/android:location_java",
scheib56010cc2015-06-25 01:29:47459 "//device/bluetooth:java",
Peter Wen22bc3ec2019-03-28 22:18:02460 "//third_party/android_sdk:android_test_mock_java",
Peter Kotwicz04093722021-02-13 00:35:37461 "//third_party/androidx:androidx_annotation_annotation_java",
scheib56010cc2015-06-25 01:29:47462 ]
ortunocc9b46d12016-08-25 16:47:23463
464 srcjar_deps = [ ":bluetooth_test_javagen" ]
scheib56010cc2015-06-25 01:29:47465 }
bajonesb9bb4c42016-07-07 00:10:51466
Mohamed Heikalbf107d92022-06-24 20:42:00467 robolectric_binary("device_junit_tests") {
Matt Reynolds29cbad52021-03-19 23:37:55468 sources = [
469 "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadDeviceTest.java",
470 "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java",
471 ]
bajonesb9bb4c42016-07-07 00:10:51472 deps = [
mcasas649deb52017-04-28 01:55:52473 "$google_play_services_package:google_play_services_base_java",
474 "$google_play_services_package:google_play_services_basement_java",
475 "$google_play_services_package:google_play_services_location_java",
bajonesb9bb4c42016-07-07 00:10:51476 "//base:base_java_test_support",
Andrew Grieve916bc9b2018-02-02 01:38:59477 "//base:base_junit_test_support",
bajonesb9bb4c42016-07-07 00:10:51478 "//device/gamepad:java",
alexander.shalamov55ac6a4c2016-11-30 09:04:17479 "//mojo/public/java:bindings_java",
Peter Kotwicz04093722021-02-13 00:35:37480 "//third_party/androidx:androidx_annotation_annotation_java",
Andrew Walbrand8f55c92020-07-01 17:09:03481 "//third_party/hamcrest:hamcrest_java",
bajonesb9bb4c42016-07-07 00:10:51482 ]
483 srcjar_deps = [ "//device/gamepad:java_enums_srcjar" ]
484 }
ortunocc9b46d12016-08-25 16:47:23485
486 java_cpp_enum("bluetooth_test_javagen") {
Nico Weberb355af2e2020-01-14 03:27:58487 sources = [ "bluetooth/test/bluetooth_test.h" ]
ortunocc9b46d12016-08-25 16:47:23488 }
scheib56010cc2015-06-25 01:29:47489}