From 9d98dcdad4ed1b1a36de6ecbb625090445ac68f7 Mon Sep 17 00:00:00 2001 From: Dustin Green Date: Wed, 17 Apr 2024 00:20:15 +0000 Subject: [PATCH] [fuchsia] route fuchsia.sysmem2.Allocator Fuchsia's fake-display will be migrating to sysmem2, which requires fuchsia.sysmem2.Allocator to be routed anywhere that fake-display is used (in tests). In addition, this change routes fuchsia.sysmem2.Allocator everywhere that fuchsia.sysmem.Allocator is routed (without regard for whether needed by fake-display). This way flutter engine can migrate to fuchsia.sysmem2.Allocator without needing more protocol routing diffs. https://github.com/flutter/flutter/issues/146858 --- .../meta/dart-aot-runner-integration-test.cml | 1 + .../meta/dart-jit-runner-integration-test.cml | 1 + shell/platform/fuchsia/flutter/meta/common.shard.cml | 1 + .../flutter/tests/integration/embedder/BUILD.gn | 2 ++ .../integration/embedder/flutter-embedder-test.cc | 12 ++++++++++++ .../embedder/meta/flutter-embedder-test.cml | 1 + .../mouse-input/meta/mouse-input-test.cml | 1 + .../mouse-input-view/meta/mouse-input-view.cml | 1 + .../integration/text-input/meta/text-input-test.cml | 1 + .../touch-input/meta/touch-input-test.cml | 1 + .../fuchsia/flutter/tests/integration/utils/BUILD.gn | 2 ++ .../tests/integration/utils/portable_ui_test.cc | 7 +++++++ 12 files changed, 31 insertions(+) diff --git a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml index 25c64dd6859bd..83c4cd18caae0 100644 --- a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml +++ b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml @@ -22,6 +22,7 @@ "fuchsia.inspect.InspectSink", "fuchsia.logger.LogSink", "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.tracing.provider.Registry", "fuchsia.vulkan.loader.Loader", "fuchsia.posix.socket.Provider", diff --git a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml index 5a7a6fc7c5587..4b0c450fff117 100644 --- a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml +++ b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml @@ -22,6 +22,7 @@ "fuchsia.inspect.InspectSink", "fuchsia.logger.LogSink", "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.tracing.provider.Registry", "fuchsia.vulkan.loader.Loader", "fuchsia.posix.socket.Provider", diff --git a/shell/platform/fuchsia/flutter/meta/common.shard.cml b/shell/platform/fuchsia/flutter/meta/common.shard.cml index 6bc325ab628a8..ffd5b1385c963 100644 --- a/shell/platform/fuchsia/flutter/meta/common.shard.cml +++ b/shell/platform/fuchsia/flutter/meta/common.shard.cml @@ -41,6 +41,7 @@ "fuchsia.net.name.Lookup", "fuchsia.posix.socket.Provider", "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.ui.composition.Allocator", "fuchsia.ui.composition.Flatland", "fuchsia.ui.input.ImeService", diff --git a/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn b/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn index 4af5ae5df9a0f..43bc60e4fb555 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn +++ b/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn @@ -26,6 +26,8 @@ executable("flutter-embedder-test-bin") { deps = [ "${fuchsia_sdk}/fidl/fuchsia.inspect", "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/fidl/fuchsia.sysmem", + "${fuchsia_sdk}/fidl/fuchsia.sysmem2", "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", "${fuchsia_sdk}/fidl/fuchsia.ui.app", "${fuchsia_sdk}/fidl/fuchsia.ui.composition", diff --git a/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc b/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc index 17cfb87e55aec..b6fd06fc90132 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc +++ b/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc @@ -4,6 +4,8 @@ #include #include +#include +#include #include #include #include @@ -235,6 +237,11 @@ void FlutterEmbedderTest::SetUpRealmBase() { Protocol{fuchsia::logger::LogSink::Name_}, Protocol{fuchsia::inspect::InspectSink::Name_}, Protocol{fuchsia::sysmem::Allocator::Name_}, + + // Replace string with + // fuchsia::sysmem2::Allocator::Name_ + // when available (fuchsia SDK >= 19). + Protocol{"fuchsia.sysmem2.Allocator"}, Protocol{fuchsia::tracing::provider::Registry::Name_}, Protocol{kVulkanLoaderServiceName}, }, @@ -247,6 +254,11 @@ void FlutterEmbedderTest::SetUpRealmBase() { .capabilities = {Protocol{fuchsia::logger::LogSink::Name_}, Protocol{fuchsia::inspect::InspectSink::Name_}, Protocol{fuchsia::sysmem::Allocator::Name_}, + + // Replace string with + // fuchsia::sysmem2::Allocator::Name_ + // when available (fuchsia SDK >= 19). + Protocol{"fuchsia.sysmem2.Allocator"}, Protocol{fuchsia::tracing::provider::Registry::Name_}, Protocol{kVulkanLoaderServiceName}}, .source = ParentRef{}, diff --git a/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml b/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml index ada9c05048533..56594825a704a 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml +++ b/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml @@ -21,6 +21,7 @@ "fuchsia.inspect.InspectSink", "fuchsia.logger.LogSink", "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.tracing.provider.Registry", "fuchsia.vulkan.loader.Loader", ], diff --git a/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml b/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml index 1199c2cb024fe..b5c717e989f3f 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml +++ b/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml @@ -31,6 +31,7 @@ "fuchsia.logger.LogSink", "fuchsia.scheduler.ProfileProvider", "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.tracing.provider.Registry", "fuchsia.ui.input.ImeService", "fuchsia.vulkan.loader.Loader", diff --git a/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/meta/mouse-input-view.cml b/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/meta/mouse-input-view.cml index fecafe2c6275d..f2e6bbcfc3f5d 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/meta/mouse-input-view.cml +++ b/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/meta/mouse-input-view.cml @@ -25,6 +25,7 @@ { protocol: [ "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.tracing.provider.Registry", "fuchsia.ui.composition.Flatland", "fuchsia.ui.test.input.MouseInputListener", diff --git a/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml b/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml index 38ce49b81ee5f..22008d7866fd7 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml +++ b/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml @@ -30,6 +30,7 @@ "fuchsia.logger.LogSink", "fuchsia.scheduler.ProfileProvider", "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.tracing.provider.Registry", "fuchsia.ui.input.ImeService", "fuchsia.vulkan.loader.Loader", diff --git a/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml b/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml index e02e3b7de72c6..10dbde87ae447 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml +++ b/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml @@ -31,6 +31,7 @@ "fuchsia.logger.LogSink", "fuchsia.scheduler.ProfileProvider", "fuchsia.sysmem.Allocator", + "fuchsia.sysmem2.Allocator", "fuchsia.tracing.provider.Registry", "fuchsia.ui.input.ImeService", "fuchsia.vulkan.loader.Loader", diff --git a/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn b/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn index 613976f2056a5..3767ffa01800f 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn +++ b/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn @@ -43,6 +43,8 @@ source_set("portable_ui_test") { ":check_view", "${fuchsia_sdk}/fidl/fuchsia.inspect", "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/fidl/fuchsia.sysmem", + "${fuchsia_sdk}/fidl/fuchsia.sysmem2", "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", "${fuchsia_sdk}/fidl/fuchsia.ui.app", "${fuchsia_sdk}/fidl/fuchsia.ui.composition", diff --git a/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc b/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc index e36718a448081..af529b594c64e 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc +++ b/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc @@ -6,6 +6,8 @@ #include #include +#include +#include #include #include #include @@ -80,6 +82,11 @@ void PortableUITest::SetUpRealmBase() { .capabilities = {Protocol{fuchsia::logger::LogSink::Name_}, Protocol{fuchsia::inspect::InspectSink::Name_}, Protocol{fuchsia::sysmem::Allocator::Name_}, + + // Replace string with + // fuchsia::sysmem2::Allocator::Name_ + // when available (fuchsia SDK >= 19). + Protocol{"fuchsia.sysmem2.Allocator"}, Protocol{fuchsia::tracing::provider::Registry::Name_}, Protocol{fuchsia::ui::input::ImeService::Name_}, Protocol{kPosixSocketProviderName},