diff --git a/engine/src/flutter/flow/layers/performance_overlay_layer_unittests.cc b/engine/src/flutter/flow/layers/performance_overlay_layer_unittests.cc index ba17e80f53..2cb56a05f3 100644 --- a/engine/src/flutter/flow/layers/performance_overlay_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/performance_overlay_layer_unittests.cc @@ -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); diff --git a/engine/src/flutter/runtime/dart_plugin_registrant_unittests.cc b/engine/src/flutter/runtime/dart_plugin_registrant_unittests.cc index b3f7892617..bbc4e83971 100644 --- a/engine/src/flutter/runtime/dart_plugin_registrant_unittests.cc +++ b/engine/src/flutter/runtime/dart_plugin_registrant_unittests.cc @@ -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 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 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 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 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 diff --git a/engine/src/flutter/runtime/no_dart_plugin_registrant_unittests.cc b/engine/src/flutter/runtime/no_dart_plugin_registrant_unittests.cc index b2a89a6847..39b4129e6b 100644 --- a/engine/src/flutter/runtime/no_dart_plugin_registrant_unittests.cc +++ b/engine/src/flutter/runtime/no_dart_plugin_registrant_unittests.cc @@ -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 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 diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc index ae23f1c428..c6ad07a02b 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc @@ -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(); 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(); 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(); 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(); 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(); 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 diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn index 40630d5cd3..90c7ba95e4 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn @@ -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 diff --git a/engine/src/flutter/testing/fuchsia/test_suites.yaml b/engine/src/flutter/testing/fuchsia/test_suites.yaml index 83251f9cbb..d7ef7e54da 100644 --- a/engine/src/flutter/testing/fuchsia/test_suites.yaml +++ b/engine/src/flutter/testing/fuchsia/test_suites.yaml @@ -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