0

Use test-mojom in mojo bindings tests

Use test-mojom in mojo bindings tests. The bulk of the change lies
in mojo/public/interfaces/bindings/tests/BUILD.gn.

Adds a gn arg: `allow_dot_mojom_in_testonly_mojom = true` which
allows local builds to throw an error if a mojom() target includes
a foo.mojom file. This option is not intended for general use and
will be removed in future.

Bug: 383380971
Change-Id: I1aca41132fb4ebf159aabb232c4bfb36863f387d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6086557
Commit-Queue: Alex Gough <ajgo@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394913}
This commit is contained in:
Alex Gough
2024-12-11 09:45:36 -08:00
committed by Chromium LUCI CQ
parent 2140a1b62a
commit f9d5d5025d
97 changed files with 152 additions and 134 deletions
content
ipc
media/mojo/services
mojo/public
cpp
interfaces
java
system
tools
bindings
third_party/blink

@ -35,7 +35,7 @@
#include "content/test/grit/web_ui_mojo_test_resources_map.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/tests/validation_test_input_parser.h"
#include "mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/validation_test_interfaces.test-mojom.h"
#include "ui/base/webui/resource_path.h"
namespace content {

@ -1250,7 +1250,7 @@ preprocess_if_expr("preprocess_mojo_webui_test") {
preprocess_if_expr("preprocess_mojo_webui_test_deps") {
in_folder = "$root_gen_dir/mojo/public/interfaces/bindings/tests"
out_folder = "$target_gen_dir/data"
in_files = [ "validation_test_interfaces.mojom-webui.ts" ]
in_files = [ "validation_test_interfaces.test-mojom-webui.ts" ]
deps = [
"//mojo/public/interfaces/bindings/tests:test_interfaces_ts__generator",
]
@ -1260,7 +1260,7 @@ webui_ts_library("web_ui_mojo_test_build_ts") {
root_dir = "$target_gen_dir/data"
out_dir = "$target_gen_dir/data/tsc"
in_files = [
"validation_test_interfaces.mojom-webui.ts",
"validation_test_interfaces.test-mojom-webui.ts",
"web_ui_mojo_conformance_test.ts",
"web_ui_mojo_ts_test.ts",
"web_ui_mojo_ts_test_converters.ts",

@ -4,7 +4,7 @@
import {mojo} from '//resources/mojo/mojo/public/js/bindings.js';
import {ConformanceTestInterfaceCallbackRouter, PageHandlerFactory} from './validation_test_interfaces.mojom-webui.js';
import {ConformanceTestInterfaceCallbackRouter, PageHandlerFactory} from './validation_test_interfaces.test-mojom-webui.js';
// TODO(ffred): These test cases do not match their associated expectation.
// Each case should be investigated and removed from this set.

@ -39,7 +39,7 @@ This file specifies resources for content_browsertests.
<include name="IDR_WEB_UI_TS_TEST_TYPES_MOJOM_JS" file="${root_gen_dir}/content/test/data/tsc/web_ui_ts_test_types.test-mojom-webui.js" use_base_dir="false" type="BINDATA" resource_path="web_ui_ts_test_types.test-mojom-webui.js" />
<include name="IDR_WEB_UI_TS_TEST_CONFORMANCE_HTML" file="data/web_ui_mojo_conformance_test.html" type="BINDATA" />
<include name="IDR_WEB_UI_TS_TEST_CONFORMANCE_JS" file="${root_gen_dir}/content/test/data/tsc/web_ui_mojo_conformance_test.js" use_base_dir="false" type="BINDATA" resource_path="web_ui_mojo_conformance_test.js" />
<include name="IDR_WEB_UI_TS_TEST_VALIDATION_MOJO_JS" file="${root_gen_dir}/content/test/data/tsc/validation_test_interfaces.mojom-webui.js" use_base_dir="false" type="BINDATA" resource_path="validation_test_interfaces.mojom-webui.js" />
<include name="IDR_WEB_UI_TS_TEST_VALIDATION_MOJO_JS" file="${root_gen_dir}/content/test/data/tsc/validation_test_interfaces.test-mojom-webui.js" use_base_dir="false" type="BINDATA" resource_path="validation_test_interfaces.test-mojom-webui.js" />
</includes>
</release>
</grit>

@ -230,7 +230,7 @@ mojom("mojom_constants") {
mojom("test_interfaces") {
testonly = true
sources = [ "ipc_test.mojom" ]
sources = [ "ipc_test.test-mojom" ]
}
# This is provided as a separate target so other targets can provide param

@ -50,7 +50,7 @@
#include "ipc/ipc_mojo_param_traits.h"
#include "ipc/ipc_sync_channel.h"
#include "ipc/ipc_sync_message.h"
#include "ipc/ipc_test.mojom.h"
#include "ipc/ipc_test.test-mojom.h"
#include "ipc/ipc_test_base.h"
#include "ipc/ipc_test_channel_listener.h"
#include "ipc/urgent_message_observer.h"

@ -22,7 +22,7 @@
#include "ipc/ipc_perftest_messages.h"
#include "ipc/ipc_perftest_util.h"
#include "ipc/ipc_sync_channel.h"
#include "ipc/ipc_test.mojom.h"
#include "ipc/ipc_test.test-mojom.h"
#include "ipc/ipc_test_base.h"
#include "mojo/core/test/mojo_test_base.h"
#include "mojo/core/test/multiprocess_test_helper.h"

@ -25,7 +25,7 @@
#include "ipc/ipc_perftest_messages.h"
#include "ipc/ipc_perftest_util.h"
#include "ipc/ipc_sync_channel.h"
#include "ipc/ipc_test.mojom.h"
#include "ipc/ipc_test.test-mojom.h"
#include "ipc/ipc_test_base.h"
#include "mojo/core/embedder/embedder.h"
#include "mojo/core/test/mojo_test_base.h"

@ -25,7 +25,7 @@
#include "ipc/ipc_listener.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_sender.h"
#include "ipc/ipc_test.mojom.h"
#include "ipc/ipc_test.test-mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/system/message_pipe.h"

@ -7,13 +7,14 @@
#pragma allow_unsafe_buffers
#endif
#include "media/mojo/services/deferred_destroy_unique_receiver_set.h"
#include <memory>
#include <utility>
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "media/mojo/services/deferred_destroy_unique_receiver_set.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {

@ -8,7 +8,7 @@ import("//mojo/public/tools/bindings/mojom.gni")
mojom("example_interfaces") {
testonly = true
sources = [ "example.mojom" ]
sources = [ "example.test-mojom" ]
cpp_typemaps = [
{
types = [

@ -4,7 +4,7 @@
#include "base/test/task_environment.h"
#include "base/testfidl/cpp/fidl.h"
#include "mojo/public/cpp/base/fuchsia/example.mojom.h"
#include "mojo/public/cpp/base/fuchsia/example.test-mojom.h"
#include "mojo/public/cpp/base/fuchsia/test_interface_request_mojom_traits.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -41,8 +41,8 @@
#include "mojo/public/cpp/bindings/tests/associated_interface_unittest.test-mojom.h"
#include "mojo/public/cpp/bindings/unique_associated_receiver_set.h"
#include "mojo/public/cpp/system/functions.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_associated_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_associated_interfaces.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -20,7 +20,7 @@
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/interfaces/bindings/tests/test_associated_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_associated_interfaces.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -8,6 +8,7 @@
#endif
#include <stddef.h>
#include <utility>
#include "base/functional/bind.h"
@ -23,7 +24,7 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/test_support/test_support.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -5,7 +5,7 @@
#include <cmath>
#include <string_view>
#include "mojo/public/interfaces/bindings/tests/test_constants.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_constants.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -5,7 +5,7 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_CONTAINERS_OF_NULLABLE_TYPES_MOJOM_TRAITS_H_
#define MOJO_PUBLIC_CPP_BINDINGS_TESTS_CONTAINERS_OF_NULLABLE_TYPES_MOJOM_TRAITS_H_
#include "mojo/public/interfaces/bindings/tests/containers_of_nullable_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/containers_of_nullable_types.test-mojom.h"
namespace mojo::test::containers_of_nullable_types {

@ -12,7 +12,7 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/containers_of_nullable_types_mojom_traits.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/interfaces/bindings/tests/containers_of_nullable_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/containers_of_nullable_types.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo::test::containers_of_nullable_types {

@ -13,7 +13,7 @@
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/interfaces/bindings/tests/test_data_view.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_data_view.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -18,7 +18,7 @@
#include "mojo/core/test/mojo_test_base.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -4,7 +4,7 @@
#include <utility>
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -16,8 +16,8 @@
#include "mojo/public/cpp/bindings/unique_receiver_set.h"
#include "mojo/public/cpp/system/wait.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/interfaces/bindings/tests/sample_factory.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_import.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_factory.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_import.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -3,8 +3,7 @@
// found in the LICENSE file.
#include "mojo/public/cpp/bindings/lib/hash_util.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -4,12 +4,13 @@
#include <stddef.h>
#include <stdint.h>
#include <utility>
#include "base/containers/flat_map.h"
#include "mojo/public/cpp/bindings/tests/rect_chromium.h"
#include "mojo/public/interfaces/bindings/tests/rect.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/rect.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -15,7 +15,7 @@
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/cpp/system/wait.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -7,7 +7,7 @@
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/tests/nullable_value_types_enums.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.test-mojom.h"
namespace mojo {

@ -12,8 +12,8 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/nullable_value_types_enums.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.mojom-shared.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.test-mojom-shared.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo::test::nullable_value_types {

@ -15,8 +15,8 @@
#include "mojo/public/cpp/bindings/tests/pickled_types_blink.h"
#include "mojo/public/cpp/bindings/tests/pickled_types_chromium.h"
#include "mojo/public/cpp/bindings/tests/variant_test_util.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.test-mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -17,7 +17,7 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/cpp/test_support/test_support.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
///////////////////////////////////////////////////////////////////////////////

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/public/cpp/bindings/receiver_set.h"
#include <memory>
#include <utility>
@ -10,12 +12,11 @@
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/cpp/bindings/unique_receiver_set.h"
#include "mojo/public/cpp/system/functions.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_associated_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_associated_interfaces.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -32,9 +32,9 @@
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/cpp/bindings/tests/receiver_unittest.test-mojom.h"
#include "mojo/public/cpp/system/functions.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -7,7 +7,7 @@
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/tests/rect_blink.h"
#include "mojo/public/interfaces/bindings/tests/rect.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/rect.test-mojom-blink.h"
namespace mojo {

@ -36,10 +36,10 @@
#include "mojo/public/cpp/bindings/tests/remote_unittest.test-mojom.h"
#include "mojo/public/cpp/bindings/unique_receiver_set.h"
#include "mojo/public/cpp/system/wait.h"
#include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/scoping.mojom.h"
#include "mojo/public/interfaces/bindings/tests/math_calculator.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/scoping.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -12,7 +12,7 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/cpp/system/functions.h"
#include "mojo/public/interfaces/bindings/tests/test_bad_messages.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_bad_messages.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <stdint.h>
#include <utility>
#include "base/functional/bind.h"
@ -12,8 +13,8 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/interfaces/bindings/tests/sample_import.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_import.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_interfaces.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -9,6 +9,7 @@
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <iomanip>
#include <ostream>
@ -20,7 +21,7 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -6,6 +6,7 @@
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#include <stddef.h>
#include <utility>
#include "mojo/public/cpp/bindings/lib/array_internal.h"
@ -13,8 +14,8 @@
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_unions.mojom.h"
#include "mojo/public/interfaces/bindings/tests/serialization_test_structs.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_unions.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -7,7 +7,7 @@
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/tests/shared_rect.h"
#include "mojo/public/interfaces/bindings/tests/rect.mojom-shared.h"
#include "mojo/public/interfaces/bindings/tests/rect.test-mojom-shared.h"
namespace mojo {

@ -16,9 +16,9 @@
#include "mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h"
#include "mojo/public/cpp/bindings/tests/variant_test_util.h"
#include "mojo/public/cpp/system/wait.h"
#include "mojo/public/interfaces/bindings/tests/struct_with_traits.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/struct_with_traits.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.test-mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_native_types.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -5,12 +5,13 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <utility>
#include "mojo/public/cpp/bindings/lib/message_fragment.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/interfaces/bindings/tests/test_export2.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_export2.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -13,7 +13,7 @@
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/tests/struct_with_traits_impl.h"
#include "mojo/public/interfaces/bindings/tests/struct_with_traits.mojom.h"
#include "mojo/public/interfaces/bindings/tests/struct_with_traits.test-mojom.h"
namespace mojo {

@ -36,7 +36,7 @@
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
#include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom-shared-message-ids.h"
#include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_sync_methods.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_sync_methods.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
// This needs to be included last, since it forward declares a bunch of classes

@ -7,8 +7,8 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/cpp/system/wait.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom-test-utils.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.mojom.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom-test-utils.h"
#include "mojo/public/interfaces/bindings/tests/ping_service.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -5,7 +5,7 @@
#include <stddef.h>
#include <stdint.h>
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -29,8 +29,8 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/union_unittest.test-mojom.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_unions.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_unions.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -10,6 +10,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <tuple>
@ -32,8 +33,8 @@
#include "mojo/public/cpp/bindings/tests/validation_test_input_parser.h"
#include "mojo/public/cpp/system/message.h"
#include "mojo/public/cpp/test_support/test_support.h"
#include "mojo/public/interfaces/bindings/tests/validation_test_associated_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom.h"
#include "mojo/public/interfaces/bindings/tests/validation_test_associated_interfaces.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/validation_test_interfaces.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -3,9 +3,8 @@
// found in the LICENSE file.
#include "mojo/public/cpp/bindings/lib/wtf_hash_util.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_wtf_types.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"

@ -3,8 +3,8 @@
// found in the LICENSE file.
#include "mojo/public/cpp/bindings/tests/rect_blink.h"
#include "mojo/public/interfaces/bindings/tests/rect.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/rect.test-mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {

@ -16,8 +16,8 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/variant_test_util.h"
#include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_wtf_types.test-mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/test_wtf_types.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/wtf/text/string_hash.h"

@ -64,26 +64,26 @@ mojom("test_interfaces") {
generate_legacy_js_bindings = true
sources = [
"math_calculator.mojom",
"no_module.mojom",
"nullable_value_types.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",
"math_calculator.test-mojom",
"no_module.test-mojom",
"nullable_value_types.test-mojom",
"ping_service.test-mojom",
"rect.test-mojom",
"regression_tests.test-mojom",
"sample_factory.test-mojom",
"sample_interfaces.test-mojom",
"sample_service.test-mojom",
"scoping.test-mojom",
"serialization_test_structs.test-mojom",
"test_bad_messages.test-mojom",
"test_constants.test-mojom",
"test_data_view.test-mojom",
"test_name_generator.test-mojom",
"test_native_types.test-mojom",
"test_structs.test-mojom",
"test_sync_methods.test-mojom",
"test_unions.test-mojom",
"validation_test_interfaces.test-mojom",
]
public_deps = [
":echo",
@ -202,7 +202,7 @@ mojom("test_interfaces") {
mojom("test_interfaces_for_containers_of_optionals") {
testonly = true
generate_java = false
sources = [ "containers_of_nullable_types.mojom" ]
sources = [ "containers_of_nullable_types.test-mojom" ]
cpp_typemaps = [
{
types = [
@ -232,7 +232,7 @@ if (use_blink) {
mojom("test_export") {
testonly = true
sources = [ "test_export.mojom" ]
sources = [ "test_export.test-mojom" ]
export_class_attribute = "MOJO_TEST_EXPORT"
export_define = "MOJO_TEST_IMPLEMENTATION=1"
export_header = "mojo/public/cpp/bindings/tests/mojo_test_export.h"
@ -250,7 +250,7 @@ mojom("test_export") {
mojom("test_exported_import") {
testonly = true
sources = [ "test_import.mojom" ]
sources = [ "test_import.test-mojom" ]
public_deps = [ ":test_export" ]
overridden_deps = [ ":test_export" ]
@ -275,7 +275,7 @@ component("test_export_component2") {
mojom("test_export2") {
testonly = true
sources = [ "test_export2.mojom" ]
sources = [ "test_export2.test-mojom" ]
export_class_attribute = "MOJO_TEST_EXPORT"
export_define = "MOJO_TEST_IMPLEMENTATION=1"
export_header = "mojo/public/cpp/bindings/tests/mojo_test_export.h"
@ -288,7 +288,7 @@ mojom("test_mojom_import") {
generate_rust = true
webui_module_path = "/"
generate_legacy_js_bindings = true
sources = [ "sample_import.mojom" ]
sources = [ "sample_import.test-mojom" ]
}
mojom("test_mojom_import_wrapper") {
@ -311,7 +311,7 @@ mojom("test_mojom_import2") {
generate_rust = true
webui_module_path = "/"
generate_legacy_js_bindings = true
sources = [ "sample_import2.mojom" ]
sources = [ "sample_import2.test-mojom" ]
public_deps = [
":test_mojom_import",
":test_mojom_import_wrapper_wrapper",
@ -320,7 +320,7 @@ mojom("test_mojom_import2") {
mojom("test_struct_traits_interfaces") {
testonly = true
sources = [ "struct_with_traits.mojom" ]
sources = [ "struct_with_traits.test-mojom" ]
cpp_typemaps = [
{
@ -390,8 +390,8 @@ mojom("test_associated_interfaces") {
# associated interfaces are not supported by all bindings languages yet.
testonly = true
sources = [
"test_associated_interfaces.mojom",
"validation_test_associated_interfaces.mojom",
"test_associated_interfaces.test-mojom",
"validation_test_associated_interfaces.test-mojom",
]
public_deps = [ ":test_interfaces" ]
@ -404,7 +404,7 @@ mojom("test_associated_interfaces") {
mojom("test_wtf_types") {
testonly = true
sources = [ "test_wtf_types.mojom" ]
sources = [ "test_wtf_types.test-mojom" ]
}
mojom("test_no_sources") {
@ -418,8 +418,8 @@ mojom("echo") {
generate_java = true
generate_rust = true
sources = [
"echo.mojom",
"echo_import/echo_import.mojom",
"echo.test-mojom",
"echo_import/echo_import.test-mojom",
]
}

@ -4,7 +4,7 @@
module test.echo.mojom;
import "mojo/public/interfaces/bindings/tests/echo_import/echo_import.mojom";
import "mojo/public/interfaces/bindings/tests/echo_import/echo_import.test-mojom";
interface Echo {
EchoPoint(test.echo_import.mojom.Point point)

@ -5,7 +5,7 @@
[JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"]
module sample;
import "mojo/public/interfaces/bindings/tests/sample_import.mojom";
import "mojo/public/interfaces/bindings/tests/sample_import.test-mojom";
// This sample shows how handles to MessagePipes can be sent as both parameters
// to methods as well as fields on structs.

@ -5,7 +5,7 @@
[JavaPackage="org.chromium.mojo.bindings.test.mojom.imported"]
module imported;
import "mojo/public/interfaces/bindings/tests/sample_import.mojom";
import "mojo/public/interfaces/bindings/tests/sample_import.test-mojom";
// This sample adds more types and constants to the "imported" namespace,
// to test a bug with importing multiple modules with the same namespace.

@ -5,8 +5,8 @@
[JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"]
module sample;
import "mojo/public/interfaces/bindings/tests/sample_import.mojom";
import "mojo/public/interfaces/bindings/tests/sample_import2.mojom";
import "mojo/public/interfaces/bindings/tests/sample_import.test-mojom";
import "mojo/public/interfaces/bindings/tests/sample_import2.test-mojom";
const uint8 kTwelve = 12;

@ -4,7 +4,7 @@
module mojo.test;
import "mojo/public/interfaces/bindings/tests/ping_service.mojom";
import "mojo/public/interfaces/bindings/tests/ping_service.test-mojom";
interface FooInterface {};

@ -4,7 +4,7 @@
module mojo.test.test_import;
import "mojo/public/interfaces/bindings/tests/test_export.mojom";
import "mojo/public/interfaces/bindings/tests/test_export.test-mojom";
struct ImportingStruct {
mojo.test.test_export.StringPair strings;

@ -4,7 +4,7 @@
module mojo.test;
import "mojo/public/interfaces/bindings/tests/rect.mojom";
import "mojo/public/interfaces/bindings/tests/rect.test-mojom";
// Used to verify that structs can be declared with no body in mojom.

@ -5,7 +5,7 @@
[JavaPackage="org.chromium.mojo.bindings.test.mojom.test_structs"]
module mojo.test;
import "mojo/public/interfaces/bindings/tests/rect.mojom";
import "mojo/public/interfaces/bindings/tests/rect.test-mojom";
struct NamedRegion {
string? name;

@ -4,7 +4,7 @@
module mojo.test;
import "mojo/public/interfaces/bindings/tests/sample_import.mojom";
import "mojo/public/interfaces/bindings/tests/sample_import.test-mojom";
enum AnEnum {
FIRST, SECOND

@ -13,7 +13,7 @@
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/bindings/tests/nullable_value_types_enums.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.mojom.h"
#include "mojo/public/interfaces/bindings/tests/nullable_value_types.test-mojom.h"
// Must come after all headers that specialize FromJniType() / ToJniType().
#include "mojo/public/java/system/mojo_javatests_jni/NullableValueTypesTestUtil_jni.h"

@ -24,8 +24,8 @@ import org.chromium.mojo.system.impl.CoreImpl;
/**
* Testing generated classes with the [MinVersion] annotation. Struct in this test are from:
* mojo/public/interfaces/bindings/tests/rect.mojom and
* mojo/public/interfaces/bindings/tests/test_structs.mojom
* mojo/public/interfaces/bindings/tests/rect.test-mojom and
* mojo/public/interfaces/bindings/tests/test_structs.test-mojom
*/
@RunWith(BaseJUnit4ClassRunner.class)
public class BindingsVersioningTest {

@ -63,6 +63,10 @@ declare_args() {
if (is_chromeos_ash) {
enable_mojom_closure_compile = enable_js_type_check && optimize_webui
}
# Temporary option to allow testonly=true mojom to include .mojom files.
# TODO(crbug.com/383380971): Remove once migration is complete.
allow_dot_mojom_in_testonly_mojom = true
}
# Closure libraries are needed for mojom_closure_compile, and when
@ -684,7 +688,14 @@ template("mojom") {
process_file_template(sources_list, "{{source_file_part}}")
sources_list_filenames_with_mojom_extension =
process_file_template(sources_list, "{{source_name_part}}.mojom")
if (sources_list_filenames != sources_list_filenames_with_mojom_extension) {
if (sources_list_filenames == sources_list_filenames_with_mojom_extension) {
# Force testonly mojom() to use .test-mojom only using transitional option.
# See crbug.com/383380971 for migration details.
if (!allow_dot_mojom_in_testonly_mojom && defined(invoker.sources)) {
assert(!defined(invoker.testonly) || !invoker.testonly,
"testonly mojom target has non- .test-mojom files")
}
} else {
sources_list_filenames_with_test_mojom_extension =
process_file_template(sources_list, "{{source_name_part}}.test-mojom")
if (sources_list_filenames ==

@ -11,7 +11,7 @@
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -7,7 +7,7 @@
#include "base/memory/raw_ptr.h"
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -12,7 +12,7 @@
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/remote_set.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -6,7 +6,7 @@
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -11,7 +11,7 @@
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -8,7 +8,7 @@
#include "base/test/null_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -11,7 +11,7 @@
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote_set.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -7,7 +7,7 @@
#include "base/test/null_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -7,7 +7,7 @@
#include "base/memory/raw_ptr.h"
#include "base/test/null_task_runner.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-blink.h"
#include "mojo/public/interfaces/bindings/tests/sample_service.test-mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"

@ -2,9 +2,9 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="module">
import {Bar_Type, DefaultsSenderCallbackRouter, DefaultsSenderRemote, PortRemote, Service_BazOptions, ServiceReceiver, ServiceRemote, TWELVE} from '/gen/mojo/public/interfaces/bindings/tests/sample_service.mojom.m.js';
import {Shape} from '/gen/mojo/public/interfaces/bindings/tests/sample_import.mojom.m.js';
import {Color} from '/gen/mojo/public/interfaces/bindings/tests/sample_import2.mojom.m.js';
import {Bar_Type, DefaultsSenderCallbackRouter, DefaultsSenderRemote, PortRemote, Service_BazOptions, ServiceReceiver, ServiceRemote, TWELVE} from '/gen/mojo/public/interfaces/bindings/tests/sample_service.test-mojom.m.js';
import {Shape} from '/gen/mojo/public/interfaces/bindings/tests/sample_import.test-mojom.m.js';
import {Color} from '/gen/mojo/public/interfaces/bindings/tests/sample_import2.test-mojom.m.js';
// Checks that optional fields are passed with default values if we don't set
// them.