blob: 0c7d2d0fb181f354a455ae7274be232f2ae4d3e3 [file] [log] [blame]
# Copyright 2014 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("//mojo/public/tools/bindings/mojom.gni")
source_set("tests") {
testonly = true
sources = [
"associated_interface_unittest.cc",
"bind_task_runner_unittest.cc",
"binder_map_unittest.cc",
"bindings_test_base.cc",
"bindings_test_base.h",
"buffer_unittest.cc",
"callback_helpers_unittest.cc",
"connection_group_unittest.cc",
"connector_unittest.cc",
"constant_unittest.cc",
"container_test_util.cc",
"container_test_util.h",
"data_view_unittest.cc",
"enum_headers_unittest.cc",
"equals_unittest.cc",
"extra_cpp_template_unittest.cc",
"flush_async_unittest.cc",
"handle_passing_unittest.cc",
"hash_unittest.cc",
"idle_tracking_unittest.cc",
"lazy_serialization_unittest.cc",
"map_unittest.cc",
"message_queue.cc",
"message_queue.h",
"message_quota_checker_unittest.cc",
"message_unittest.cc",
"multiplex_router_unittest.cc",
"native_struct_unittest.cc",
"new_endpoint_types_unittest.cc",
"receiver_callback_unittest.cc",
"receiver_set_unittest.cc",
"receiver_unittest.cc",
"remote_unittest.cc",
"report_bad_message_unittest.cc",
"request_response_unittest.cc",
"router_test_util.cc",
"router_test_util.h",
"sample_service_unittest.cc",
"serialization_warning_unittest.cc",
"service_factory_unittest.cc",
"struct_headers_unittest.cc",
"struct_unittest.cc",
"sync_handle_registry_unittest.cc",
"sync_method_unittest.cc",
"test_helpers_unittest.cc",
"type_conversion_unittest.cc",
"union_unittest.cc",
"validation_context_unittest.cc",
"validation_unittest.cc",
"variant_test_util.h",
]
deps = [
":mojo_public_bindings_test_utils",
":test_extra_cpp_template_mojom",
":test_mojom",
"//base/test:test_support",
"//mojo/core/embedder",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//mojo/public/cpp/test_support:test_utils",
"//mojo/public/interfaces/bindings/tests:other_test_interfaces",
"//mojo/public/interfaces/bindings/tests:test_associated_interfaces",
"//mojo/public/interfaces/bindings/tests:test_export_component",
"//mojo/public/interfaces/bindings/tests:test_export_component2",
"//mojo/public/interfaces/bindings/tests:test_exported_import",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
"//mojo/public/interfaces/bindings/tests:test_struct_traits_interfaces",
"//testing/gtest",
]
data = [ "//mojo/public/interfaces/bindings/tests/data/validation/" ]
if (is_ios) {
assert_no_deps = [ "//third_party/blink/*" ]
} else {
sources += [
"pickle_unittest.cc",
"struct_traits_unittest.cc",
]
deps += [
"//mojo/public/cpp/bindings/tests:struct_with_traits_impl",
"//mojo/public/interfaces/bindings/tests:test_interfaces_blink",
]
}
}
if (!is_ios) {
source_set("for_blink_tests") {
testonly = true
sources = [
"container_test_util.cc",
"container_test_util.h",
"variant_test_util.h",
"wtf_hash_unittest.cc",
"wtf_map_unittest.cc",
"wtf_types_unittest.cc",
]
deps = [
"//base/test:test_support",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//mojo/public/interfaces/bindings/tests:test_export_blink_component",
"//mojo/public/interfaces/bindings/tests:test_exported_import_blink",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
"//mojo/public/interfaces/bindings/tests:test_interfaces_blink",
"//mojo/public/interfaces/bindings/tests:test_wtf_types",
"//mojo/public/interfaces/bindings/tests:test_wtf_types_blink",
"//testing/gtest",
]
}
}
source_set("struct_with_traits_impl") {
sources = [
"struct_with_traits_impl.cc",
"struct_with_traits_impl.h",
]
deps = [
"//base",
"//mojo/public/cpp/system:system",
]
}
mojom("test_extra_cpp_template_mojom") {
testonly = true
sources = [ "extra_cpp_template_unittest.test-mojom" ]
extra_cpp_template_paths = [ "extra_cpp_template_unittest.h.tmpl" ]
public_deps = [ "//mojo/public/mojom/base" ]
}
mojom("test_mojom") {
testonly = true
sources = [
"binder_map_unittest.test-mojom",
"connection_group_unittest.test-mojom",
"enum_headers_unittest.test-mojom",
"flush_async_unittest.test-mojom",
"idle_tracking_unittest.test-mojom",
"receiver_unittest.test-mojom",
"remote_unittest.test-mojom",
"service_factory_unittest.test-mojom",
"struct_headers_unittest.test-mojom",
]
public_deps = [
# NOTE: This is a kind of test in itself, to verify that mojom() rules can
# operate on generated mojom files and produce compilable outputs.
":generated_test_mojom",
"//mojo/public/mojom/base",
]
support_lazy_serialization = true
}
source_set("perftests") {
testonly = true
sources = [ "bindings_perftest.cc" ]
if (!is_ios) {
sources += [ "e2e_perftest.cc" ]
}
deps = [
"//base/test:test_support",
"//mojo/core/embedder",
"//mojo/core/test:test_support",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//mojo/public/cpp/test_support:test_utils",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
"//testing/gtest",
]
}
source_set("mojo_public_bindings_test_utils") {
sources = [
"validation_test_input_parser.cc",
"validation_test_input_parser.h",
]
deps = [ "//mojo/public/c/system" ]
}
action("generate_test_mojom") {
script = "generate_test_mojom.py"
outputs = [ "$target_gen_dir/generated.test-mojom" ]
args = [ rebase_path("$target_gen_dir/generated.test-mojom") ]
}
mojom("generated_test_mojom") {
testonly = true
sources = [ "$target_gen_dir/generated.test-mojom" ]
parser_deps = [ ":generate_test_mojom" ]
}