blob: 310d9d02c2228e752f43a659bcabf44ab871f31e [file] [log] [blame]
# 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/ui.gni")
import("//services/catalog/public/tools/catalog.gni")
import("//services/service_manager/public/tools/test/service_test.gni")
import("//testing/test.gni")
# One Big Target for services to register their unit test sources. This exists
# to avoid having to maintain a separate test binary for every service.
#
# To add tests for a new service, please define a "tests" source_set in the
# service subdirectory and add it as a dependency here. If your unit tests
# use the ServiceTest framework, you must also include corresponding catalog
# entries in the "services_unittests_catalog" target below.
service_test("services_unittests") {
# If your service does not run on iOS, its tests should go in the !iOS
# section below. If you are unsure, contact blundell@chromium.org.
deps = [
"//services/identity:tests",
]
if (!is_ios) {
deps += [
"//services/data_decoder:tests",
"//services/device:tests",
"//services/preferences:tests",
"//services/resource_coordinator:tests",
"//services/shape_detection:tests",
"//services/viz/compositing/privileged/interfaces:tests",
"//services/viz/public/cpp/compositing:tests",
]
}
if (use_aura) {
deps += [
"//services/ui/clipboard:tests",
"//services/ui/ime:tests",
"//services/ui/input_devices:tests",
"//services/ui/public/cpp/tests",
"//services/ui/public/interfaces:tests",
]
if (is_linux && !is_chromeos) {
deps += [ "//services/ui/demo:tests" ]
}
if (use_ozone || (!is_chromeos && !is_mac && !is_ios)) {
deps += [ "//services/ui/ws:tests" ]
}
}
if (is_android) {
deps += [
"//services/device:java",
# Some tests need to initialize V8.
"//v8:v8_external_startup_data_assets",
]
}
if (!is_android && !is_ios) {
# NOTE: We do not currently support standalone service binaries on Android
# or iOS, so any tests which use the ServiceTest framework to connect to
# standalone services must be added here.
deps += [ "//services/video_capture:tests" ]
}
if (use_ozone && is_chromeos) {
deps += [ "//services/ui/display:tests" ]
}
test_runner = "//services/test:run_all_service_tests"
catalog = ":services_unittests_catalog"
}
catalog("services_unittests_catalog") {
testonly = true
# The division between "all platforms" and "!iOS" here needs to match that
# for the main deps list in the services_unittests target above.
catalog_deps = [ "//services/identity:tests_catalog" ]
if (!is_ios) {
catalog_deps += [
"//services/device:tests_catalog",
"//services/preferences:tests_catalog",
"//services/resource_coordinator:tests_catalog",
"//services/video_capture:tests_catalog",
]
}
if (use_aura) {
catalog_deps += [
"//services/ui/clipboard:tests_catalog",
"//services/ui/ime:tests_catalog",
]
if (is_linux && !is_chromeos) {
catalog_deps += [ "//services/ui/demo:tests_catalog" ]
}
if (use_ozone || (!is_chromeos && !is_ios)) {
catalog_deps += [ "//services/ui/ws:tests_catalog" ]
}
}
}
if (is_android) {
junit_binary("service_junit_tests") {
java_files = [
"device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java",
"device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java",
"shape_detection/android/junit/src/org/chromium/shape_detection/BitmapUtilsTest.java",
]
deps = [
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
"$google_play_services_package:google_play_services_vision_common_java",
"$google_play_services_package:google_play_services_vision_java",
"//base:base_java",
"//base:base_java_test_support",
"//mojo/public/java:bindings_java",
"//mojo/public/java:system_java",
"//services/device/generic_sensor:java",
"//services/device/nfc/android:java",
"//services/device/public/interfaces:generic_sensor_java",
"//services/device/public/interfaces:interfaces_java",
"//services/device/public/java:nfc_java",
"//services/shape_detection:shape_detection_java",
"//skia/public/interfaces:interfaces_java",
"//third_party/android_tools:android_support_annotations_java",
]
}
android_library("service_javatests") {
testonly = true
java_files = [
"shape_detection/android/javatests/src/org/chromium/shape_detection/BarcodeDetectionImplTest.java",
"shape_detection/android/javatests/src/org/chromium/shape_detection/FaceDetectionImplTest.java",
"shape_detection/android/javatests/src/org/chromium/shape_detection/TestUtils.java",
"shape_detection/android/javatests/src/org/chromium/shape_detection/TextDetectionImplTest.java",
]
deps = [
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
"$google_play_services_package:google_play_services_vision_common_java",
"$google_play_services_package:google_play_services_vision_java",
"//base:base_java",
"//base:base_java_test_support",
"//mojo/public/java:bindings_java",
"//services/shape_detection:shape_detection_java",
"//services/shape_detection/public/interfaces:interfaces_java",
"//skia/public/interfaces:interfaces_java",
"//third_party/android_support_test_runner:runner_java",
"//ui/gfx/geometry/mojo:mojo_java",
]
data = [
"test/data/",
]
}
}