blob: bd83abecef43f299c72007f317301ca4dcf5c833 [file] [log] [blame]
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/features.gni")
import("//testing/test.gni")
is_linux_without_udev = is_linux && !use_udev
is_linux_without_dbus = is_linux && !use_dbus
test("device_unittests") {
sources = [
"battery/battery_status_manager_win_unittest.cc",
"battery/battery_status_service_unittest.cc",
"bluetooth/bluetooth_adapter_mac_unittest.mm",
"bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc",
"bluetooth/bluetooth_adapter_unittest.cc",
"bluetooth/bluetooth_adapter_win_unittest.cc",
"bluetooth/bluetooth_audio_sink_chromeos_unittest.cc",
"bluetooth/bluetooth_chromeos_unittest.cc",
"bluetooth/bluetooth_device_unittest.cc",
"bluetooth/bluetooth_device_win_unittest.cc",
"bluetooth/bluetooth_gatt_chromeos_unittest.cc",
"bluetooth/bluetooth_low_energy_win_unittest.cc",
"bluetooth/bluetooth_service_record_win_unittest.cc",
"bluetooth/bluetooth_socket_chromeos_unittest.cc",
"bluetooth/bluetooth_task_manager_win_unittest.cc",
"bluetooth/bluetooth_uuid_unittest.cc",
"nfc/nfc_chromeos_unittest.cc",
"nfc/nfc_ndef_record_unittest.cc",
"test/run_all_unittests.cc",
]
deps = [
"//base/test:test_support",
"//device/battery",
"//device/battery:mojo_bindings",
"//device/bluetooth",
"//device/nfc",
"//mojo/environment:chromium",
"//net",
"//testing/gmock",
"//testing/gtest",
"//third_party/mojo/src/mojo/edk/system",
"//third_party/mojo/src/mojo/public/cpp/bindings",
"//url",
]
if (!is_linux_without_dbus && !is_chromeos) {
sources += [ "battery/battery_status_manager_linux_unittest.cc" ]
}
# HID and Serial:
# Android doesn't compile.
# Linux, requires udev.
if (!is_linux_without_udev && !is_android) {
sources += [
"hid/hid_connection_unittest.cc",
"hid/hid_device_filter_unittest.cc",
"hid/hid_report_descriptor_unittest.cc",
"hid/input_service_linux_unittest.cc",
"hid/test_report_descriptors.cc",
"hid/test_report_descriptors.h",
"serial/data_sink_unittest.cc",
"serial/data_source_unittest.cc",
"serial/serial_connection_unittest.cc",
"serial/serial_service_unittest.cc",
]
deps += [
"//device/hid",
"//device/serial",
"//device/serial:test_support",
]
}
if (use_udev) {
sources += [ "udev_linux/udev_unittest.cc" ]
deps += [ "//device/udev_linux" ]
}
# USB does not compile on mobile platforms.
if (!is_android && !is_ios) {
sources += [
"test/usb_test_gadget_impl.cc",
"usb/usb_context_unittest.cc",
"usb/usb_device_filter_unittest.cc",
"usb/usb_device_handle_unittest.cc",
"usb/usb_ids_unittest.cc",
"usb/usb_service_unittest.cc",
]
deps += [
"//device/usb",
"//third_party/libusb",
]
}
if (is_chromeos) {
configs += [ "//build/config/linux:dbus" ]
deps += [
"//chromeos",
"//chromeos:test_support",
"//chromeos:test_support_without_gmock",
"//dbus",
]
}
if (is_posix && !is_android && !is_mac) {
libs = [ "rt" ]
}
if (is_mac) {
libs = [ "IOBluetooth.framework" ]
}
}