|  | # Copyright 2022 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. | 
|  |  | 
|  | # By and large copied from //src/ui/tests/integration_input_tests/factory-reset-handler. | 
|  |  | 
|  | import("//build/components.gni") | 
|  | import("//build/testing/cc_test_executable.gni") | 
|  |  | 
|  | group("text-input") { | 
|  | testonly = true | 
|  | deps = [ ":tests" ] | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  | deps = [ | 
|  | ":text-input-test", | 
|  | "text-input-chromium", | 
|  |  | 
|  | # The deps below are necessary on minimal product configs. | 
|  | # TODO(https://fxbug.dev/42070261): These should be provided by the Product | 
|  | # configurations on which these tests run rather than as deps. | 
|  | "//src/chromium:web_context_provider_for_test", | 
|  | ] | 
|  | } | 
|  |  | 
|  | cc_test_executable("text-input-test-bin") { | 
|  | testonly = true | 
|  | sources = [ "text-input-test.cc" ] | 
|  | output_name = "text-input-test" | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.accessibility.semantics:fuchsia.accessibility.semantics_cpp", | 
|  | "//sdk/fidl/fuchsia.buildinfo:fuchsia.buildinfo_cpp", | 
|  | "//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt_cpp", | 
|  | "//sdk/fidl/fuchsia.component:fuchsia.component_cpp", | 
|  | "//sdk/fidl/fuchsia.element:fuchsia.element_cpp", | 
|  | "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_cpp", | 
|  | "//sdk/fidl/fuchsia.fonts:fuchsia.fonts_cpp", | 
|  | "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp", | 
|  | "//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp", | 
|  | "//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_cpp", | 
|  | "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_cpp", | 
|  | "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_cpp", | 
|  | "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_cpp", | 
|  | "//sdk/fidl/fuchsia.process:fuchsia.process_cpp", | 
|  | "//sdk/fidl/fuchsia.scheduler:fuchsia.scheduler_cpp", | 
|  | "//sdk/fidl/fuchsia.session.scene:fuchsia.session.scene_cpp", | 
|  | "//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider_cpp", | 
|  | "//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_cpp", | 
|  | "//sdk/fidl/fuchsia.ui.composition:fuchsia.ui.composition_cpp", | 
|  | "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input_cpp", | 
|  | "//sdk/fidl/fuchsia.ui.test.input:fuchsia.ui.test.input_cpp", | 
|  | "//sdk/fidl/fuchsia.ui.test.scene:fuchsia.ui.test.scene_cpp", | 
|  | "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views_cpp", | 
|  | "//sdk/fidl/fuchsia.vulkan.loader:fuchsia.vulkan.loader_cpp", | 
|  | "//sdk/fidl/fuchsia.web:fuchsia.web_cpp", | 
|  | "//sdk/lib/async-loop:async-loop-cpp", | 
|  | "//sdk/lib/async-loop:async-loop-default", | 
|  | "//sdk/lib/component/outgoing/cpp", | 
|  | "//sdk/lib/fdio", | 
|  | "//sdk/lib/fit", | 
|  | "//sdk/lib/sys/component/cpp/testing:cpp", | 
|  | "//sdk/lib/sys/cpp", | 
|  | "//src/lib/fostr/fidl/fuchsia.ui.input", | 
|  | "//src/lib/fsl", | 
|  | "//src/lib/fxl", | 
|  | "//src/lib/fxl/test:gtest_main", | 
|  | "//src/lib/json_parser", | 
|  | "//src/lib/testing/loop_fixture", | 
|  | "//src/ui/input/testing/fake_input_report_device", | 
|  | "//src/ui/testing/util:fidl_cpp_helpers", | 
|  | "//src/ui/testing/util:portable_ui_test", | 
|  | "//third_party/googletest:gtest", | 
|  | "//zircon/system/ulib/zx", | 
|  |  | 
|  | # TODO(https://fxbug.dev/355738783): Fix after realm builder support new C++ binding. | 
|  | "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_cpp_hlcpp_conversion", | 
|  | "//sdk/fidl/fuchsia.io:fuchsia.io_cpp_hlcpp_conversion", | 
|  | "//sdk/lib/fidl/cpp:hlcpp_conversion", | 
|  | ] | 
|  | } | 
|  |  | 
|  | fuchsia_test_component("text-input-test-component") { | 
|  | restricted_features = [ "allow_non_hermetic_packages" ] | 
|  | component_name = "text_input_test" | 
|  | manifest = "meta/text-input-test.cml" | 
|  | deps = [ ":text-input-test-bin" ] | 
|  |  | 
|  | # See README.md for instructions to connect to Chromium remote tools. | 
|  | test_type = "chromium" | 
|  | } | 
|  |  | 
|  | fuchsia_test_package("text-input-test") { | 
|  | test_components = [ ":text-input-test-component" ] | 
|  | deps = [ | 
|  | "text-input-chromium:text-input-chromium-component", | 
|  |  | 
|  | # TODO(https://fxbug.dev/42070261): These should be provided by the Product | 
|  | # configurations on which these tests run rather than as deps. | 
|  | # TODO(https://fxbug.dev/42070261): Should these be deps of the individual test | 
|  | # targets above? | 
|  | "//src/chromium:web_context_provider_for_test", | 
|  | "//src/cobalt/bin/testing/fake_cobalt", | 
|  | "//src/connectivity/network:netstack-for-tests", | 
|  | "//src/developer/build_info/testing:fake-build-info-component", | 
|  | "//src/developer/memory/pressure_signaler:component", | 
|  | "//src/fonts:font_provider_hermetic_for_test", | 
|  | "//src/testing/fidl/intl_property_manager:intl_property_manager_component", | 
|  | "//src/ui/bin/text:text_manager_comp", | 
|  |  | 
|  | # Include some default config (it doesn't matter which, since we're going to override it). | 
|  | "//src/ui/testing/test_ui_stack:flatland_scene_manager_config", | 
|  | "//src/ui/testing/test_ui_stack:test-ui-stack-component", | 
|  | ] | 
|  | test_specs = { | 
|  | parallel = 1 | 
|  | log_settings = { | 
|  | # Do not fail the test if a message with level ERROR is logged.  Several | 
|  | # components will log ERROR if they miss a non-essential FIDL API in the | 
|  | # sandbox, which would make the test fail if it weren't for this.  Ideally, | 
|  | # we should have a setup that does not have such errors at all, but adding | 
|  | # ever more components to satisfy all FIDL dependencies expands the test | 
|  | # graph beyond what is practical for testing.  In the future we may strike | 
|  | # a balance such that this becomes a non-issue, and that this could be | 
|  | # removed. | 
|  | max_severity = "ERROR" | 
|  | } | 
|  | environments = [ | 
|  | { | 
|  | dimensions = { | 
|  | # Ensure the device has Vulkan. | 
|  | device_type = "AEMU" | 
|  | } | 
|  | }, | 
|  | ] | 
|  | } | 
|  | } |