blob: a7db4d212f7f6c8f827b87446315402877f8fbec [file] [log] [blame]
# Copyright 2019 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/testing/cc_test_executable.gni")
import("//build/testing/environments.gni")
import("//src/fonts/build/fonts.gni")
group("unit") {
testonly = true
public_deps = [ ":semantics_tests" ]
}
group("integration") {
testonly = true
public_deps = [
":web-semantics-test",
# 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",
]
}
cc_test_executable("semantics_tests") {
output_name = "semantics_tests"
testonly = true
sources = [
"a11y_semantics_event_manager_test.cc",
"semantic_tree_parser.cc",
"semantic_tree_parser.h",
"semantic_tree_parser_test.cc",
"semantic_tree_service_unittest.cc",
"tree_unittest.cc",
]
public_deps = [
"//sdk/fidl/fuchsia.accessibility.semantics:fuchsia.accessibility.semantics_hlcpp",
"//sdk/fidl/fuchsia.ui.gfx:fuchsia.ui.gfx_hlcpp",
]
deps = [
"//sdk/lib/inspect/testing/cpp",
"//sdk/lib/sys/cpp",
"//sdk/lib/sys/cpp/testing:unit",
"//sdk/lib/syslog/cpp",
"//src/lib/files",
"//src/lib/fsl",
"//src/lib/fxl/test:gtest_main",
"//src/lib/json_parser",
"//src/lib/testing/loop_fixture",
"//src/ui/a11y/bin/a11y_manager/tests/util",
"//src/ui/a11y/lib/screen_reader/util",
"//src/ui/a11y/lib/semantics",
"//src/ui/a11y/lib/semantics/tests/mocks",
"//third_party/glm",
"//third_party/googletest:gmock",
"//third_party/rapidjson",
]
# TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
source_set("semantics_integration_test_fixture") {
testonly = true
sources = [
"semantics_integration_test_fixture.cc",
"semantics_integration_test_fixture.h",
]
deps = [
"//sdk/lib/fdio",
"//sdk/lib/fit",
"//sdk/lib/sys/component/cpp/testing:cpp",
"//sdk/lib/sys/cpp",
"//src/lib/fsl",
"//src/lib/fxl",
"//src/lib/testing/loop_fixture",
]
public_deps = [
"//sdk/fidl/fuchsia.accessibility.semantics:fuchsia.accessibility.semantics_hlcpp",
"//sdk/fidl/fuchsia.component:fuchsia.component_hlcpp",
"//sdk/fidl/fuchsia.fonts:fuchsia.fonts_hlcpp",
"//sdk/fidl/fuchsia.intl:fuchsia.intl_hlcpp",
"//sdk/fidl/fuchsia.kernel:fuchsia.kernel_hlcpp",
"//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_hlcpp",
"//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_hlcpp",
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_hlcpp",
"//sdk/fidl/fuchsia.process:fuchsia.process_hlcpp",
"//sdk/fidl/fuchsia.scheduler:fuchsia.scheduler_hlcpp",
"//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider_hlcpp",
"//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_hlcpp",
"//sdk/fidl/fuchsia.ui.composition:fuchsia.ui.composition_hlcpp",
"//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input_hlcpp",
"//sdk/fidl/fuchsia.vulkan.loader:fuchsia.vulkan.loader_hlcpp",
"//sdk/lib/async-loop",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/async-loop:async-loop-default",
"//src/lib/testing/loop_fixture",
"//src/ui/a11y/lib/annotation/tests/mocks",
"//src/ui/a11y/lib/semantics",
"//src/ui/a11y/lib/semantics/util",
"//src/ui/a11y/lib/view",
"//src/ui/a11y/lib/view/tests/mocks",
"//src/ui/testing/ui_test_manager",
"//src/ui/testing/util",
"//third_party/googletest:gtest",
]
}
cc_test_executable("web-semantics-test-bin") {
testonly = true
sources = [ "web_semantics_tests.cc" ]
output_name = "web-semantics-test"
deps = [
":semantics_integration_test_fixture",
"//sdk/fidl/fuchsia.buildinfo:fuchsia.buildinfo_hlcpp",
"//sdk/fidl/fuchsia.component:fuchsia.component_hlcpp",
"//sdk/fidl/fuchsia.fonts:fuchsia.fonts_hlcpp",
"//sdk/fidl/fuchsia.intl:fuchsia.intl_hlcpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_hlcpp",
"//sdk/fidl/fuchsia.kernel:fuchsia.kernel_hlcpp",
"//sdk/fidl/fuchsia.logger:fuchsia.logger_hlcpp",
"//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_hlcpp",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_hlcpp",
"//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_hlcpp",
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_hlcpp",
"//sdk/fidl/fuchsia.process:fuchsia.process_hlcpp",
"//sdk/fidl/fuchsia.scheduler:fuchsia.scheduler_hlcpp",
"//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider_hlcpp",
"//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_hlcpp",
"//sdk/fidl/fuchsia.web:fuchsia.web_hlcpp",
"//sdk/lib/fit",
"//sdk/lib/sys/component/cpp/testing:cpp",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/chromium/web_runner_tests:mock_server",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//src/ui/a11y/lib/view",
"//third_party/googletest:gtest",
]
}
fuchsia_test_component("web-semantics-test-component") {
restricted_features = [ "allow_non_hermetic_packages" ]
manifest = "meta/web-semantics-test.cml"
deps = [ ":web-semantics-test-bin" ]
test_type = "system"
}
fuchsia_test_package("web-semantics-test") {
test_components = [ ":web-semantics-test-component" ]
deps = [
"//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/a11y/lib/semantics/tests/web_client:component",
"//src/ui/a11y/lib/semantics/tests/web_client:web_client_default_config",
"//src/ui/bin/text:text_manager_comp",
]
test_specs = {
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.
max_severity = "ERROR"
}
environments = [
{
dimensions = {
# Ensure the device has Vulkan.
device_type = "AEMU"
}
},
]
}
}