blob: fc0f4fcc084c17d04e8f5fc584b9127e7707d4cb [file] [log] [blame]
tfarinacdc7e5d2015-02-23 09:52:241# Copyright 2015 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
5import("//build/config/features.gni")
Scott Violetc8240b02018-03-08 22:03:596import("//device/vr/buildflags/buildflags.gni")
tfarinacdc7e5d2015-02-23 09:52:247import("//testing/test.gni")
8
scheib56010cc2015-06-25 01:29:479if (is_android) {
mcasas649deb52017-04-28 01:55:5210 import("//build/config/android/config.gni")
scheib56010cc2015-06-25 01:29:4711 import("//build/config/android/rules.gni") # For generate_jni().
12}
13
erikchenceb2fff2015-04-27 17:50:5414if (is_mac) {
15 import("//build/config/mac/mac_sdk.gni")
16}
17
scheib7a4cf042015-03-31 04:33:4418is_linux_without_udev = is_linux && !use_udev
scheib7a4cf042015-03-31 04:33:4419
tfarinacdc7e5d2015-02-23 09:52:2420test("device_unittests") {
21 sources = [
alexis.menardb39a30822016-09-30 15:14:3922 "base/synchronization/one_writer_seqlock_unittest.cc",
James Hollyerf8e00682019-11-20 02:11:2123 "bluetooth/bluetooth_adapter_android_unittest.cc",
James Hollyer213cbbc2019-01-17 21:46:4924 "bluetooth/bluetooth_adapter_mac_metrics_unittest.mm",
tfarinacdc7e5d2015-02-23 09:52:2425 "bluetooth/bluetooth_adapter_mac_unittest.mm",
tfarinacdc7e5d2015-02-23 09:52:2426 "bluetooth/bluetooth_adapter_unittest.cc",
27 "bluetooth/bluetooth_adapter_win_unittest.cc",
ortuno945c90d2015-09-01 01:47:0828 "bluetooth/bluetooth_advertisement_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2429 "bluetooth/bluetooth_device_unittest.cc",
30 "bluetooth/bluetooth_device_win_unittest.cc",
jpawlowskif54d01542015-04-13 22:24:4331 "bluetooth/bluetooth_discovery_filter_unittest.cc",
rkc3fb9aa6d2016-05-03 20:39:4432 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
33 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
rkc907af5d2016-05-10 00:20:0234 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
Tim Song51ffb6602018-08-02 05:57:3535 "bluetooth/bluetooth_low_energy_advertisement_manager_mac_unittest.mm",
tfarinacdc7e5d2015-02-23 09:52:2436 "bluetooth/bluetooth_low_energy_win_unittest.cc",
rkc122239752016-04-20 23:59:0837 "bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc",
38 "bluetooth/bluetooth_remote_gatt_descriptor_unittest.cc",
39 "bluetooth/bluetooth_remote_gatt_service_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2440 "bluetooth/bluetooth_service_record_win_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2441 "bluetooth/bluetooth_task_manager_win_unittest.cc",
mbrunson32391c12016-11-18 23:42:1542 "bluetooth/device_unittest.cc",
Jason Majors47659c42019-07-08 18:23:2843 "bluetooth/public/cpp/bluetooth_uuid_unittest.cc",
ortunob755ff32016-08-25 21:29:3044 "bluetooth/string_util_icu_unittest.cc",
rkc3fb9aa6d2016-05-03 20:39:4445 "bluetooth/test/bluetooth_gatt_server_test.cc",
46 "bluetooth/test/bluetooth_gatt_server_test.h",
scheib545d7fd2015-06-30 22:26:5847 "bluetooth/test/bluetooth_test.cc",
48 "bluetooth/test/bluetooth_test.h",
49 "bluetooth/test/bluetooth_test_android.cc",
50 "bluetooth/test/bluetooth_test_android.h",
krstnmnlsn56d371032015-07-21 20:18:0751 "bluetooth/test/bluetooth_test_mac.h",
52 "bluetooth/test/bluetooth_test_mac.mm",
gogerald512935cc2016-01-27 01:11:1853 "bluetooth/test/bluetooth_test_win.cc",
54 "bluetooth/test/bluetooth_test_win.h",
jlebel620327d2016-06-20 13:01:0055 "bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h",
56 "bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm",
jlebel9bb8cf242017-01-10 01:29:0257 "bluetooth/test/mock_bluetooth_cbdescriptor_mac.h",
58 "bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm",
jlebela58fd752016-03-14 10:33:2859 "bluetooth/test/mock_bluetooth_cbperipheral_mac.h",
60 "bluetooth/test/mock_bluetooth_cbperipheral_mac.mm",
jlebelc4b09782016-05-10 00:31:5861 "bluetooth/test/mock_bluetooth_cbservice_mac.h",
62 "bluetooth/test/mock_bluetooth_cbservice_mac.mm",
jlebela58fd752016-03-14 10:33:2863 "bluetooth/test/mock_bluetooth_central_manager_mac.h",
64 "bluetooth/test/mock_bluetooth_central_manager_mac.mm",
scheib42e6b49d2015-04-29 21:46:5765 "bluetooth/test/test_bluetooth_adapter_observer.cc",
66 "bluetooth/test/test_bluetooth_adapter_observer.h",
Jan Wilken Doerried5832e62018-08-28 16:39:5067 "bluetooth/test/test_bluetooth_advertisement_observer.cc",
68 "bluetooth/test/test_bluetooth_advertisement_observer.h",
rkc3fb9aa6d2016-05-03 20:39:4469 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc",
70 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:4171 "bluetooth/test/test_pairing_delegate.cc",
72 "bluetooth/test/test_pairing_delegate.h",
reillygaaee8912017-03-23 22:16:0673 "bluetooth/uribeacon/uri_encoder_unittest.cc",
Matt Reynolds7c498e52017-12-06 22:06:2474 "gamepad/abstract_haptic_gamepad_unittest.cc",
Matt Reynoldscdb73c32019-08-23 00:46:2975 "gamepad/dualshock4_controller_unittest.cc",
Matt Reynolds96bd76a2019-06-12 21:15:1676 "gamepad/gamepad_blocklist_unittest.cc",
Matt Reynolds054d99b2018-12-06 02:40:2477 "gamepad/gamepad_id_list_unittest.cc",
bajonesb9bb4c42016-07-07 00:10:5178 "gamepad/gamepad_provider_unittest.cc",
ke.hebee6a642016-12-10 01:56:1979 "gamepad/gamepad_service_unittest.cc",
Matt Reynolds27a13de2019-08-20 21:03:3380 "gamepad/hid_haptic_gamepad_unittest.cc",
Oksana Zhuravlova96b546c2018-08-08 19:01:3381 "gamepad/public/cpp/gamepad_mojom_traits_unittest.cc",
Matt Reynolds5fcd224792019-08-29 21:24:0182 "gamepad/xbox_hid_controller_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2483 "test/run_all_unittests.cc",
tfarinacdc7e5d2015-02-23 09:52:2484 ]
85
Scott Grahambf77d352018-10-25 17:50:5486 if (is_fuchsia) {
87 sources += [
88 "bluetooth/test/bluetooth_test_fuchsia.cc",
89 "bluetooth/test/bluetooth_test_fuchsia.h",
90 ]
91 }
92
tfarinacdc7e5d2015-02-23 09:52:2493 deps = [
Ovidio Henriquez21095442019-03-06 18:22:5594 "//base",
tfarinacdc7e5d2015-02-23 09:52:2495 "//base/test:test_support",
alexis.menardb39a30822016-09-30 15:14:3996 "//base/third_party/dynamic_annotations:dynamic_annotations",
Jun Choi3545f502018-03-14 01:30:0097 "//components/apdu",
Kim Paulhamus35995bb62018-01-05 11:47:0498 "//components/cbor",
Donna Wu4dc9df32019-05-20 03:56:2199 "//components/device_event_log",
100 "//device/base",
alexis.menardb39a30822016-09-30 15:14:39101 "//device/base/synchronization",
tfarinacdc7e5d2015-02-23 09:52:24102 "//device/bluetooth",
Vincent Scheibdbe693bee2017-12-06 00:54:18103 "//device/bluetooth:deprecated_experimental_mojo",
brettw011138d2015-10-21 03:05:38104 "//device/bluetooth:mocks",
reillygaaee8912017-03-23 22:16:06105 "//device/bluetooth/uribeacon",
jdoerrie3e747742018-02-05 16:04:16106 "//device/fido",
Balazs Engedy83dc0822018-03-07 14:33:55107 "//device/fido:test_support",
bajonesb9bb4c42016-07-07 00:10:51108 "//device/gamepad",
109 "//device/gamepad:test_helpers",
juncai2f298a82017-04-18 03:51:39110 "//device/gamepad/public/cpp:shared_with_blink",
Reilly Grantfa93b142018-02-01 02:13:48111 "//device/gamepad/public/mojom",
Ken Rockot9b26bc52018-07-04 19:57:49112 "//mojo/core/embedder",
rockot85dce0862015-11-13 01:33:59113 "//mojo/public/cpp/bindings",
Oksana Zhuravlova96b546c2018-08-08 19:01:33114 "//mojo/public/cpp/test_support:test_utils",
tfarinacdc7e5d2015-02-23 09:52:24115 "//net",
116 "//testing/gmock",
117 "//testing/gtest",
Blink Reformata30d4232018-04-07 15:31:06118 "//third_party/blink/public:blink_headers",
Ovidio Henriquez21095442019-03-06 18:22:55119 "//ui/base",
tfarinacdc7e5d2015-02-23 09:52:24120 "//url",
121 ]
122
Ovidio Henriquez21095442019-03-06 18:22:55123 data_deps = [
124 "bluetooth/strings:bluetooth_test_strings",
125 "//ui/resources:ui_test_pak_data",
126 ]
127
Nina Satragno1867ead2020-06-15 18:38:13128 # Most of the FIDO implementation is not compiled in for Android.
129 if (!is_android) {
130 sources += [
131 "fido/attestation_statement_formats_unittest.cc",
132 "fido/bio/enrollment_handler_unittest.cc",
133 "fido/ble_adapter_manager_unittest.cc",
134 "fido/cable/fido_ble_connection_unittest.cc",
135 "fido/cable/fido_ble_frames_unittest.cc",
136 "fido/cable/fido_ble_transaction_unittest.cc",
137 "fido/cable/fido_cable_device_unittest.cc",
138 "fido/cable/fido_cable_discovery_unittest.cc",
139 "fido/cable/fido_cable_handshake_handler_unittest.cc",
140 "fido/cable/v2_handshake_unittest.cc",
141 "fido/cbor_extract_unittest.cc",
142 "fido/credential_management_handler_unittest.cc",
143 "fido/ctap_request_unittest.cc",
144 "fido/ctap_response_unittest.cc",
145 "fido/fake_fido_discovery_unittest.cc",
146 "fido/fido_device_discovery_unittest.cc",
147 "fido/fido_parsing_utils_unittest.cc",
148 "fido/fido_request_handler_unittest.cc",
149 "fido/get_assertion_handler_unittest.cc",
150 "fido/get_assertion_task_unittest.cc",
151 "fido/hid/fido_hid_message_unittest.cc",
152 "fido/mac/browsing_data_deletion_unittest.mm",
153 "fido/mac/credential_metadata_unittest.cc",
154 "fido/mac/get_assertion_operation_unittest_mac.mm",
155 "fido/mac/make_credential_operation_unittest_mac.mm",
156 "fido/mac/util_unittest.cc",
157 "fido/make_credential_handler_unittest.cc",
158 "fido/make_credential_task_unittest.cc",
159 "fido/test_callback_receiver_unittest.cc",
160 "fido/u2f_command_constructor_unittest.cc",
161 "fido/u2f_register_operation_unittest.cc",
162 "fido/u2f_sign_operation_unittest.cc",
163 "fido/virtual_ctap2_device_unittest.cc",
164 "fido/virtual_u2f_device_unittest.cc",
165 "fido/win/type_conversions_unittest.cc",
166 ]
167
168 deps += [ "//device/fido:mocks" ]
169 }
170
171 # FIDO HID:
scheibcfdca0e2015-04-01 05:27:58172 # Android doesn't compile.
scheib7a4cf042015-03-31 04:33:44173 # Linux, requires udev.
scheibcfdca0e2015-04-01 05:27:58174 if (!is_linux_without_udev && !is_android) {
scheib7a4cf042015-03-31 04:33:44175 sources += [
Kim Paulhamus534308e2018-07-23 20:58:43176 "fido/hid/fido_hid_device_unittest.cc",
177 "fido/hid/fido_hid_discovery_unittest.cc",
scheib7a4cf042015-03-31 04:33:44178 ]
179 deps += [
jdoerrie3e747742018-02-05 16:04:16180 "//device/fido:test_support",
Ke He624b52d2017-11-09 13:45:09181 "//services/device/public/cpp/hid",
Ke He31d0bb02018-02-24 07:16:24182 "//services/device/public/mojom",
scheib7a4cf042015-03-31 04:33:44183 ]
184 }
185
186 if (use_udev) {
Matt Reynoldsd4103e72020-05-07 21:33:50187 sources += [
188 "udev_linux/udev_unittest.cc",
189 "udev_linux/udev_watcher_unittest.cc",
190 ]
Zentaro Kavanagh8c7826f2020-04-30 22:11:03191 deps += [
192 "//device/udev_linux",
193 "//device/udev_linux:test_support",
194 ]
scheib7a4cf042015-03-31 04:33:44195 }
196
scheib56010cc2015-06-25 01:29:47197 if (is_android) {
agrieve97176362015-12-01 16:36:19198 deps += [
199 ":bluetooth_test_java",
200 ":bluetooth_test_jni_headers",
201 ]
scheib56010cc2015-06-25 01:29:47202 }
203
Ryan Hansberry27c9c582019-03-22 04:38:52204 if (is_chromeos) {
205 sources += [ "bluetooth/chromeos/bluetooth_utils_unittest.cc" ]
206 deps += [ "//chromeos/constants" ]
207 }
208
dnicoara59acb3022015-12-17 18:13:16209 if ((is_chromeos || is_linux) && use_dbus) {
agrieve95ba4442016-04-25 15:47:13210 configs += [ "//build/config/linux/dbus" ]
rkc41077042015-11-06 07:20:58211
212 sources += [
rkc122239752016-04-20 23:59:08213 "bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc",
214 "bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08215 "bluetooth/bluez/bluetooth_bluez_unittest.cc",
216 "bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc",
rkc2ffd5612016-06-24 02:00:22217 "bluetooth/bluez/bluetooth_service_attribute_value_bluez_unittest.cc",
218 "bluetooth/bluez/bluetooth_service_record_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08219 "bluetooth/bluez/bluetooth_socket_bluez_unittest.cc",
rkca7a149d2016-04-29 08:15:37220 "bluetooth/dbus/bluetooth_gatt_application_service_provider_unittest.cc",
rkc519a20c62016-04-16 23:18:07221 "bluetooth/test/bluetooth_test_bluez.cc",
222 "bluetooth/test/bluetooth_test_bluez.h",
rkc41077042015-11-06 07:20:58223 ]
224
225 deps += [ "//dbus" ]
James Hollyer976d3eea2019-10-02 06:21:09226
227 if (is_chromeos) {
228 deps += [ "//services/data_decoder/public/mojom" ]
229 }
rkc41077042015-11-06 07:20:58230 }
231
Pavel Kalinnikov9f6591002017-11-01 22:09:18232 if (is_linux) {
Stephen Lanham1316af42018-04-04 01:26:28233 if (is_chromecast) {
Stephen Lanhamccd5c252018-04-10 04:21:56234 # Cast does not support GATT server mode.
235 sources -= [
236 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
237 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
238 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
239 ]
240
Stephen Lanham1316af42018-04-04 01:26:28241 sources += [
242 "bluetooth/cast/bluetooth_adapter_cast_unittest.cc",
243 "bluetooth/cast/bluetooth_utils_unittest.cc",
Stephen Lanhamccd5c252018-04-10 04:21:56244 "bluetooth/test/bluetooth_test_cast.cc",
245 "bluetooth/test/bluetooth_test_cast.h",
Stephen Lanham1316af42018-04-04 01:26:28246 ]
Stephen Lanhamccd5c252018-04-10 04:21:56247
248 deps += [
249 "//chromecast/device/bluetooth:util",
250 "//chromecast/device/bluetooth/le",
Bailey Forrestfda35092018-05-16 00:30:44251 "//chromecast/device/bluetooth/le:test_support",
Stephen Lanhamccd5c252018-04-10 04:21:56252 "//chromecast/device/bluetooth/shlib:mock_shlib",
253 ]
Stephen Lanham1316af42018-04-04 01:26:28254 }
Pavel Kalinnikov9f6591002017-11-01 22:09:18255 }
256
tfarinacdc7e5d2015-02-23 09:52:24257 if (is_mac) {
krstnmnlsn332a71cf2015-07-17 18:59:58258 deps += [ "//third_party/ocmock" ]
259 ldflags = [ "-ObjC" ]
rsesekdbb69c72016-05-11 17:26:35260 libs = [
Robert Seseke55299452020-02-19 15:18:14261 "CoreBluetooth.framework",
rsesekdbb69c72016-05-11 17:26:35262 "IOBluetooth.framework",
263 "IOKit.framework",
264 ]
tfarinacdc7e5d2015-02-23 09:52:24265 }
gogeraldcab31232016-02-03 21:20:33266
267 if (is_win) {
268 sources += [
gogeraldb8c706a2016-02-05 01:07:37269 "bluetooth/bluetooth_classic_win_fake.cc",
270 "bluetooth/bluetooth_classic_win_fake.h",
gogeraldcab31232016-02-03 21:20:33271 "bluetooth/bluetooth_low_energy_win_fake.cc",
272 "bluetooth/bluetooth_low_energy_win_fake.h",
Jan Wilken Doerriecc0bd292018-05-14 12:28:28273 "bluetooth/test/fake_bluetooth_adapter_winrt.cc",
274 "bluetooth/test/fake_bluetooth_adapter_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18275 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.cc",
276 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.h",
Jan Wilken Doerrief397e842018-08-23 17:40:17277 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.cc",
278 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.h",
279 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.cc",
280 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.h",
Jan Wilken Dörried4dc7782018-06-04 09:38:13281 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.cc",
282 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.h",
283 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.cc",
284 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.h",
285 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.cc",
286 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43287 "bluetooth/test/fake_bluetooth_le_device_winrt.cc",
288 "bluetooth/test/fake_bluetooth_le_device_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18289 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.cc",
290 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41291 "bluetooth/test/fake_device_information_custom_pairing_winrt.cc",
292 "bluetooth/test/fake_device_information_custom_pairing_winrt.h",
Jan Wilken Doerrie9092f832018-08-14 07:05:11293 "bluetooth/test/fake_device_information_pairing_winrt.cc",
294 "bluetooth/test/fake_device_information_pairing_winrt.h",
Jan Wilken Doerrie7c0e41dc2018-05-16 08:37:52295 "bluetooth/test/fake_device_information_winrt.cc",
296 "bluetooth/test/fake_device_information_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41297 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.cc",
298 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.h",
299 "bluetooth/test/fake_device_pairing_result_winrt.cc",
300 "bluetooth/test/fake_device_pairing_result_winrt.h",
Jan Wilken Doerriebcd90ba2018-08-30 12:36:29301 "bluetooth/test/fake_device_watcher_winrt.cc",
302 "bluetooth/test/fake_device_watcher_winrt.h",
Jan Wilken Doerried66e0a92018-07-07 10:48:19303 "bluetooth/test/fake_gatt_characteristic_winrt.cc",
304 "bluetooth/test/fake_gatt_characteristic_winrt.h",
305 "bluetooth/test/fake_gatt_characteristics_result_winrt.cc",
306 "bluetooth/test/fake_gatt_characteristics_result_winrt.h",
Jan Wilken Doerrie2a3e6c92018-07-31 08:39:16307 "bluetooth/test/fake_gatt_descriptor_winrt.cc",
308 "bluetooth/test/fake_gatt_descriptor_winrt.h",
309 "bluetooth/test/fake_gatt_descriptors_result_winrt.cc",
310 "bluetooth/test/fake_gatt_descriptors_result_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43311 "bluetooth/test/fake_gatt_device_service_winrt.cc",
312 "bluetooth/test/fake_gatt_device_service_winrt.h",
313 "bluetooth/test/fake_gatt_device_services_result_winrt.cc",
314 "bluetooth/test/fake_gatt_device_services_result_winrt.h",
Jan Wilken Doerrie1bd49ee2018-07-30 10:59:00315 "bluetooth/test/fake_gatt_read_result_winrt.cc",
316 "bluetooth/test/fake_gatt_read_result_winrt.h",
Martin Kreichgauer3d6c10d2020-06-16 17:25:51317 "bluetooth/test/fake_gatt_session_winrt.cc",
318 "bluetooth/test/fake_gatt_session_winrt.h",
Jan Wilken Dörriee0029d12018-08-06 14:06:08319 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.cc",
320 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.h",
Jan Wilken Doerrief5b008c42018-08-01 08:12:56321 "bluetooth/test/fake_gatt_write_result_winrt.cc",
322 "bluetooth/test/fake_gatt_write_result_winrt.h",
Jan Wilken Dörriedc7c81c2018-06-12 07:34:38323 "bluetooth/test/fake_radio_winrt.cc",
324 "bluetooth/test/fake_radio_winrt.h",
gogeraldcab31232016-02-03 21:20:33325 ]
326 }
bajones7ab52ec32016-08-19 19:54:25327
Bill Orr1862b4f2018-05-10 17:56:45328 if (enable_vr) {
Michael Thiessen21e56152017-10-16 18:55:17329 sources += [
Anna Maria114d35052017-12-08 23:13:29330 "vr/orientation/orientation_device_provider_unittest.cc",
331 "vr/orientation/orientation_device_unittest.cc",
Bill Orrb35b4cd82019-03-05 00:13:39332 "vr/util/fps_meter_unittest.cc",
333 "vr/util/sliding_average_unittest.cc",
Alex Cooper93f1c752019-11-22 23:58:02334 "vr/util/stage_utils_unittest.cc",
Michael Thiessen21e56152017-10-16 18:55:17335 "vr/vr_device_base_unittest.cc",
Michael Thiessen21e56152017-10-16 18:55:17336 ]
bajones7ab52ec32016-08-19 19:54:25337
Bill Orr1862b4f2018-05-10 17:56:45338 if (is_android) {
339 deps += [ "//device/vr:java" ]
340 }
341
342 defines = [ "DEVICE_VR_IMPLEMENTATION" ]
343
bajones7ab52ec32016-08-19 19:54:25344 deps += [
345 "//device/vr",
Alexander Cooper53e25812020-04-01 17:35:58346 "//device/vr:vr_fakes",
Alexander Coopercb573b02020-04-21 22:16:35347 "//device/vr/orientation",
Reilly Grantfa93b142018-02-01 02:13:48348 "//device/vr/public/mojom",
Anna Maria114d35052017-12-08 23:13:29349 "//services/device/public/cpp/generic_sensor",
350 "//ui/display",
Roman Karasev72254172018-04-05 18:10:03351 "//ui/display:test_support",
bajones7ab52ec32016-08-19 19:54:25352 ]
353 }
Matt Reynoldsb37eb1292019-03-19 22:19:40354
355 # Some gamepad tests require the HID service. Only build these tests on
356 # platforms where the HID service is enabled.
357 if (!is_android && !is_fuchsia) {
358 sources += [ "gamepad/nintendo_data_fetcher_unittest.cc" ]
359
360 deps += [
361 "//services/device:test_support",
362 "//services/device/hid",
363 "//services/device/hid:mocks",
364 ]
365 }
tfarinacdc7e5d2015-02-23 09:52:24366}
scheib56010cc2015-06-25 01:29:47367
368if (is_android) {
Matt Reynolds7c498e52017-12-06 22:06:24369 bluetooth_java_sources_needing_jni = [
370 "bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java",
James Hollyerf8e00682019-11-20 02:11:21371 "bluetooth/test/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothScanFilter.java",
Matt Reynolds7c498e52017-12-06 22:06:24372 ]
scheib56010cc2015-06-25 01:29:47373
374 generate_jni("bluetooth_test_jni_headers") {
Eric Stevenson4c4d6342019-10-04 20:02:47375 testonly = true
scheib56010cc2015-06-25 01:29:47376 sources = bluetooth_java_sources_needing_jni
scheib56010cc2015-06-25 01:29:47377 }
378
379 android_library("bluetooth_test_java") {
Shimi Zhang0d7b74af2018-02-08 17:28:02380 testonly = true
Natalie Chouinard8b9cf7c2019-12-20 02:21:40381 sources = bluetooth_java_sources_needing_jni
scheib56010cc2015-06-25 01:29:47382 deps = [
383 "//base:base_java",
ortuno5966ddb2016-07-01 02:07:25384 "//components/location/android:location_java",
scheib56010cc2015-06-25 01:29:47385 "//device/bluetooth:java",
Ben Joyce5f8afefd2019-09-13 07:21:03386 "//third_party/android_deps:androidx_annotation_annotation_java",
Peter Wen22bc3ec2019-03-28 22:18:02387 "//third_party/android_sdk:android_test_mock_java",
scheib56010cc2015-06-25 01:29:47388 ]
ortunocc9b46d12016-08-25 16:47:23389
390 srcjar_deps = [ ":bluetooth_test_javagen" ]
scheib56010cc2015-06-25 01:29:47391 }
bajonesb9bb4c42016-07-07 00:10:51392
393 junit_binary("device_junit_tests") {
Nico Weberb355af2e2020-01-14 03:27:58394 sources = [ "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java" ]
bajonesb9bb4c42016-07-07 00:10:51395 deps = [
mcasas649deb52017-04-28 01:55:52396 "$google_play_services_package:google_play_services_base_java",
397 "$google_play_services_package:google_play_services_basement_java",
398 "$google_play_services_package:google_play_services_location_java",
bajonesb9bb4c42016-07-07 00:10:51399 "//base:base_java",
400 "//base:base_java_test_support",
Andrew Grieve916bc9b2018-02-02 01:38:59401 "//base:base_junit_test_support",
bajonesb9bb4c42016-07-07 00:10:51402 "//device/gamepad:java",
alexander.shalamov55ac6a4c2016-11-30 09:04:17403 "//mojo/public/java:bindings_java",
Ben Joyce5f8afefd2019-09-13 07:21:03404 "//third_party/android_deps:androidx_annotation_annotation_java",
bajonesb9bb4c42016-07-07 00:10:51405 ]
406 srcjar_deps = [ "//device/gamepad:java_enums_srcjar" ]
407 }
ortunocc9b46d12016-08-25 16:47:23408
409 java_cpp_enum("bluetooth_test_javagen") {
Nico Weberb355af2e2020-01-14 03:27:58410 sources = [ "bluetooth/test/bluetooth_test.h" ]
ortunocc9b46d12016-08-25 16:47:23411 }
scheib56010cc2015-06-25 01:29:47412}