[Fuchsia] Enable extra test suits and correct the error reasons (#164338)

Fuchsia does not support Dart_LoadELF, the tests are expected to fail.
So this change explicitly disables the related tests instead of removing
the suites.

b/394632376

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This commit is contained in:
zijiehe@
2025-03-03 09:39:14 -08:00
committed by GitHub
parent 04d39343a6
commit 80d0a8b8de
6 changed files with 129 additions and 30 deletions

View File

@@ -219,12 +219,6 @@ TEST_F(PerformanceOverlayLayerTest, SimpleRasterizerStatistics) {
ImageSizeTextBlobInspector inspector;
display_list()->Dispatch(inspector);
// TODO(https://github.com/flutter/flutter/issues/82202): Remove once the
// performance overlay can use Fuchsia's font manager instead of the empty
// default.
#if defined(OS_FUCHSIA)
GTEST_SKIP() << "Expectation requires a valid default font manager";
#endif // OS_FUCHSIA
ASSERT_EQ(inspector.sizes().size(), 0u);
ASSERT_EQ(inspector.text_blobs().size(), 1u);
ASSERT_EQ(inspector.text_positions().size(), 1u);

View File

@@ -52,6 +52,9 @@ class DartIsolateTest : public FixtureTest {
};
TEST_F(DartIsolateTest, DartPluginRegistrantIsPresent) {
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
std::vector<std::string> messages;
@@ -96,9 +99,13 @@ TEST_F(DartIsolateTest, DartPluginRegistrantIsPresent) {
ASSERT_EQ(messages.size(), 1u);
ASSERT_EQ(messages[0], "_PluginRegistrant.register() was called");
#endif
}
TEST_F(DartIsolateTest, DartPluginRegistrantFromBackgroundIsolate) {
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
std::vector<std::string> messages;
@@ -144,9 +151,13 @@ TEST_F(DartIsolateTest, DartPluginRegistrantFromBackgroundIsolate) {
ASSERT_EQ(messages.size(), 1u);
ASSERT_EQ(messages[0],
"_PluginRegistrant.register() was called on background isolate");
#endif
}
TEST_F(DartIsolateTest, DartPluginRegistrantNotFromBackgroundIsolate) {
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
std::vector<std::string> messages;
@@ -193,9 +204,13 @@ TEST_F(DartIsolateTest, DartPluginRegistrantNotFromBackgroundIsolate) {
ASSERT_EQ(
messages[0],
"_PluginRegistrant.register() was not called on background isolate");
#endif
}
TEST_F(DartIsolateTest, DartPluginRegistrantWhenRegisteringBackgroundIsolate) {
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
std::vector<std::string> messages;
@@ -241,6 +256,7 @@ TEST_F(DartIsolateTest, DartPluginRegistrantWhenRegisteringBackgroundIsolate) {
ASSERT_EQ(messages.size(), 1u);
ASSERT_EQ(messages[0],
"_PluginRegistrant.register() was called on background isolate");
#endif
}
} // namespace testing

View File

@@ -26,6 +26,9 @@ class DartIsolateTest : public FixtureTest {
};
TEST_F(DartIsolateTest, DartPluginRegistrantIsNotPresent) {
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
std::vector<std::string> messages;
@@ -70,6 +73,7 @@ TEST_F(DartIsolateTest, DartPluginRegistrantIsNotPresent) {
ASSERT_EQ(messages.size(), 1u);
ASSERT_EQ(messages[0], "main() was called");
ASSERT_FALSE(did_throw_exception);
#endif
}
} // namespace testing

View File

@@ -29,9 +29,14 @@ namespace testing {
using EmbedderA11yTest = testing::EmbedderTest;
using ::testing::ElementsAre;
#if !defined(OS_FUCHSIA) || (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)
constexpr static char kTooltip[] = "tooltip";
#endif
TEST_F(EmbedderTest, CannotProvideMultipleSemanticsCallbacks) {
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
{
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
EmbedderConfigBuilder builder(context);
@@ -91,13 +96,13 @@ TEST_F(EmbedderTest, CannotProvideMultipleSemanticsCallbacks) {
ASSERT_FALSE(engine.is_valid());
engine.reset();
}
#endif
}
TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV3Callbacks) {
#if defined(OS_FUCHSIA)
GTEST_SKIP() << "This test crashes on Fuchsia. https://fxbug.dev/87493 ";
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
fml::AutoResetWaitableEvent signal_native_latch;
@@ -269,14 +274,13 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV3Callbacks) {
result = FlutterEngineUpdateSemanticsEnabled(engine.get(), false);
ASSERT_EQ(result, FlutterEngineResult::kSuccess);
notify_semantics_enabled_latch_3.Wait();
#endif // OS_FUCHSIA
#endif
}
TEST_F(EmbedderA11yTest, A11yStringAttributes) {
#if defined(OS_FUCHSIA)
GTEST_SKIP() << "This test crashes on Fuchsia. https://fxbug.dev/87493 ";
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
fml::AutoResetWaitableEvent signal_native_latch;
@@ -389,14 +393,13 @@ TEST_F(EmbedderA11yTest, A11yStringAttributes) {
signal_native_latch.Wait();
fml::MessageLoop::GetCurrent().RunExpiredTasksNow();
semantics_update_latch.Wait();
#endif // OS_FUCHSIA
#endif
}
TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV2Callbacks) {
#if defined(OS_FUCHSIA)
GTEST_SKIP() << "This test crashes on Fuchsia. https://fxbug.dev/87493 ";
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
fml::AutoResetWaitableEvent signal_native_latch;
@@ -566,10 +569,13 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV2Callbacks) {
result = FlutterEngineUpdateSemanticsEnabled(engine.get(), false);
ASSERT_EQ(result, FlutterEngineResult::kSuccess);
notify_semantics_enabled_latch_3.Wait();
#endif // OS_FUCHSIA
#endif
}
TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV1Callbacks) {
#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
#else
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
fml::AutoResetWaitableEvent signal_native_latch;
@@ -765,6 +771,7 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV1Callbacks) {
result = FlutterEngineUpdateSemanticsEnabled(engine.get(), false);
ASSERT_EQ(result, FlutterEngineResult::kSuccess);
notify_semantics_enabled_latch_3.Wait();
#endif
}
} // namespace testing

View File

@@ -916,21 +916,84 @@ if (enable_unittests) {
}
fuchsia_test_archive("dart_plugin_registrant_unittests") {
deps = [ "//flutter/runtime:dart_plugin_registrant_unittests" ]
deps = [
"//flutter/runtime:dart_plugin_registrant_unittests",
"//flutter/runtime:plugin_registrant",
]
gen_cml_file = true
binary = "dart_plugin_registrant_unittests"
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
# Right now we need to manually specify all the fixtures that are
# declared in the test_fixtures() call above.
resources = [
{
path = "$root_gen_dir/flutter/runtime/assets/plugin_registrant_kernel_blob.bin"
dest = "assets/plugin_registrant_kernel_blob.bin"
},
]
if (is_aot_test) {
resources += [
{
path = "$root_gen_dir/flutter/runtime/assets/plugin_registrant_app_elf_snapshot.so"
dest = "assets/plugin_registrant_app_elf_snapshot.so"
},
]
}
}
fuchsia_test_archive("no_dart_plugin_registrant_unittests") {
deps = [ "//flutter/runtime:no_dart_plugin_registrant_unittests" ]
deps = [
"//flutter/runtime:no_dart_plugin_registrant_unittests",
"//flutter/runtime:no_plugin_registrant",
]
gen_cml_file = true
binary = "no_dart_plugin_registrant_unittests"
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
# Right now we need to manually specify all the fixtures that are
# declared in the test_fixtures() call above.
resources = [
{
path = "$root_gen_dir/flutter/runtime/assets/no_plugin_registrant_kernel_blob.bin"
dest = "assets/no_plugin_registrant_kernel_blob.bin"
},
]
if (is_aot_test) {
resources += [
{
path = "$root_gen_dir/flutter/runtime/assets/no_plugin_registrant_app_elf_snapshot.so"
dest = "assets/no_plugin_registrant_app_elf_snapshot.so"
},
]
}
}
fuchsia_test_archive("embedder_a11y_unittests") {
deps = [ "//flutter/shell/platform/embedder:embedder_a11y_unittests" ]
deps = [
"//flutter/shell/platform/embedder:embedder_a11y_unittests",
"//flutter/shell/platform/embedder:fixtures",
]
gen_cml_file = true
binary = "embedder_a11y_unittests"
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
# Right now we need to manually specify all the fixtures that are
# declared in the test_fixtures() call above.
resources = [
{
path = "$root_gen_dir/flutter/shell/platform/embedder/assets/kernel_blob.bin"
dest = "assets/kernel_blob.bin"
},
]
if (is_aot_test) {
resources += [
{
path = "$root_gen_dir/flutter/shell/platform/embedder/assets/app_elf_snapshot.so"
dest = "assets/app_elf_snapshot.so"
},
]
}
}
fuchsia_test_archive("embedder_proctable_unittests") {
@@ -946,9 +1009,30 @@ if (enable_unittests) {
}
fuchsia_test_archive("tonic_unittests") {
deps = [ "//flutter/third_party/tonic/tests:tonic_unittests" ]
deps = [
"//flutter/third_party/tonic/tests:tonic_fixtures",
"//flutter/third_party/tonic/tests:tonic_unittests",
]
gen_cml_file = true
binary = "tonic_unittests"
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
# Right now we need to manually specify all the fixtures that are
# declared in the test_fixtures() call above.
resources = [
{
path = "$root_gen_dir/flutter/third_party/tonic/tests/assets/kernel_blob.bin"
dest = "assets/kernel_blob.bin"
},
]
if (is_aot_test) {
resources += [
{
path = "$root_gen_dir/flutter/third_party/tonic/tests/assets/app_elf_snapshot.so"
dest = "assets/app_elf_snapshot.so"
},
]
}
}
# When adding a new dep here, please also ensure the dep is added to

View File

@@ -32,9 +32,7 @@
- 'arm64'
variant: debug
- test_command: test run fuchsia-pkg://fuchsia.com/dart_plugin_registrant_unittests#meta/dart_plugin_registrant_unittests.cm
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
package: dart_plugin_registrant_unittests-0.far
variant: disabled
- test_command: test run fuchsia-pkg://fuchsia.com/dart_runner_tests#meta/dart_runner_tests.cm
package: dart_runner_tests-0.far
- test_command: test run fuchsia-pkg://fuchsia.com/dart_utils_tests#meta/dart_utils_tests.cm
@@ -46,9 +44,7 @@
- test_command: test run fuchsia-pkg://fuchsia.com/display_list_tests#meta/display_list_tests.cm
package: display_list_tests-0.far
- test_command: test run fuchsia-pkg://fuchsia.com/embedder_a11y_unittests#meta/embedder_a11y_unittests.cm
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
package: embedder_a11y_unittests-0.far
variant: disabled
- test_command: test run fuchsia-pkg://fuchsia.com/embedder_proctable_unittests#meta/embedder_proctable_unittests.cm
package: embedder_proctable_unittests-0.far
- test_command: test run fuchsia-pkg://fuchsia.com/embedder_tests#meta/embedder_tests.cm
@@ -77,9 +73,7 @@
- oot_flutter_jit_runner-0.far
- gen/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/mouse-input-view/mouse-input-view.far
- test_command: test run fuchsia-pkg://fuchsia.com/no_dart_plugin_registrant_unittests#meta/no_dart_plugin_registrant_unittests.cm
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
package: no_dart_plugin_registrant_unittests-0.far
variant: disabled
- test_command: test run fuchsia-pkg://fuchsia.com/runtime_tests#meta/runtime_tests.cm
package: runtime_tests-0.far
disabled: on debug_arm64 because of the slowness
@@ -96,9 +90,9 @@
- gen/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/text-input-view/text-input-view.far
variant: debug_x64
- test_command: test run fuchsia-pkg://fuchsia.com/tonic_unittests#meta/tonic_unittests.cm
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
disabled: Dart_LoadELF isn't implemented on Fuchsia
package: tonic_unittests-0.far
variant: disabled
variant: debug
- test_command: test run fuchsia-pkg://fuchsia.com/touch-input-test#meta/touch-input-test.cm
packages:
- touch-input-test-0.far