| # Copyright 2020 The Fuchsia 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/components.gni") |
| import("//build/test.gni") |
| |
| # Provides a C++ implementation of fuchsia.hardware.display.Provider, which returns a connection to |
| # the default display controller (via a proxied connection to the driver-provided version). This |
| # makes it easy for a component to implement this service. |
| # |
| # NOTE: the component's sandbox must contain "dev": "class/display-controller". |
| source_set("hdcp_service") { |
| sources = [ |
| "hardware_display_controller_provider_impl.cc", |
| "hardware_display_controller_provider_impl.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.ui.display", |
| "//sdk/lib/fit", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/zx", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.display", |
| "//sdk/fidl/fuchsia.hardware.display:fuchsia.hardware.display_c", |
| "//sdk/lib/sys/cpp:cpp", |
| "//src/lib/files", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fdio-caller", |
| ] |
| |
| # TODO(fxbug.dev/95833): This target uses the deprecated C bindings. |
| # Consider switching to the C++ bindings. See linked bug for details. |
| configs += [ "//build/c:fidl-deprecated-c-bindings" ] |
| } |
| |
| # Provides a C++ utility function GetHardwareDisplayController() which connects to and interacts |
| # with the fuchsia.hardware.display.Provider service, found within the component's environment. |
| source_set("hdcp_client") { |
| sources = [ |
| "get_hardware_display_controller.cc", |
| "get_hardware_display_controller.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.display", |
| "//sdk/lib/fit-promise", |
| ] |
| deps = [ |
| ":hdcp_service", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//zircon/system/ulib/trace", |
| ] |
| } |
| |
| # Below tests exercise the different code paths caused by having fake-display injected via |
| # facets:injected-services in .cmx files. We have two packages to add two different .cmx configs. |
| test("get_hardware_display_controller_test") { |
| sources = [ "tests/get_hardware_display_controller_test.cc" ] |
| |
| deps = [ |
| ":hdcp_client", |
| ":hdcp_service", |
| "//sdk/lib/fit-promise", |
| "//sdk/lib/sys/cpp:cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("test") { |
| package_name = "get_hardware_display_controller_test" |
| deps = [ ":get_hardware_display_controller_test" ] |
| manifest = "tests/meta/get_hardware_display_controller_test.cml" |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| test("get_hardware_display_controller_inject_services_test") { |
| sources = [ "tests/get_hardware_display_controller_inject_services_test.cc" ] |
| |
| deps = [ |
| ":hdcp_client", |
| ":hdcp_service", |
| "//sdk/lib/fit-promise", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("inject_service_test") { |
| package_name = "get_hardware_display_controller_inject_services_test" |
| deps = [ |
| ":get_hardware_display_controller_inject_services_test", |
| "//src/ui/bin/hardware_display_controller_provider:fake-hardware-display-controller-provider-cmv2-component", |
| ] |
| manifest = |
| "tests/meta/get_hardware_display_controller_inject_services_test.cml" |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |