mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-12-01 09:46:09 +03:00
470 lines
15 KiB
Plaintext
470 lines
15 KiB
Plaintext
# Copyright 2016 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/chromeos/ui_mode.gni")
|
|
import("//build/config/chromeos/ui_mode.gni")
|
|
import("//build/config/features.gni")
|
|
import("//testing/test.gni")
|
|
|
|
if (is_chromeos) {
|
|
import("//chromeos/components/sensors/buildflags.gni")
|
|
}
|
|
|
|
if (is_android) {
|
|
import("//build/config/android/rules.gni")
|
|
}
|
|
|
|
is_serial_enabled_platform =
|
|
is_win || ((is_linux || is_chromeos) && use_udev) || is_mac
|
|
|
|
source_set("lib") {
|
|
# This should be visible only to embedders of the Device Service, and the
|
|
# dependence should only be for the purpose of embedding the Device Service.
|
|
visibility = [
|
|
":test_support",
|
|
":tests",
|
|
"//content/browser",
|
|
"//services/device/public/cpp:test_support",
|
|
]
|
|
sources = [
|
|
"device_service.cc",
|
|
"device_service.h",
|
|
]
|
|
|
|
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
|
|
|
deps = [
|
|
":binder_overrides",
|
|
"//build:chromeos_buildflags",
|
|
"//services/device/fingerprint",
|
|
"//services/device/generic_sensor",
|
|
"//services/device/geolocation",
|
|
"//services/device/power_monitor",
|
|
"//services/device/public/cpp:device_features",
|
|
"//services/device/public/mojom:usb",
|
|
"//services/device/public/mojom:usb_test",
|
|
"//services/device/screen_orientation",
|
|
"//services/device/time_zone_monitor",
|
|
"//services/device/usb/mojo",
|
|
"//services/device/wake_lock",
|
|
"//services/service_manager/public/cpp",
|
|
"//ui/gfx",
|
|
]
|
|
|
|
public_deps = [
|
|
"//base",
|
|
"//mojo/public/cpp/bindings",
|
|
"//services/device/public/mojom",
|
|
"//services/device/public/mojom:device_service",
|
|
]
|
|
|
|
if (is_android) {
|
|
deps += [ ":device_service_jni_headers" ]
|
|
} else {
|
|
deps += [
|
|
"//services/device/battery",
|
|
"//services/device/hid",
|
|
"//services/device/vibration",
|
|
]
|
|
}
|
|
|
|
if (is_chromeos_ash && use_dbus) {
|
|
deps += [
|
|
"//services/device/bluetooth:bluetooth_system",
|
|
"//services/device/media_transfer_protocol",
|
|
]
|
|
}
|
|
|
|
if (is_serial_enabled_platform) {
|
|
deps += [ "//services/device/serial" ]
|
|
}
|
|
|
|
if (is_chromeos_lacros) {
|
|
deps += [
|
|
"//chromeos/crosapi/mojom",
|
|
"//chromeos/lacros",
|
|
]
|
|
}
|
|
}
|
|
|
|
# NOTE: We use a separate component target to support global binder overrides,
|
|
# since the service implementation itself may be linked into multiple
|
|
# simultaneously loaded binary targets in a component build. The ":lib" target
|
|
# cannot be a component target itself because it depends on generated JNI
|
|
# headers that do not currently support component exports.
|
|
component("binder_overrides") {
|
|
visibility = [ ":lib" ]
|
|
output_name = "device_service_binder_overrides"
|
|
sources = [
|
|
"binder_overrides.cc",
|
|
"binder_overrides.h",
|
|
]
|
|
public_deps = [
|
|
"//base",
|
|
"//mojo/public/cpp/bindings",
|
|
"//services/device/public/mojom",
|
|
]
|
|
defines = [ "IS_DEVICE_SERVICE_BINDER_OVERRIDES_IMPL" ]
|
|
}
|
|
|
|
source_set("perftests") {
|
|
testonly = true
|
|
|
|
sources = [ "geolocation/position_cache_impl_perftest.cc" ]
|
|
|
|
deps = [
|
|
":test_support",
|
|
"//base",
|
|
"//base/test:test_support",
|
|
"//services/device/geolocation",
|
|
"//services/device/geolocation:test_support",
|
|
"//testing/gtest",
|
|
"//testing/perf",
|
|
]
|
|
}
|
|
|
|
source_set("tests") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"battery/battery_status_service_unittest.cc",
|
|
"generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer_unittest.cc",
|
|
"generic_sensor/fake_platform_sensor_and_provider.cc",
|
|
"generic_sensor/fake_platform_sensor_and_provider.h",
|
|
"generic_sensor/fake_platform_sensor_fusion.cc",
|
|
"generic_sensor/fake_platform_sensor_fusion.h",
|
|
"generic_sensor/generic_sensor_service_unittest.cc",
|
|
"generic_sensor/gravity_fusion_algorithm_using_accelerometer_unittest.cc",
|
|
"generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer_unittest.cc",
|
|
"generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion_unittest.cc",
|
|
"generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles_unittest.cc",
|
|
"generic_sensor/orientation_test_data.h",
|
|
"generic_sensor/platform_sensor_and_provider_unittest.cc",
|
|
"generic_sensor/platform_sensor_fusion_unittest.cc",
|
|
"generic_sensor/platform_sensor_util_unittest.cc",
|
|
"generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_gyroscope_unittest.cc",
|
|
"generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_unittest.cc",
|
|
"generic_sensor/sensor_fusion_algorithm_using_accelerometer_unittest.cc",
|
|
"geolocation/geolocation_provider_impl_unittest.cc",
|
|
"geolocation/geolocation_service_unittest.cc",
|
|
"geolocation/location_arbitrator_unittest.cc",
|
|
"geolocation/network_location_provider_unittest.cc",
|
|
"geolocation/position_cache_impl_unittest.cc",
|
|
"geolocation/public_ip_address_geolocator_unittest.cc",
|
|
"geolocation/public_ip_address_location_notifier_unittest.cc",
|
|
"geolocation/wifi_data_provider_common_unittest.cc",
|
|
"geolocation/wifi_polling_policy_unittest.cc",
|
|
"power_monitor/power_monitor_message_broadcaster_unittest.cc",
|
|
"public/cpp/power_monitor/power_monitor_broadcast_source_unittest.cc",
|
|
"vibration/vibration_manager_impl_unittest.cc",
|
|
"wake_lock/wake_lock_unittest.cc",
|
|
]
|
|
|
|
deps = [
|
|
":lib",
|
|
":test_support",
|
|
"//base",
|
|
"//base/test:test_support",
|
|
"//base/third_party/dynamic_annotations",
|
|
"//build:chromeos_buildflags",
|
|
"//components/variations",
|
|
"//device/base/synchronization",
|
|
"//mojo/public/cpp/bindings",
|
|
"//net",
|
|
"//net:test_support",
|
|
"//services/device/generic_sensor",
|
|
"//services/device/geolocation",
|
|
"//services/device/geolocation:test_support",
|
|
"//services/device/power_monitor",
|
|
"//services/device/public/cpp:device_features",
|
|
"//services/device/public/cpp/bluetooth:bluetooth_tests",
|
|
"//services/device/public/cpp/power_monitor",
|
|
"//services/device/public/mojom",
|
|
"//services/device/wake_lock",
|
|
"//services/network:test_support",
|
|
"//testing/gmock",
|
|
"//testing/gtest",
|
|
]
|
|
|
|
if (is_android) {
|
|
sources += [ "generic_sensor/platform_sensor_provider_unittest_android.cc" ]
|
|
}
|
|
|
|
if (is_chromeos_ash) {
|
|
sources += [ "geolocation/wifi_data_provider_chromeos_unittest.cc" ]
|
|
}
|
|
|
|
if (is_win) {
|
|
sources += [
|
|
"battery/battery_status_manager_win_unittest.cc",
|
|
"generic_sensor/platform_sensor_and_provider_unittest_win.cc",
|
|
"geolocation/wifi_data_provider_win_unittest.cc",
|
|
]
|
|
}
|
|
|
|
if (is_chromeos && use_iioservice) {
|
|
sources += [
|
|
"generic_sensor/platform_sensor_chromeos_unittest.cc",
|
|
"generic_sensor/platform_sensor_provider_chromeos_unittest.cc",
|
|
]
|
|
deps += [
|
|
"//chromeos/components/sensors:sensors",
|
|
"//chromeos/components/sensors:test_support",
|
|
]
|
|
} else if ((is_linux || is_chromeos) && use_udev) {
|
|
sources +=
|
|
[ "generic_sensor/platform_sensor_and_provider_unittest_linux.cc" ]
|
|
}
|
|
|
|
if ((is_linux || is_chromeos_lacros) && use_dbus) {
|
|
sources += [
|
|
"battery/battery_status_manager_linux_unittest.cc",
|
|
"geolocation/wifi_data_provider_linux_unittest.cc",
|
|
]
|
|
deps += [ "//dbus:test_support" ]
|
|
}
|
|
|
|
if (is_chromeos_ash) {
|
|
sources += [ "fingerprint/fingerprint_chromeos_unittest.cc" ]
|
|
deps += [
|
|
"//chromeos/dbus:test_support",
|
|
"//chromeos/dbus/biod:test_support",
|
|
"//chromeos/network:test_support",
|
|
"//services/device/bluetooth:bluetooth_system_tests",
|
|
"//services/device/fingerprint",
|
|
"//third_party/protobuf:protobuf_lite",
|
|
]
|
|
}
|
|
|
|
if (is_android) {
|
|
sources -= [
|
|
"battery/battery_status_service_unittest.cc",
|
|
"geolocation/network_location_provider_unittest.cc",
|
|
"geolocation/wifi_data_provider_common_unittest.cc",
|
|
]
|
|
deps += [
|
|
":device_service_jni_headers",
|
|
"//services/device/public/java:geolocation_java_test_support",
|
|
"//services/device/usb:java",
|
|
"//services/device/vibration/android:vibration_jni_headers",
|
|
]
|
|
} else {
|
|
sources += [
|
|
"battery/battery_monitor_impl_unittest.cc",
|
|
"hid/hid_manager_unittest.cc",
|
|
"public/cpp/hid/hid_blocklist_unittest.cc",
|
|
]
|
|
deps += [
|
|
"//components/variations:test_support",
|
|
"//services/device/battery",
|
|
"//services/device/hid:mocks",
|
|
"//services/device/public/cpp/hid",
|
|
"//services/device/vibration",
|
|
]
|
|
|
|
if ((!is_linux && !is_chromeos) || use_udev) {
|
|
sources += [
|
|
"hid/hid_connection_impl_unittest.cc",
|
|
"hid/test_report_descriptors.cc",
|
|
"hid/test_report_descriptors.h",
|
|
"public/cpp/hid/hid_device_filter_unittest.cc",
|
|
"public/cpp/hid/hid_report_descriptor_unittest.cc",
|
|
]
|
|
if (is_linux || is_chromeos) {
|
|
sources += [ "hid/input_service_linux_unittest.cc" ]
|
|
}
|
|
if (!is_fuchsia) {
|
|
# Fuchsia does not currently implement HidService.
|
|
sources += [ "hid/hid_service_unittest.cc" ]
|
|
}
|
|
if (!is_ios) {
|
|
sources += [ "hid/hid_connection_unittest.cc" ]
|
|
deps += [
|
|
":usb_test_gadget",
|
|
"//net:test_support",
|
|
"//services/device/usb",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
if (is_serial_enabled_platform) {
|
|
sources += [
|
|
"serial/bluetooth_serial_port_impl_unittest.cc",
|
|
"serial/serial_device_enumerator_unittest.cc",
|
|
"serial/serial_port_impl_unittest.cc",
|
|
"serial/serial_port_manager_impl_unittest.cc",
|
|
]
|
|
|
|
if (is_linux || is_chromeos) {
|
|
sources += [ "serial/serial_device_enumerator_linux_unittest.cc" ]
|
|
}
|
|
|
|
if (is_posix) {
|
|
sources += [ "serial/serial_io_handler_posix_unittest.cc" ]
|
|
}
|
|
|
|
if (is_linux || is_chromeos) {
|
|
deps += [ "//device/udev_linux:test_support" ]
|
|
}
|
|
|
|
deps += [
|
|
"//device/bluetooth:mocks",
|
|
"//services/device/public/cpp/bluetooth:bluetooth",
|
|
"//services/device/public/cpp/serial:switches",
|
|
"//services/device/serial",
|
|
"//services/device/serial:test_support",
|
|
]
|
|
}
|
|
|
|
# USB does not compile on iOS.
|
|
if (!is_ios) {
|
|
sources += [
|
|
"public/cpp/usb/usb_utils_unittest.cc",
|
|
"usb/mojo/device_impl_unittest.cc",
|
|
"usb/mojo/device_manager_impl_unittest.cc",
|
|
"usb/usb_descriptors_unittest.cc",
|
|
"usb/usb_device_handle_unittest.cc",
|
|
"usb/usb_service_unittest.cc",
|
|
"usb/webusb_descriptors_unittest.cc",
|
|
]
|
|
deps += [
|
|
":usb_test_gadget",
|
|
"//device/base",
|
|
"//net:test_support",
|
|
"//services/device/public/cpp:test_support",
|
|
"//services/device/public/cpp/usb",
|
|
"//services/device/public/mojom",
|
|
"//services/device/usb",
|
|
"//services/device/usb:test_support",
|
|
"//services/device/usb/mojo",
|
|
]
|
|
|
|
if (!is_android) {
|
|
sources += [ "public/cpp/usb/usb_ids_unittest.cc" ]
|
|
}
|
|
}
|
|
|
|
if (is_mac) {
|
|
sources += [ "geolocation/core_location_provider_unittest.mm" ]
|
|
}
|
|
|
|
# UsbContext is a libusb-specific object.
|
|
if (is_mac || is_win) {
|
|
sources += [ "usb/usb_context_unittest.cc" ]
|
|
deps += [ "//third_party/libusb" ]
|
|
}
|
|
|
|
if (is_win) {
|
|
sources += [
|
|
"generic_sensor/platform_sensor_provider_winrt_unittest.cc",
|
|
"generic_sensor/platform_sensor_reader_winrt_unittests.cc",
|
|
"geolocation/win/fake_geocoordinate_winrt.cc",
|
|
"geolocation/win/fake_geocoordinate_winrt.h",
|
|
"geolocation/win/fake_geolocator_winrt.cc",
|
|
"geolocation/win/fake_geolocator_winrt.h",
|
|
"geolocation/win/fake_geoposition_winrt.cc",
|
|
"geolocation/win/fake_geoposition_winrt.h",
|
|
"geolocation/win/fake_position_changed_event_args_winrt.cc",
|
|
"geolocation/win/fake_position_changed_event_args_winrt.h",
|
|
"geolocation/win/fake_status_changed_event_args_winrt.cc",
|
|
"geolocation/win/fake_status_changed_event_args_winrt.h",
|
|
"geolocation/win/location_provider_winrt_unittest.cc",
|
|
"hid/hid_preparsed_data_unittest.cc",
|
|
]
|
|
|
|
# Needed for "generic_sensor/platform_sensor_and_provider_unittest_win.cc"
|
|
libs = [
|
|
"propsys.lib",
|
|
"sensorsapi.lib",
|
|
]
|
|
}
|
|
}
|
|
|
|
source_set("test_support") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"device_service_test_base.cc",
|
|
"device_service_test_base.h",
|
|
]
|
|
|
|
deps = [
|
|
":lib",
|
|
"//base",
|
|
"//base/test:test_support",
|
|
"//mojo/public/cpp/bindings",
|
|
"//net",
|
|
"//net:test_support",
|
|
"//services/device/public/cpp:test_support",
|
|
"//services/device/public/cpp/geolocation",
|
|
"//services/device/public/mojom:device_service",
|
|
"//services/network:test_support",
|
|
"//services/service_manager/public/cpp",
|
|
"//services/service_manager/public/cpp/test:test_support",
|
|
"//testing/gtest",
|
|
]
|
|
}
|
|
|
|
if (is_android) {
|
|
generate_jni("device_service_jni_headers") {
|
|
sources = [
|
|
"android/java/src/org/chromium/services/device/InterfaceRegistrar.java",
|
|
"public/java/src/org/chromium/device/DeviceFeatureList.java",
|
|
]
|
|
}
|
|
|
|
android_library("java") {
|
|
# This should be visible only to embedders of the Device Service, and the
|
|
# dependence should only be for the purpose of embedding the Device Service.
|
|
# //content/public/android:* here actually wants to identify the
|
|
# //content/public/android:content_java target and all of its generated
|
|
# targets which also need to see this target as well.
|
|
# //services:* identifies //services:service_unittests and all of its
|
|
# generated targets.
|
|
visibility = [
|
|
"//content/public/android:*",
|
|
"//services:*",
|
|
]
|
|
sources = [
|
|
"android/java/src/org/chromium/services/device/InterfaceRegistrar.java",
|
|
]
|
|
deps = [
|
|
"//base:base_java",
|
|
"//mojo/public/java:bindings_java",
|
|
"//mojo/public/java:system_java",
|
|
"//mojo/public/java/system:system_impl_java",
|
|
"//services/device/battery/android:battery_monitor_java",
|
|
"//services/device/generic_sensor:java",
|
|
"//services/device/geolocation:geolocation_java",
|
|
"//services/device/nfc/android:java",
|
|
"//services/device/public/java:nfc_java",
|
|
"//services/device/public/mojom:mojom_java",
|
|
"//services/device/screen_orientation:java",
|
|
"//services/device/time_zone_monitor:java",
|
|
"//services/device/usb:java",
|
|
"//services/device/vibration/android:vibration_manager_java",
|
|
"//services/device/wake_lock/power_save_blocker:java",
|
|
"//services/service_manager/public/java:service_manager_java",
|
|
"//services/service_manager/public/mojom:mojom_java",
|
|
]
|
|
}
|
|
}
|
|
|
|
source_set("usb_test_gadget") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"test/usb_test_gadget.h",
|
|
"test/usb_test_gadget_impl.cc",
|
|
]
|
|
|
|
deps = [
|
|
"//device/base",
|
|
"//net:test_support",
|
|
"//services/device/usb",
|
|
"//tools/usb_gadget",
|
|
]
|
|
}
|