blob: 427af3e679fdda65c791b562cd6f5a665fc22db0 [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 Hollyer213cbbc2019-01-17 21:46:4923 "bluetooth/bluetooth_adapter_mac_metrics_unittest.mm",
tfarinacdc7e5d2015-02-23 09:52:2424 "bluetooth/bluetooth_adapter_mac_unittest.mm",
tfarinacdc7e5d2015-02-23 09:52:2425 "bluetooth/bluetooth_adapter_unittest.cc",
26 "bluetooth/bluetooth_adapter_win_unittest.cc",
ortuno945c90d2015-09-01 01:47:0827 "bluetooth/bluetooth_advertisement_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2428 "bluetooth/bluetooth_device_unittest.cc",
29 "bluetooth/bluetooth_device_win_unittest.cc",
jpawlowskif54d01542015-04-13 22:24:4330 "bluetooth/bluetooth_discovery_filter_unittest.cc",
rkc3fb9aa6d2016-05-03 20:39:4431 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
32 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
rkc907af5d2016-05-10 00:20:0233 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
Tim Song51ffb6602018-08-02 05:57:3534 "bluetooth/bluetooth_low_energy_advertisement_manager_mac_unittest.mm",
tfarinacdc7e5d2015-02-23 09:52:2435 "bluetooth/bluetooth_low_energy_win_unittest.cc",
rkc122239752016-04-20 23:59:0836 "bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc",
37 "bluetooth/bluetooth_remote_gatt_descriptor_unittest.cc",
38 "bluetooth/bluetooth_remote_gatt_service_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2439 "bluetooth/bluetooth_service_record_win_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:2440 "bluetooth/bluetooth_task_manager_win_unittest.cc",
41 "bluetooth/bluetooth_uuid_unittest.cc",
mbrunson32391c12016-11-18 23:42:1542 "bluetooth/device_unittest.cc",
ortunob755ff32016-08-25 21:29:3043 "bluetooth/string_util_icu_unittest.cc",
rkc3fb9aa6d2016-05-03 20:39:4444 "bluetooth/test/bluetooth_gatt_server_test.cc",
45 "bluetooth/test/bluetooth_gatt_server_test.h",
scheib545d7fd2015-06-30 22:26:5846 "bluetooth/test/bluetooth_test.cc",
47 "bluetooth/test/bluetooth_test.h",
48 "bluetooth/test/bluetooth_test_android.cc",
49 "bluetooth/test/bluetooth_test_android.h",
krstnmnlsn56d371032015-07-21 20:18:0750 "bluetooth/test/bluetooth_test_mac.h",
51 "bluetooth/test/bluetooth_test_mac.mm",
gogerald512935cc2016-01-27 01:11:1852 "bluetooth/test/bluetooth_test_win.cc",
53 "bluetooth/test/bluetooth_test_win.h",
jlebel620327d2016-06-20 13:01:0054 "bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h",
55 "bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm",
jlebel9bb8cf242017-01-10 01:29:0256 "bluetooth/test/mock_bluetooth_cbdescriptor_mac.h",
57 "bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm",
jlebela58fd752016-03-14 10:33:2858 "bluetooth/test/mock_bluetooth_cbperipheral_mac.h",
59 "bluetooth/test/mock_bluetooth_cbperipheral_mac.mm",
jlebelc4b09782016-05-10 00:31:5860 "bluetooth/test/mock_bluetooth_cbservice_mac.h",
61 "bluetooth/test/mock_bluetooth_cbservice_mac.mm",
jlebela58fd752016-03-14 10:33:2862 "bluetooth/test/mock_bluetooth_central_manager_mac.h",
63 "bluetooth/test/mock_bluetooth_central_manager_mac.mm",
scheib42e6b49d2015-04-29 21:46:5764 "bluetooth/test/test_bluetooth_adapter_observer.cc",
65 "bluetooth/test/test_bluetooth_adapter_observer.h",
Jan Wilken Doerried5832e62018-08-28 16:39:5066 "bluetooth/test/test_bluetooth_advertisement_observer.cc",
67 "bluetooth/test/test_bluetooth_advertisement_observer.h",
rkc3fb9aa6d2016-05-03 20:39:4468 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc",
69 "bluetooth/test/test_bluetooth_local_gatt_service_delegate.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:4170 "bluetooth/test/test_pairing_delegate.cc",
71 "bluetooth/test/test_pairing_delegate.h",
reillygaaee8912017-03-23 22:16:0672 "bluetooth/uribeacon/uri_encoder_unittest.cc",
Martin Kreichgauer43debfd72018-07-30 19:59:4173 "fido/attestation_statement_formats_unittest.cc",
Kim Paulhamused01860d2018-07-23 23:47:3774 "fido/ble/fido_ble_connection_unittest.cc",
75 "fido/ble/fido_ble_device_unittest.cc",
76 "fido/ble/fido_ble_frames_unittest.cc",
Jun Choi123d6c22018-09-21 00:48:2877 "fido/ble/fido_ble_pairing_delegate_unittest.cc",
jdoerrie3848eaa2018-09-19 15:02:0378 "fido/ble/fido_ble_transaction_unittest.cc",
Jun Choi930dfaff62018-10-02 22:55:5379 "fido/ble_adapter_manager_unittest.cc",
Kim Paulhamus7018442b2018-07-25 15:26:2780 "fido/cable/fido_cable_device_unittest.cc",
81 "fido/cable/fido_cable_discovery_unittest.cc",
82 "fido/cable/fido_cable_handshake_handler_unittest.cc",
Martin Kreichgauer20c37812019-04-25 20:39:2883 "fido/credential_management_handler_unittest.cc",
jdoerrie98ee9e32018-02-05 22:03:4484 "fido/ctap_request_unittest.cc",
85 "fido/ctap_response_unittest.cc",
Jun Choiaaa7d012018-03-16 20:11:4086 "fido/fake_fido_discovery_unittest.cc",
Martin Kreichgauerddc70be2018-10-09 03:16:1287 "fido/fido_device_discovery_unittest.cc",
Jun Choi19b944e92018-04-23 20:20:2088 "fido/fido_parsing_utils_unittest.cc",
Jun Choi1c36cd82018-03-28 00:32:4289 "fido/fido_request_handler_unittest.cc",
Jun Choi4fc8b7812018-04-05 07:39:0790 "fido/get_assertion_handler_unittest.cc",
Jun Choi177d2ac2018-03-28 08:32:1691 "fido/get_assertion_task_unittest.cc",
Kim Paulhamus534308e2018-07-23 20:58:4392 "fido/hid/fido_hid_message_unittest.cc",
Martin Kreichgauerd52effd02018-07-09 20:33:0993 "fido/mac/browsing_data_deletion_unittest.mm",
Martin Kreichgauer9b5dab32018-06-06 12:26:3994 "fido/mac/credential_metadata_unittest.cc",
Martin Kreichgauereaf85f12018-05-01 19:52:4295 "fido/mac/get_assertion_operation_unittest_mac.mm",
96 "fido/mac/make_credential_operation_unittest_mac.mm",
Martin Kreichgauer35bea102018-06-28 20:41:3297 "fido/mac/util_unittest.cc",
Jun Choif7ab0df2018-04-05 21:48:1698 "fido/make_credential_handler_unittest.cc",
Jun Choif15afe42018-03-22 23:58:0199 "fido/make_credential_task_unittest.cc",
Balazs Engedy1ab4b142018-03-09 12:45:03100 "fido/test_callback_receiver_unittest.cc",
Jun Choi85b28722018-04-25 21:24:50101 "fido/u2f_command_constructor_unittest.cc",
Jun Choif45741d2018-06-08 20:58:31102 "fido/u2f_register_operation_unittest.cc",
Jun Choi0e56e5dd2018-06-08 21:27:34103 "fido/u2f_sign_operation_unittest.cc",
Martin Kreichgauer170fba42019-01-23 17:23:17104 "fido/win/type_conversions_unittest.cc",
Matt Reynolds7c498e52017-12-06 22:06:24105 "gamepad/abstract_haptic_gamepad_unittest.cc",
Matt Reynolds054d99b2018-12-06 02:40:24106 "gamepad/gamepad_id_list_unittest.cc",
bajonesb9bb4c42016-07-07 00:10:51107 "gamepad/gamepad_provider_unittest.cc",
ke.hebee6a642016-12-10 01:56:19108 "gamepad/gamepad_service_unittest.cc",
Matt Reynolds5fc98382018-11-30 04:15:07109 "gamepad/hid_haptic_gamepad_base_unittest.cc",
Oksana Zhuravlova96b546c2018-08-08 19:01:33110 "gamepad/public/cpp/gamepad_mojom_traits_unittest.cc",
tfarinacdc7e5d2015-02-23 09:52:24111 "test/run_all_unittests.cc",
tfarinacdc7e5d2015-02-23 09:52:24112 ]
113
Scott Grahambf77d352018-10-25 17:50:54114 if (is_fuchsia) {
115 sources += [
116 "bluetooth/test/bluetooth_test_fuchsia.cc",
117 "bluetooth/test/bluetooth_test_fuchsia.h",
118 ]
119 }
120
tfarinacdc7e5d2015-02-23 09:52:24121 deps = [
Ovidio Henriquez21095442019-03-06 18:22:55122 "//base",
tfarinacdc7e5d2015-02-23 09:52:24123 "//base/test:test_support",
alexis.menardb39a30822016-09-30 15:14:39124 "//base/third_party/dynamic_annotations:dynamic_annotations",
Jun Choi3545f502018-03-14 01:30:00125 "//components/apdu",
Kim Paulhamus35995bb62018-01-05 11:47:04126 "//components/cbor",
alexis.menardb39a30822016-09-30 15:14:39127 "//device/base/synchronization",
tfarinacdc7e5d2015-02-23 09:52:24128 "//device/bluetooth",
Vincent Scheibdbe693bee2017-12-06 00:54:18129 "//device/bluetooth:deprecated_experimental_mojo",
brettw011138d2015-10-21 03:05:38130 "//device/bluetooth:mocks",
reillygaaee8912017-03-23 22:16:06131 "//device/bluetooth/uribeacon",
jdoerrie3e747742018-02-05 16:04:16132 "//device/fido",
133 "//device/fido:mocks",
Balazs Engedy83dc0822018-03-07 14:33:55134 "//device/fido:test_support",
bajonesb9bb4c42016-07-07 00:10:51135 "//device/gamepad",
136 "//device/gamepad:test_helpers",
juncai2f298a82017-04-18 03:51:39137 "//device/gamepad/public/cpp:shared_with_blink",
Reilly Grantfa93b142018-02-01 02:13:48138 "//device/gamepad/public/mojom",
Ken Rockot9b26bc52018-07-04 19:57:49139 "//mojo/core/embedder",
rockot85dce0862015-11-13 01:33:59140 "//mojo/public/cpp/bindings",
Oksana Zhuravlova96b546c2018-08-08 19:01:33141 "//mojo/public/cpp/test_support:test_utils",
tfarinacdc7e5d2015-02-23 09:52:24142 "//net",
143 "//testing/gmock",
144 "//testing/gtest",
Blink Reformata30d4232018-04-07 15:31:06145 "//third_party/blink/public:blink_headers",
reillyg872fd9fc2016-02-04 21:50:04146 "//tools/usb_gadget",
Ovidio Henriquez21095442019-03-06 18:22:55147 "//ui/base",
tfarinacdc7e5d2015-02-23 09:52:24148 "//url",
149 ]
150
Ovidio Henriquez21095442019-03-06 18:22:55151 data_deps = [
152 "bluetooth/strings:bluetooth_test_strings",
153 "//ui/resources:ui_test_pak_data",
154 ]
155
Reilly Grant2d2253a2019-01-04 21:30:00156 # U2F:
scheibcfdca0e2015-04-01 05:27:58157 # Android doesn't compile.
scheib7a4cf042015-03-31 04:33:44158 # Linux, requires udev.
scheibcfdca0e2015-04-01 05:27:58159 if (!is_linux_without_udev && !is_android) {
scheib7a4cf042015-03-31 04:33:44160 sources += [
Kim Paulhamus534308e2018-07-23 20:58:43161 "fido/hid/fido_hid_device_unittest.cc",
162 "fido/hid/fido_hid_discovery_unittest.cc",
scheib7a4cf042015-03-31 04:33:44163 ]
164 deps += [
jdoerrie3e747742018-02-05 16:04:16165 "//device/fido:test_support",
Ke He624b52d2017-11-09 13:45:09166 "//services/device/public/cpp/hid",
Ke He31d0bb02018-02-24 07:16:24167 "//services/device/public/mojom",
Ke He5c1e93a32017-10-05 04:27:35168 "//services/service_manager/public/cpp",
Ken Rockot543f5e32018-02-04 02:13:50169 "//services/service_manager/public/mojom",
scheib7a4cf042015-03-31 04:33:44170 ]
171 }
172
173 if (use_udev) {
174 sources += [ "udev_linux/udev_unittest.cc" ]
175 deps += [ "//device/udev_linux" ]
176 }
177
reillygcf1af632015-11-18 16:42:58178 # USB does not compile on iOS.
179 if (!is_ios) {
scheibcfdca0e2015-04-01 05:27:58180 sources += [
reillygbadbc5412015-08-28 23:08:10181 "test/test_device_client.cc",
182 "test/test_device_client.h",
reillyg64c8f4f2016-02-10 23:29:20183 "usb/mojo/device_impl_unittest.cc",
184 "usb/mojo/device_manager_impl_unittest.cc",
Donna Wu50436d82018-10-10 08:33:30185 "usb/public/cpp/usb_utils_unittest.cc",
reillyg86549e52015-08-15 03:00:43186 "usb/usb_descriptors_unittest.cc",
scheibcfdca0e2015-04-01 05:27:58187 "usb/usb_device_handle_unittest.cc",
scheibcfdca0e2015-04-01 05:27:58188 "usb/usb_service_unittest.cc",
reillyg86549e52015-08-15 03:00:43189 "usb/webusb_descriptors_unittest.cc",
scheibcfdca0e2015-04-01 05:27:58190 ]
191 deps += [
Ke He624b52d2017-11-09 13:45:09192 ":usb_test_gadget",
alexis.menard2fe63eaa2016-10-13 21:42:43193 "//device/base",
194 "//device/base:mocks",
scheibcfdca0e2015-04-01 05:27:58195 "//device/usb",
reillygcff166d2016-05-20 20:15:42196 "//device/usb:test_support",
reillyg64c8f4f2016-02-10 23:29:20197 "//device/usb/mojo",
Reilly Grant7f162c92017-06-10 00:23:47198 "//device/usb/public/cpp",
Reilly Grantfa93b142018-02-01 02:13:48199 "//device/usb/public/mojom",
rhalavatid75e16c32017-03-03 15:08:24200 "//net:test_support",
scheibcfdca0e2015-04-01 05:27:58201 ]
Reilly Grant5ac479c2017-10-03 16:57:37202
203 if (!is_android) {
Samuel Huang2cb0922d2017-10-30 18:37:00204 sources += [ "usb/usb_ids_unittest.cc" ]
Reilly Grant5ac479c2017-10-03 16:57:37205 }
scheibcfdca0e2015-04-01 05:27:58206 }
207
reillygcf1af632015-11-18 16:42:58208 # UsbContext is a libusb-specific object.
reillygdee7c4ac2016-05-27 21:15:02209 if (is_mac || is_win) {
reillygcf1af632015-11-18 16:42:58210 sources += [ "usb/usb_context_unittest.cc" ]
brettwbda835b2015-12-04 22:12:30211 deps += [ "//third_party/libusb" ]
reillygcf1af632015-11-18 16:42:58212 }
213
scheib56010cc2015-06-25 01:29:47214 if (is_android) {
agrieve97176362015-12-01 16:36:19215 deps += [
216 ":bluetooth_test_java",
217 ":bluetooth_test_jni_headers",
reillyg16001d92016-06-01 00:44:30218 "//device/usb:java",
agrieve97176362015-12-01 16:36:19219 ]
scheib56010cc2015-06-25 01:29:47220 }
221
Ryan Hansberry27c9c582019-03-22 04:38:52222 if (is_chromeos) {
223 sources += [ "bluetooth/chromeos/bluetooth_utils_unittest.cc" ]
224 deps += [ "//chromeos/constants" ]
225 }
226
dnicoara59acb3022015-12-17 18:13:16227 if ((is_chromeos || is_linux) && use_dbus) {
agrieve95ba4442016-04-25 15:47:13228 configs += [ "//build/config/linux/dbus" ]
rkc41077042015-11-06 07:20:58229
230 sources += [
rkc122239752016-04-20 23:59:08231 "bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc",
232 "bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08233 "bluetooth/bluez/bluetooth_bluez_unittest.cc",
234 "bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc",
rkc2ffd5612016-06-24 02:00:22235 "bluetooth/bluez/bluetooth_service_attribute_value_bluez_unittest.cc",
236 "bluetooth/bluez/bluetooth_service_record_bluez_unittest.cc",
rkc122239752016-04-20 23:59:08237 "bluetooth/bluez/bluetooth_socket_bluez_unittest.cc",
rkca7a149d2016-04-29 08:15:37238 "bluetooth/dbus/bluetooth_gatt_application_service_provider_unittest.cc",
rkc519a20c62016-04-16 23:18:07239 "bluetooth/test/bluetooth_test_bluez.cc",
240 "bluetooth/test/bluetooth_test_bluez.h",
rkc41077042015-11-06 07:20:58241 ]
242
243 deps += [ "//dbus" ]
244 }
245
Pavel Kalinnikov9f6591002017-11-01 22:09:18246 if (is_linux) {
Stephen Lanham1316af42018-04-04 01:26:28247 if (is_chromecast) {
Stephen Lanhamccd5c252018-04-10 04:21:56248 # Cast does not support GATT server mode.
249 sources -= [
250 "bluetooth/bluetooth_local_gatt_characteristic_unittest.cc",
251 "bluetooth/bluetooth_local_gatt_descriptor_unittest.cc",
252 "bluetooth/bluetooth_local_gatt_service_unittest.cc",
253 ]
254
Stephen Lanham1316af42018-04-04 01:26:28255 sources += [
256 "bluetooth/cast/bluetooth_adapter_cast_unittest.cc",
257 "bluetooth/cast/bluetooth_utils_unittest.cc",
Stephen Lanhamccd5c252018-04-10 04:21:56258 "bluetooth/test/bluetooth_test_cast.cc",
259 "bluetooth/test/bluetooth_test_cast.h",
Stephen Lanham1316af42018-04-04 01:26:28260 ]
Stephen Lanhamccd5c252018-04-10 04:21:56261
262 deps += [
263 "//chromecast/device/bluetooth:util",
264 "//chromecast/device/bluetooth/le",
Bailey Forrestfda35092018-05-16 00:30:44265 "//chromecast/device/bluetooth/le:test_support",
Stephen Lanhamccd5c252018-04-10 04:21:56266 "//chromecast/device/bluetooth/shlib:mock_shlib",
267 ]
268 } else {
269 # BLE discovery: works on Linux.
Kim Paulhamused01860d2018-07-23 23:47:37270 sources += [ "fido/ble/fido_ble_discovery_unittest.cc" ]
Stephen Lanham1316af42018-04-04 01:26:28271 }
Pavel Kalinnikov9f6591002017-11-01 22:09:18272 }
273
tfarinacdc7e5d2015-02-23 09:52:24274 if (is_mac) {
krstnmnlsn332a71cf2015-07-17 18:59:58275 deps += [ "//third_party/ocmock" ]
276 ldflags = [ "-ObjC" ]
rsesekdbb69c72016-05-11 17:26:35277 libs = [
278 "IOBluetooth.framework",
279 "IOKit.framework",
280 ]
erikchenceb2fff2015-04-27 17:50:54281
282 # In the OSX 10.10 SDK, CoreBluetooth became a top level framework.
283 # Previously, it was nested in IOBluetooth. In order for Chrome to run on
284 # OSes older than OSX 10.10, the top level CoreBluetooth framework must be
285 # weakly linked.
286 if (mac_sdk_version == "10.10") {
scheibdd941ba42015-10-27 05:40:12287 ldflags += [
288 "-weak_framework",
289 "CoreBluetooth",
290 ]
erikchenceb2fff2015-04-27 17:50:54291 }
tfarinacdc7e5d2015-02-23 09:52:24292 }
gogeraldcab31232016-02-03 21:20:33293
294 if (is_win) {
295 sources += [
gogeraldb8c706a2016-02-05 01:07:37296 "bluetooth/bluetooth_classic_win_fake.cc",
297 "bluetooth/bluetooth_classic_win_fake.h",
gogeraldcab31232016-02-03 21:20:33298 "bluetooth/bluetooth_low_energy_win_fake.cc",
299 "bluetooth/bluetooth_low_energy_win_fake.h",
Jan Wilken Doerriecc0bd292018-05-14 12:28:28300 "bluetooth/test/fake_bluetooth_adapter_winrt.cc",
301 "bluetooth/test/fake_bluetooth_adapter_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18302 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.cc",
303 "bluetooth/test/fake_bluetooth_le_advertisement_data_section_winrt.h",
Jan Wilken Doerrief397e842018-08-23 17:40:17304 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.cc",
305 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_status_changed_event_args_winrt.h",
306 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.cc",
307 "bluetooth/test/fake_bluetooth_le_advertisement_publisher_winrt.h",
Jan Wilken Dörried4dc7782018-06-04 09:38:13308 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.cc",
309 "bluetooth/test/fake_bluetooth_le_advertisement_received_event_args_winrt.h",
310 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.cc",
311 "bluetooth/test/fake_bluetooth_le_advertisement_watcher_winrt.h",
312 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.cc",
313 "bluetooth/test/fake_bluetooth_le_advertisement_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43314 "bluetooth/test/fake_bluetooth_le_device_winrt.cc",
315 "bluetooth/test/fake_bluetooth_le_device_winrt.h",
Jan Wilken Doerriec75765a752018-07-20 11:36:18316 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.cc",
317 "bluetooth/test/fake_bluetooth_le_manufacturer_data_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41318 "bluetooth/test/fake_device_information_custom_pairing_winrt.cc",
319 "bluetooth/test/fake_device_information_custom_pairing_winrt.h",
Jan Wilken Doerrie9092f832018-08-14 07:05:11320 "bluetooth/test/fake_device_information_pairing_winrt.cc",
321 "bluetooth/test/fake_device_information_pairing_winrt.h",
Jan Wilken Doerrie7c0e41dc2018-05-16 08:37:52322 "bluetooth/test/fake_device_information_winrt.cc",
323 "bluetooth/test/fake_device_information_winrt.h",
Jan Wilken Doerrie7aa28512018-08-17 08:11:41324 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.cc",
325 "bluetooth/test/fake_device_pairing_requested_event_args_winrt.h",
326 "bluetooth/test/fake_device_pairing_result_winrt.cc",
327 "bluetooth/test/fake_device_pairing_result_winrt.h",
Jan Wilken Doerriebcd90ba2018-08-30 12:36:29328 "bluetooth/test/fake_device_watcher_winrt.cc",
329 "bluetooth/test/fake_device_watcher_winrt.h",
Jan Wilken Doerried66e0a92018-07-07 10:48:19330 "bluetooth/test/fake_gatt_characteristic_winrt.cc",
331 "bluetooth/test/fake_gatt_characteristic_winrt.h",
332 "bluetooth/test/fake_gatt_characteristics_result_winrt.cc",
333 "bluetooth/test/fake_gatt_characteristics_result_winrt.h",
Jan Wilken Doerrie2a3e6c92018-07-31 08:39:16334 "bluetooth/test/fake_gatt_descriptor_winrt.cc",
335 "bluetooth/test/fake_gatt_descriptor_winrt.h",
336 "bluetooth/test/fake_gatt_descriptors_result_winrt.cc",
337 "bluetooth/test/fake_gatt_descriptors_result_winrt.h",
Jan Wilken Doerried9b78b92018-06-18 17:35:43338 "bluetooth/test/fake_gatt_device_service_winrt.cc",
339 "bluetooth/test/fake_gatt_device_service_winrt.h",
340 "bluetooth/test/fake_gatt_device_services_result_winrt.cc",
341 "bluetooth/test/fake_gatt_device_services_result_winrt.h",
Jan Wilken Doerrie1bd49ee2018-07-30 10:59:00342 "bluetooth/test/fake_gatt_read_result_winrt.cc",
343 "bluetooth/test/fake_gatt_read_result_winrt.h",
Jan Wilken Dörriee0029d12018-08-06 14:06:08344 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.cc",
345 "bluetooth/test/fake_gatt_value_changed_event_args_winrt.h",
Jan Wilken Doerrief5b008c42018-08-01 08:12:56346 "bluetooth/test/fake_gatt_write_result_winrt.cc",
347 "bluetooth/test/fake_gatt_write_result_winrt.h",
Jan Wilken Dörriedc7c81c2018-06-12 07:34:38348 "bluetooth/test/fake_radio_winrt.cc",
349 "bluetooth/test/fake_radio_winrt.h",
gogeraldcab31232016-02-03 21:20:33350 ]
351 }
bajones7ab52ec32016-08-19 19:54:25352
Bill Orr1862b4f2018-05-10 17:56:45353 if (enable_vr) {
Michael Thiessen21e56152017-10-16 18:55:17354 sources += [
Anna Maria114d35052017-12-08 23:13:29355 "vr/orientation/orientation_device_provider_unittest.cc",
356 "vr/orientation/orientation_device_unittest.cc",
Bill Orrb35b4cd82019-03-05 00:13:39357 "vr/util/fps_meter_unittest.cc",
358 "vr/util/sliding_average_unittest.cc",
Michael Thiessen21e56152017-10-16 18:55:17359 "vr/vr_device_base_unittest.cc",
360 "vr/vr_display_impl_unittest.cc",
361 ]
bajones7ab52ec32016-08-19 19:54:25362
Bill Orr1862b4f2018-05-10 17:56:45363 if (is_android) {
364 deps += [ "//device/vr:java" ]
365 }
366
367 defines = [ "DEVICE_VR_IMPLEMENTATION" ]
368
bajones7ab52ec32016-08-19 19:54:25369 deps += [
370 "//device/vr",
371 "//device/vr:fakes",
Reilly Grantfa93b142018-02-01 02:13:48372 "//device/vr/public/mojom",
Anna Maria114d35052017-12-08 23:13:29373 "//services/device/public/cpp/generic_sensor",
374 "//ui/display",
Roman Karasev72254172018-04-05 18:10:03375 "//ui/display:test_support",
bajones7ab52ec32016-08-19 19:54:25376 ]
377 }
Matt Reynoldsb37eb1292019-03-19 22:19:40378
379 # Some gamepad tests require the HID service. Only build these tests on
380 # platforms where the HID service is enabled.
381 if (!is_android && !is_fuchsia) {
382 sources += [ "gamepad/nintendo_data_fetcher_unittest.cc" ]
383
384 deps += [
385 "//services/device:test_support",
386 "//services/device/hid",
387 "//services/device/hid:mocks",
388 ]
389 }
tfarinacdc7e5d2015-02-23 09:52:24390}
scheib56010cc2015-06-25 01:29:47391
Ke He624b52d2017-11-09 13:45:09392source_set("usb_test_gadget") {
393 testonly = true
394
395 sources = [
396 "test/usb_test_gadget.h",
397 "test/usb_test_gadget_impl.cc",
398 ]
399
400 deps = [
401 "//device/base",
402 "//device/usb",
403 "//net:test_support",
404 ]
405}
406
scheib56010cc2015-06-25 01:29:47407if (is_android) {
Matt Reynolds7c498e52017-12-06 22:06:24408 bluetooth_java_sources_needing_jni = [
409 "bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java",
410 ]
scheib56010cc2015-06-25 01:29:47411
412 generate_jni("bluetooth_test_jni_headers") {
413 sources = bluetooth_java_sources_needing_jni
414 jni_package = "bluetooth"
415 }
416
417 android_library("bluetooth_test_java") {
Shimi Zhang0d7b74af2018-02-08 17:28:02418 testonly = true
scheib56010cc2015-06-25 01:29:47419 java_files = bluetooth_java_sources_needing_jni
420 deps = [
421 "//base:base_java",
ortuno5966ddb2016-07-01 02:07:25422 "//components/location/android:location_java",
scheib56010cc2015-06-25 01:29:47423 "//device/bluetooth:java",
Peter Wen02ff5382019-03-13 18:13:38424 "//third_party/android_deps:com_android_support_support_annotations_java",
Peter Wen22bc3ec2019-03-28 22:18:02425 "//third_party/android_sdk:android_test_mock_java",
scheib56010cc2015-06-25 01:29:47426 ]
ortunocc9b46d12016-08-25 16:47:23427
428 srcjar_deps = [ ":bluetooth_test_javagen" ]
scheib56010cc2015-06-25 01:29:47429 }
bajonesb9bb4c42016-07-07 00:10:51430
431 junit_binary("device_junit_tests") {
Ke Heb5d9935c2018-06-15 02:50:44432 java_files = [ "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java" ]
bajonesb9bb4c42016-07-07 00:10:51433 deps = [
mcasas649deb52017-04-28 01:55:52434 "$google_play_services_package:google_play_services_base_java",
435 "$google_play_services_package:google_play_services_basement_java",
436 "$google_play_services_package:google_play_services_location_java",
bajonesb9bb4c42016-07-07 00:10:51437 "//base:base_java",
438 "//base:base_java_test_support",
Andrew Grieve916bc9b2018-02-02 01:38:59439 "//base:base_junit_test_support",
bajonesb9bb4c42016-07-07 00:10:51440 "//device/gamepad:java",
alexander.shalamov55ac6a4c2016-11-30 09:04:17441 "//mojo/public/java:bindings_java",
Peter Wen02ff5382019-03-13 18:13:38442 "//third_party/android_deps:com_android_support_support_annotations_java",
bajonesb9bb4c42016-07-07 00:10:51443 ]
444 srcjar_deps = [ "//device/gamepad:java_enums_srcjar" ]
445 }
ortunocc9b46d12016-08-25 16:47:23446
447 java_cpp_enum("bluetooth_test_javagen") {
448 sources = [
449 "bluetooth/test/bluetooth_test.h",
450 ]
451 }
scheib56010cc2015-06-25 01:29:47452}