# 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("../../../tools/bindings/mojom.gni") group("test_data_deps") { testonly = true data_deps = [ ":test_interfaces_js_data_deps", ":test_associated_interfaces_js_data_deps", ":validation_test_data", ":validation_test_data_list", ] } copy("validation_test_data") { testonly = true sources = [ "data/validation/associated_conformance_mthd0_good.data", "data/validation/associated_conformance_mthd0_good.expected", "data/validation/associated_conformance_mthd0_illegal_invalid_interface_id.data", "data/validation/associated_conformance_mthd0_illegal_invalid_interface_id.expected", "data/validation/associated_conformance_mthd0_illegal_master_interface_id.data", "data/validation/associated_conformance_mthd0_illegal_master_interface_id.expected", "data/validation/associated_conformance_mthd0_interface_id_index_out_of_range.data", "data/validation/associated_conformance_mthd0_interface_id_index_out_of_range.expected", "data/validation/associated_conformance_mthd0_unexpected_invalid_associated_interface.data", "data/validation/associated_conformance_mthd0_unexpected_invalid_associated_interface.expected", "data/validation/associated_conformance_mthd1_good.data", "data/validation/associated_conformance_mthd1_good.expected", "data/validation/associated_conformance_mthd1_unexpected_invalid_associated_request.data", "data/validation/associated_conformance_mthd1_unexpected_invalid_associated_request.expected", "data/validation/associated_conformance_mthd2_good.data", "data/validation/associated_conformance_mthd2_good.expected", "data/validation/associated_conformance_mthd3_collided_interface_id_indices.data", "data/validation/associated_conformance_mthd3_collided_interface_id_indices.expected", "data/validation/associated_conformance_mthd3_good.data", "data/validation/associated_conformance_mthd3_good.expected", "data/validation/associated_conformance_mthd3_unexpected_invalid_associated_interface_in_array.data", "data/validation/associated_conformance_mthd3_unexpected_invalid_associated_interface_in_array.expected", "data/validation/associated_conformance_mthd3_wrong_interface_id_index_order.data", "data/validation/associated_conformance_mthd3_wrong_interface_id_index_order.expected", "data/validation/boundscheck_msghdr_no_such_method.data", "data/validation/boundscheck_msghdr_no_such_method.expected", "data/validation/conformance_empty.data", "data/validation/conformance_empty.expected", "data/validation/conformance_msghdr_incomplete_struct.data", "data/validation/conformance_msghdr_incomplete_struct.expected", "data/validation/conformance_msghdr_incomplete_struct_header.data", "data/validation/conformance_msghdr_incomplete_struct_header.expected", "data/validation/conformance_msghdr_invalid_flag_combo.data", "data/validation/conformance_msghdr_invalid_flag_combo.expected", "data/validation/conformance_msghdr_missing_request_id.data", "data/validation/conformance_msghdr_missing_request_id.expected", "data/validation/conformance_msghdr_no_such_method.data", "data/validation/conformance_msghdr_no_such_method.expected", "data/validation/conformance_msghdr_num_bytes_huge.data", "data/validation/conformance_msghdr_num_bytes_huge.expected", "data/validation/conformance_msghdr_num_bytes_less_than_min_requirement.data", "data/validation/conformance_msghdr_num_bytes_less_than_min_requirement.expected", "data/validation/conformance_msghdr_num_bytes_less_than_struct_header.data", "data/validation/conformance_msghdr_num_bytes_less_than_struct_header.expected", "data/validation/conformance_msghdr_num_bytes_version_mismatch_1.data", "data/validation/conformance_msghdr_num_bytes_version_mismatch_1.expected", "data/validation/conformance_msghdr_num_bytes_version_mismatch_2.data", "data/validation/conformance_msghdr_num_bytes_version_mismatch_2.expected", "data/validation/conformance_msghdr_num_bytes_version_mismatch_3.data", "data/validation/conformance_msghdr_num_bytes_version_mismatch_3.expected", "data/validation/conformance_mthd0_good.data", "data/validation/conformance_mthd0_good.expected", "data/validation/conformance_mthd0_incomplete_struct.data", "data/validation/conformance_mthd0_incomplete_struct.expected", "data/validation/conformance_mthd0_incomplete_struct_header.data", "data/validation/conformance_mthd0_incomplete_struct_header.expected", "data/validation/conformance_mthd0_invalid_request_flags.data", "data/validation/conformance_mthd0_invalid_request_flags.expected", "data/validation/conformance_mthd0_invalid_request_flags2.data", "data/validation/conformance_mthd0_invalid_request_flags2.expected", "data/validation/conformance_mthd0_struct_num_bytes_huge.data", "data/validation/conformance_mthd0_struct_num_bytes_huge.expected", "data/validation/conformance_mthd0_struct_num_bytes_less_than_min_requirement.data", "data/validation/conformance_mthd0_struct_num_bytes_less_than_min_requirement.expected", "data/validation/conformance_mthd0_struct_num_bytes_less_than_struct_header.data", "data/validation/conformance_mthd0_struct_num_bytes_less_than_struct_header.expected", "data/validation/conformance_mthd10_good.data", "data/validation/conformance_mthd10_good.expected", "data/validation/conformance_mthd10_good_non_unique_keys.data", "data/validation/conformance_mthd10_good_non_unique_keys.expected", "data/validation/conformance_mthd10_null_keys.data", "data/validation/conformance_mthd10_null_keys.expected", "data/validation/conformance_mthd10_null_values.data", "data/validation/conformance_mthd10_null_values.expected", "data/validation/conformance_mthd10_one_null_key.data", "data/validation/conformance_mthd10_one_null_key.expected", "data/validation/conformance_mthd10_unequal_array_size.data", "data/validation/conformance_mthd10_unequal_array_size.expected", "data/validation/conformance_mthd11_good_version0.data", "data/validation/conformance_mthd11_good_version0.expected", "data/validation/conformance_mthd11_good_version1.data", "data/validation/conformance_mthd11_good_version1.expected", "data/validation/conformance_mthd11_good_version2.data", "data/validation/conformance_mthd11_good_version2.expected", "data/validation/conformance_mthd11_good_version3.data", "data/validation/conformance_mthd11_good_version3.expected", "data/validation/conformance_mthd11_good_version_newer_than_known_1.data", "data/validation/conformance_mthd11_good_version_newer_than_known_1.expected", "data/validation/conformance_mthd11_good_version_newer_than_known_2.data", "data/validation/conformance_mthd11_good_version_newer_than_known_2.expected", "data/validation/conformance_mthd11_num_bytes_version_mismatch_1.data", "data/validation/conformance_mthd11_num_bytes_version_mismatch_1.expected", "data/validation/conformance_mthd11_num_bytes_version_mismatch_2.data", "data/validation/conformance_mthd11_num_bytes_version_mismatch_2.expected", "data/validation/conformance_mthd12_invalid_request_flags.data", "data/validation/conformance_mthd12_invalid_request_flags.expected", "data/validation/conformance_mthd13_good_1.data", "data/validation/conformance_mthd13_good_1.expected", "data/validation/conformance_mthd13_good_2.data", "data/validation/conformance_mthd13_good_2.expected", "data/validation/conformance_mthd14_good_known_enum_values.data", "data/validation/conformance_mthd14_good_known_enum_values.expected", "data/validation/conformance_mthd14_good_uknown_extensible_enum_value.data", "data/validation/conformance_mthd14_good_uknown_extensible_enum_value.expected", "data/validation/conformance_mthd14_uknown_non_extensible_enum_value.data", "data/validation/conformance_mthd14_uknown_non_extensible_enum_value.expected", "data/validation/conformance_mthd15_good_empy_enum_array.data", "data/validation/conformance_mthd15_good_empy_enum_array.expected", "data/validation/conformance_mthd15_good_known_enum_array_values.data", "data/validation/conformance_mthd15_good_known_enum_array_values.expected", "data/validation/conformance_mthd15_good_uknown_extensible_enum_array_value.data", "data/validation/conformance_mthd15_good_uknown_extensible_enum_array_value.expected", "data/validation/conformance_mthd15_uknown_non_extensible_enum_array_value.data", "data/validation/conformance_mthd15_uknown_non_extensible_enum_array_value.expected", "data/validation/conformance_mthd16_uknown_non_extensible_enum_map_key.data", "data/validation/conformance_mthd16_uknown_non_extensible_enum_map_key.expected", "data/validation/conformance_mthd16_uknown_non_extensible_enum_map_value.data", "data/validation/conformance_mthd16_uknown_non_extensible_enum_map_value.expected", "data/validation/conformance_mthd17_good.data", "data/validation/conformance_mthd17_good.expected", "data/validation/conformance_mthd17_interface_handle_out_of_range_in_array.data", "data/validation/conformance_mthd17_interface_handle_out_of_range_in_array.expected", "data/validation/conformance_mthd17_unexpected_invalid_interface_in_array.data", "data/validation/conformance_mthd17_unexpected_invalid_interface_in_array.expected", "data/validation/conformance_mthd18_good.data", "data/validation/conformance_mthd18_good.expected", "data/validation/conformance_mthd19_exceed_recursion_limit.data", "data/validation/conformance_mthd19_exceed_recursion_limit.expected", "data/validation/conformance_mthd1_good.data", "data/validation/conformance_mthd1_good.expected", "data/validation/conformance_mthd1_misaligned_struct.data", "data/validation/conformance_mthd1_misaligned_struct.expected", "data/validation/conformance_mthd1_struct_pointer_overflow.data", "data/validation/conformance_mthd1_struct_pointer_overflow.expected", "data/validation/conformance_mthd1_unexpected_null_struct.data", "data/validation/conformance_mthd1_unexpected_null_struct.expected", "data/validation/conformance_mthd20_good.data", "data/validation/conformance_mthd20_good.expected", "data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.data", "data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.expected", "data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.data", "data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.expected", "data/validation/conformance_mthd2_good.data", "data/validation/conformance_mthd2_good.expected", "data/validation/conformance_mthd2_multiple_pointers_to_same_struct.data", "data/validation/conformance_mthd2_multiple_pointers_to_same_struct.expected", "data/validation/conformance_mthd2_overlapped_objects.data", "data/validation/conformance_mthd2_overlapped_objects.expected", "data/validation/conformance_mthd2_wrong_layout_order.data", "data/validation/conformance_mthd2_wrong_layout_order.expected", "data/validation/conformance_mthd3_array_num_bytes_huge.data", "data/validation/conformance_mthd3_array_num_bytes_huge.expected", "data/validation/conformance_mthd3_array_num_bytes_less_than_array_header.data", "data/validation/conformance_mthd3_array_num_bytes_less_than_array_header.expected", "data/validation/conformance_mthd3_array_num_bytes_less_than_necessary_size.data", "data/validation/conformance_mthd3_array_num_bytes_less_than_necessary_size.expected", "data/validation/conformance_mthd3_array_pointer_overflow.data", "data/validation/conformance_mthd3_array_pointer_overflow.expected", "data/validation/conformance_mthd3_good.data", "data/validation/conformance_mthd3_good.expected", "data/validation/conformance_mthd3_incomplete_array.data", "data/validation/conformance_mthd3_incomplete_array.expected", "data/validation/conformance_mthd3_incomplete_array_header.data", "data/validation/conformance_mthd3_incomplete_array_header.expected", "data/validation/conformance_mthd3_misaligned_array.data", "data/validation/conformance_mthd3_misaligned_array.expected", "data/validation/conformance_mthd3_unexpected_null_array.data", "data/validation/conformance_mthd3_unexpected_null_array.expected", "data/validation/conformance_mthd4_good.data", "data/validation/conformance_mthd4_good.expected", "data/validation/conformance_mthd4_multiple_pointers_to_same_array.data", "data/validation/conformance_mthd4_multiple_pointers_to_same_array.expected", "data/validation/conformance_mthd4_overlapped_objects.data", "data/validation/conformance_mthd4_overlapped_objects.expected", "data/validation/conformance_mthd4_wrong_layout_order.data", "data/validation/conformance_mthd4_wrong_layout_order.expected", "data/validation/conformance_mthd5_good.data", "data/validation/conformance_mthd5_good.expected", "data/validation/conformance_mthd5_handle_out_of_range.data", "data/validation/conformance_mthd5_handle_out_of_range.expected", "data/validation/conformance_mthd5_multiple_handles_with_same_value_1.data", "data/validation/conformance_mthd5_multiple_handles_with_same_value_1.expected", "data/validation/conformance_mthd5_multiple_handles_with_same_value_2.data", "data/validation/conformance_mthd5_multiple_handles_with_same_value_2.expected", "data/validation/conformance_mthd5_unexpected_invalid_handle.data", "data/validation/conformance_mthd5_unexpected_invalid_handle.expected", "data/validation/conformance_mthd5_wrong_handle_order.data", "data/validation/conformance_mthd5_wrong_handle_order.expected", "data/validation/conformance_mthd6_good.data", "data/validation/conformance_mthd6_good.expected", "data/validation/conformance_mthd6_nested_array_num_bytes_less_than_necessary_size.data", "data/validation/conformance_mthd6_nested_array_num_bytes_less_than_necessary_size.expected", "data/validation/conformance_mthd7_good.data", "data/validation/conformance_mthd7_good.expected", "data/validation/conformance_mthd7_unexpected_null_fixed_array.data", "data/validation/conformance_mthd7_unexpected_null_fixed_array.expected", "data/validation/conformance_mthd7_unmatched_array_elements.data", "data/validation/conformance_mthd7_unmatched_array_elements.expected", "data/validation/conformance_mthd7_unmatched_array_elements_nested.data", "data/validation/conformance_mthd7_unmatched_array_elements_nested.expected", "data/validation/conformance_mthd8_array_num_bytes_overflow.data", "data/validation/conformance_mthd8_array_num_bytes_overflow.expected", "data/validation/conformance_mthd8_good.data", "data/validation/conformance_mthd8_good.expected", "data/validation/conformance_mthd8_unexpected_null_array.data", "data/validation/conformance_mthd8_unexpected_null_array.expected", "data/validation/conformance_mthd8_unexpected_null_string.data", "data/validation/conformance_mthd8_unexpected_null_string.expected", "data/validation/conformance_mthd9_good.data", "data/validation/conformance_mthd9_good.expected", "data/validation/conformance_mthd9_good_null_array.data", "data/validation/conformance_mthd9_good_null_array.expected", "data/validation/conformance_mthd9_unexpected_null_array.data", "data/validation/conformance_mthd9_unexpected_null_array.expected", "data/validation/integration_intf_resp_mthd0_good.data", "data/validation/integration_intf_resp_mthd0_good.expected", "data/validation/integration_intf_resp_mthd0_unexpected_array_header.data", "data/validation/integration_intf_resp_mthd0_unexpected_array_header.expected", "data/validation/integration_intf_rqst_mthd0_good.data", "data/validation/integration_intf_rqst_mthd0_good.expected", "data/validation/integration_intf_rqst_mthd0_unexpected_struct_header.data", "data/validation/integration_intf_rqst_mthd0_unexpected_struct_header.expected", "data/validation/integration_msghdr_invalid_flags.data", "data/validation/integration_msghdr_invalid_flags.expected", "data/validation/resp_boundscheck_msghdr_no_such_method.data", "data/validation/resp_boundscheck_msghdr_no_such_method.expected", "data/validation/resp_conformance_msghdr_invalid_response_flags1.data", "data/validation/resp_conformance_msghdr_invalid_response_flags1.expected", "data/validation/resp_conformance_msghdr_invalid_response_flags2.data", "data/validation/resp_conformance_msghdr_invalid_response_flags2.expected", "data/validation/resp_conformance_msghdr_no_such_method.data", "data/validation/resp_conformance_msghdr_no_such_method.expected", ] outputs = [ "$root_gen_dir/layout_test_data/{{source_root_relative_dir}}/{{source_file_part}}", ] } action_foreach("validation_test_data_list") { testonly = true script = "//mojo/public/tools/bindings/gen_data_files_list.py" inputs = mojom_generator_sources sources = [ "data/validation", ] outputs = [ "$root_gen_dir/layout_test_data/{{source_root_relative_dir}}/{{source_file_part}}_index.txt", ] args = [ "-d", rebase_path(sources[0], root_build_dir), "-o", rebase_path(outputs[0], root_build_dir), ] } mojom("test_interfaces") { testonly = true sources = [ "math_calculator.mojom", "no_module.mojom", "ping_service.mojom", "rect.mojom", "regression_tests.mojom", "sample_factory.mojom", "sample_interfaces.mojom", "sample_service.mojom", "scoping.mojom", "serialization_test_structs.mojom", "test_bad_messages.mojom", "test_constants.mojom", "test_data_view.mojom", "test_name_generator.mojom", "test_native_types.mojom", "test_structs.mojom", "test_sync_methods.mojom", "test_unions.mojom", "validation_test_interfaces.mojom", ] public_deps = [ ":echo", ":test_mojom_import", ":test_mojom_import2", ] support_lazy_serialization = true # Validation tests require precise message content matching, so we avoid # scrambling message IDs for test interfaces. scramble_message_ids = false } component("test_export_component") { testonly = true deps = [ ":test_export", ] } if (!is_ios) { component("test_export_blink_component") { testonly = true deps = [ ":test_export_blink", ] } } mojom("test_export") { testonly = true sources = [ "test_export.mojom", ] export_class_attribute = "MOJO_TEST_EXPORT" export_define = "MOJO_TEST_IMPLEMENTATION=1" export_header = "mojo/public/cpp/bindings/tests/mojo_test_export.h" if (!is_ios) { export_class_attribute_blink = "MOJO_TEST_BLINK_EXPORT" export_define_blink = "MOJO_TEST_BLINK_IMPLEMENTATION=1" export_header_blink = "mojo/public/cpp/bindings/tests/mojo_test_blink_export.h" } visibility = [ ":test_export_component" ] if (!is_ios) { visibility_blink = [ ":test_export_blink_component" ] } } mojom("test_exported_import") { testonly = true sources = [ "test_import.mojom", ] public_deps = [ ":test_export", ] overridden_deps = [ ":test_export" ] component_deps = [ ":test_export_component" ] if (!is_ios) { overridden_deps_blink = [ ":test_export" ] component_deps_blink = [ ":test_export_blink_component" ] } } # Used to test that it is okay to call mojom::Foo::Serialize()/Deserialize() # even if the mojom target is linked into another component. # # We don't use |test_export_component| for this test because # //mojo/public/cpp/bindings/tests depends on both |test_export_component| and # |test_exported_import| and therefore actually get the shared cpp sources of # test_export.mojom from |test_exported_import|. component("test_export_component2") { testonly = true public_deps = [ ":test_export2", ] } mojom("test_export2") { testonly = true sources = [ "test_export2.mojom", ] export_class_attribute = "MOJO_TEST_EXPORT" export_define = "MOJO_TEST_IMPLEMENTATION=1" export_header = "mojo/public/cpp/bindings/tests/mojo_test_export.h" visibility = [ ":test_export_component2" ] } mojom("test_mojom_import") { testonly = true sources = [ "sample_import.mojom", ] } mojom("test_mojom_import_wrapper") { testonly = true public_deps = [ ":test_mojom_import", ] } mojom("test_mojom_import_wrapper_wrapper") { testonly = true public_deps = [ ":test_mojom_import_wrapper", ] } mojom("test_mojom_import2") { testonly = true sources = [ "sample_import2.mojom", ] public_deps = [ ":test_mojom_import", ":test_mojom_import_wrapper_wrapper", ] } mojom("test_struct_traits_interfaces") { testonly = true sources = [ "struct_with_traits.mojom", ] support_lazy_serialization = true } mojom("test_associated_interfaces") { # These files are not included in the test_interfaces target because # associated interfaces are not supported by all bindings languages yet. testonly = true sources = [ "test_associated_interfaces.mojom", "validation_test_associated_interfaces.mojom", ] public_deps = [ ":test_interfaces", ] # Validation tests require precise message content matching, so we avoid # scrambling message IDs for test interfaces. scramble_message_ids = false } mojom("versioning_test_service_interfaces") { testonly = true sources = [ "versioning_test_service.mojom", ] } mojom("versioning_test_client_interfaces") { testonly = true sources = [ "versioning_test_client.mojom", ] } mojom("test_wtf_types") { testonly = true sources = [ "test_wtf_types.mojom", ] } mojom("test_no_sources") { testonly = true public_deps = [ ":test_interfaces", ] } mojom("echo") { testonly = true sources = [ "echo.mojom", "echo_import/echo_import.mojom", ] }