| # Copyright 2017 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("//services/catalog/public/tools/catalog.gni") |
| import("//services/service_manager/public/cpp/service.gni") |
| import("//services/service_manager/public/service_manifest.gni") |
| import("//services/service_manager/public/tools/test/service_test.gni") |
| import("//testing/test.gni") |
| |
| # Currently standalone service binaries are not supported on Android or iOS. |
| standalone_supported = !(is_android || is_ios) |
| |
| service("audio") { |
| sources = [ |
| "service_main.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//services/audio/public/cpp", |
| "//services/audio/public/mojom", |
| ] |
| } |
| |
| service_manifest("manifest") { |
| name = "audio" |
| source = "manifest.json" |
| } |
| |
| source_set("lib") { |
| sources = [ |
| "audio_sandbox_win.cc", |
| "audio_sandbox_win.h", |
| "debug_recording.cc", |
| "debug_recording.h", |
| "delay_buffer.cc", |
| "delay_buffer.h", |
| "device_notifier.cc", |
| "device_notifier.h", |
| "group_coordinator.cc", |
| "group_coordinator.h", |
| "group_member.h", |
| "in_process_audio_manager_accessor.cc", |
| "in_process_audio_manager_accessor.h", |
| "input_controller.cc", |
| "input_controller.h", |
| "input_stream.cc", |
| "input_stream.h", |
| "input_sync_writer.cc", |
| "input_sync_writer.h", |
| "local_muter.cc", |
| "local_muter.h", |
| "loopback_stream.cc", |
| "loopback_stream.h", |
| "output_controller.cc", |
| "output_controller.h", |
| "output_stream.cc", |
| "output_stream.h", |
| "owning_audio_manager_accessor.cc", |
| "owning_audio_manager_accessor.h", |
| "service.cc", |
| "service.h", |
| "service_factory.cc", |
| "service_factory.h", |
| "service_metrics.cc", |
| "service_metrics.h", |
| "snooper_node.cc", |
| "snooper_node.h", |
| "stream_factory.cc", |
| "stream_factory.h", |
| "sync_reader.cc", |
| "sync_reader.h", |
| "system_info.cc", |
| "system_info.h", |
| "traced_service_ref.cc", |
| "traced_service_ref.h", |
| "user_input_monitor.cc", |
| "user_input_monitor.h", |
| ] |
| |
| public_deps = [ |
| "//base", |
| "//media", |
| "//services/audio/public/mojom", |
| "//services/service_manager/public/cpp", |
| "//services/service_manager/sandbox:sandbox", |
| ] |
| |
| if (is_win) { |
| public_deps += [ "//sandbox/win:sandbox" ] |
| } |
| } |
| |
| source_set("tests") { |
| testonly = true |
| |
| sources = [ |
| "debug_recording_unittest.cc", |
| "delay_buffer_unittest.cc", |
| "device_notifier_unittest.cc", |
| "group_coordinator_unittest.cc", |
| "input_controller_unittest.cc", |
| "input_stream_unittest.cc", |
| "input_sync_writer_unittest.cc", |
| "local_muter_unittest.cc", |
| "loopback_stream_unittest.cc", |
| "output_controller_unittest.cc", |
| "output_stream_unittest.cc", |
| "public/cpp/input_ipc_unittest.cc", |
| "public/cpp/output_device_unittest.cc", |
| "service_metrics_unittest.cc", |
| "snooper_node_unittest.cc", |
| "stream_factory_unittest.cc", |
| "sync_reader_unittest.cc", |
| "test/audio_system_to_service_adapter_test.cc", |
| "test/debug_recording_session_unittest.cc", |
| "test/fake_consumer.cc", |
| "test/fake_consumer.h", |
| "test/fake_group_member.cc", |
| "test/fake_group_member.h", |
| "test/in_process_service_test.cc", |
| "test/mock_group_member.cc", |
| "test/mock_group_member.h", |
| "test/mock_log.cc", |
| "test/mock_log.h", |
| "test/service_lifetime_connector_test.cc", |
| "test/service_lifetime_test_template.h", |
| "test/service_observer_mock.cc", |
| "test/service_observer_mock.h", |
| "user_input_monitor_unittest.cc", |
| ] |
| |
| deps = [ |
| ":audio", |
| ":lib", |
| "//base/test:test_support", |
| "//media:test_support", |
| "//mojo/core/embedder", |
| "//services/audio/public/cpp", |
| "//services/audio/public/cpp:test_support", |
| "//services/audio/public/mojom", |
| "//services/service_manager/public/cpp", |
| "//services/service_manager/public/cpp:service_test_support", |
| "//services/service_manager/public/cpp/test:test_support", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| |
| if (standalone_supported) { |
| sources += [ "test/standalone_service_test.cc" ] |
| deps += [ ":standalone_unittest_catalog_source" ] |
| } |
| |
| data_deps = [ |
| ":audio", |
| ] |
| } |
| |
| # Embedded tests support. |
| service_manifest("unittest_manifest") { |
| name = "audio_unittests" |
| source = "test/service_unittest_manifest.json" |
| packaged_services = [ ":manifest" ] |
| } |
| |
| catalog("tests_catalog") { |
| testonly = true |
| embedded_services = [ ":unittest_manifest" ] |
| } |
| |
| # Standalone tests support. |
| if (standalone_supported) { |
| service_manifest("standalone_unittest_manifest") { |
| name = "audio_unittests" |
| source = "test/service_unittest_manifest.json" |
| } |
| |
| catalog("standalone_unittest_catalog") { |
| embedded_services = [ ":standalone_unittest_manifest" ] |
| standalone_services = [ ":manifest" ] |
| } |
| |
| catalog_cpp_source("standalone_unittest_catalog_source") { |
| catalog = ":standalone_unittest_catalog" |
| generated_function_name = "audio::CreateStandaloneUnittestCatalog" |
| } |
| } |