From 1bdc2a83c6d32769ddc7f3d26edbed7955492cc5 Mon Sep 17 00:00:00 2001 From: Dustin Green Date: Fri, 26 Apr 2024 13:05:09 -0700 Subject: [PATCH] [fuchsia] route fuchsia.sysmem2.Allocator (flutter/engine#52187) Fuchsia's fake-display will be migrating to sysmem2, which requires fuchsia.sysmem2.Allocator to be routed in a few places. fixes flutter/flutter#146858 - [y] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [y] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [na] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [y] I listed at least one issue that this PR fixes in the description above. - [fixes to existing tests] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [na] I updated/added relevant documentation (doc comments with `///`). - [na / googler] I signed the [CLA]. - [y] All existing and new tests are passing. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../fuchsia/flutter/tests/integration/embedder/BUILD.gn | 2 ++ .../tests/integration/embedder/flutter-embedder-test.cc | 2 ++ .../integration/embedder/meta/flutter-embedder-test.cml | 1 + .../tests/integration/text-input/meta/text-input-test.cml | 1 + .../integration/touch-input/meta/touch-input-test.cml | 1 + .../fuchsia/flutter/tests/integration/utils/BUILD.gn | 2 ++ .../flutter/tests/integration/utils/portable_ui_test.cc | 7 +++++++ 7 files changed, 16 insertions(+) diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn index 4af5ae5df9..43bc60e4fb 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn +++ b/engine/src/flutter/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/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc index 17cfb87e55..6c507103a0 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc @@ -4,6 +4,8 @@ #include #include +#include +#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml index ada9c05048..56594825a7 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml +++ b/engine/src/flutter/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/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml index 38ce49b81e..22008d7866 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml +++ b/engine/src/flutter/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/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml index e02e3b7de7..10dbde87ae 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml +++ b/engine/src/flutter/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/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn index 613976f205..3767ffa018 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn +++ b/engine/src/flutter/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/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc index e36718a448..af529b594c 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc +++ b/engine/src/flutter/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},