Skip to content

Commit bad8f25

Browse files
enable tests
1 parent f0b0805 commit bad8f25

File tree

5 files changed

+105
-20
lines changed

5 files changed

+105
-20
lines changed

engine/src/flutter/runtime/dart_plugin_registrant_unittests.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class DartIsolateTest : public FixtureTest {
5252
};
5353

5454
TEST_F(DartIsolateTest, DartPluginRegistrantIsPresent) {
55+
#if defined(OS_FUCHSIA)
56+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
57+
#else
5558
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
5659

5760
std::vector<std::string> messages;
@@ -96,9 +99,13 @@ TEST_F(DartIsolateTest, DartPluginRegistrantIsPresent) {
9699

97100
ASSERT_EQ(messages.size(), 1u);
98101
ASSERT_EQ(messages[0], "_PluginRegistrant.register() was called");
102+
#endif
99103
}
100104

101105
TEST_F(DartIsolateTest, DartPluginRegistrantFromBackgroundIsolate) {
106+
#if defined(OS_FUCHSIA)
107+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
108+
#else
102109
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
103110

104111
std::vector<std::string> messages;
@@ -144,9 +151,13 @@ TEST_F(DartIsolateTest, DartPluginRegistrantFromBackgroundIsolate) {
144151
ASSERT_EQ(messages.size(), 1u);
145152
ASSERT_EQ(messages[0],
146153
"_PluginRegistrant.register() was called on background isolate");
154+
#endif
147155
}
148156

149157
TEST_F(DartIsolateTest, DartPluginRegistrantNotFromBackgroundIsolate) {
158+
#if defined(OS_FUCHSIA)
159+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
160+
#else
150161
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
151162

152163
std::vector<std::string> messages;
@@ -193,9 +204,13 @@ TEST_F(DartIsolateTest, DartPluginRegistrantNotFromBackgroundIsolate) {
193204
ASSERT_EQ(
194205
messages[0],
195206
"_PluginRegistrant.register() was not called on background isolate");
207+
#endif
196208
}
197209

198210
TEST_F(DartIsolateTest, DartPluginRegistrantWhenRegisteringBackgroundIsolate) {
211+
#if defined(OS_FUCHSIA)
212+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
213+
#else
199214
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
200215

201216
std::vector<std::string> messages;
@@ -241,6 +256,7 @@ TEST_F(DartIsolateTest, DartPluginRegistrantWhenRegisteringBackgroundIsolate) {
241256
ASSERT_EQ(messages.size(), 1u);
242257
ASSERT_EQ(messages[0],
243258
"_PluginRegistrant.register() was called on background isolate");
259+
#endif
244260
}
245261

246262
} // namespace testing

engine/src/flutter/runtime/no_dart_plugin_registrant_unittests.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class DartIsolateTest : public FixtureTest {
2626
};
2727

2828
TEST_F(DartIsolateTest, DartPluginRegistrantIsNotPresent) {
29+
#if defined(OS_FUCHSIA)
30+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
31+
#else
2932
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
3033

3134
std::vector<std::string> messages;
@@ -70,6 +73,7 @@ TEST_F(DartIsolateTest, DartPluginRegistrantIsNotPresent) {
7073
ASSERT_EQ(messages.size(), 1u);
7174
ASSERT_EQ(messages[0], "main() was called");
7275
ASSERT_FALSE(did_throw_exception);
76+
#endif
7377
}
7478

7579
} // namespace testing

engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ namespace testing {
2929
using EmbedderA11yTest = testing::EmbedderTest;
3030
using ::testing::ElementsAre;
3131

32+
#if !defined(OS_FUCHSIA)
3233
constexpr static char kTooltip[] = "tooltip";
34+
#endif
3335

3436
TEST_F(EmbedderTest, CannotProvideMultipleSemanticsCallbacks) {
37+
#if defined(OS_FUCHSIA)
38+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
39+
#else
3540
{
3641
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
3742
EmbedderConfigBuilder builder(context);
@@ -91,13 +96,13 @@ TEST_F(EmbedderTest, CannotProvideMultipleSemanticsCallbacks) {
9196
ASSERT_FALSE(engine.is_valid());
9297
engine.reset();
9398
}
99+
#endif
94100
}
95101

96102
TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV3Callbacks) {
97103
#if defined(OS_FUCHSIA)
98-
GTEST_SKIP() << "This test crashes on Fuchsia. https://fxbug.dev/87493 ";
104+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
99105
#else
100-
101106
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
102107

103108
fml::AutoResetWaitableEvent signal_native_latch;
@@ -269,14 +274,13 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV3Callbacks) {
269274
result = FlutterEngineUpdateSemanticsEnabled(engine.get(), false);
270275
ASSERT_EQ(result, FlutterEngineResult::kSuccess);
271276
notify_semantics_enabled_latch_3.Wait();
272-
#endif // OS_FUCHSIA
277+
#endif
273278
}
274279

275280
TEST_F(EmbedderA11yTest, A11yStringAttributes) {
276281
#if defined(OS_FUCHSIA)
277-
GTEST_SKIP() << "This test crashes on Fuchsia. https://fxbug.dev/87493 ";
282+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
278283
#else
279-
280284
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
281285

282286
fml::AutoResetWaitableEvent signal_native_latch;
@@ -389,14 +393,13 @@ TEST_F(EmbedderA11yTest, A11yStringAttributes) {
389393
signal_native_latch.Wait();
390394
fml::MessageLoop::GetCurrent().RunExpiredTasksNow();
391395
semantics_update_latch.Wait();
392-
#endif // OS_FUCHSIA
396+
#endif
393397
}
394398

395399
TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV2Callbacks) {
396400
#if defined(OS_FUCHSIA)
397-
GTEST_SKIP() << "This test crashes on Fuchsia. https://fxbug.dev/87493 ";
401+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
398402
#else
399-
400403
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
401404

402405
fml::AutoResetWaitableEvent signal_native_latch;
@@ -566,10 +569,13 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV2Callbacks) {
566569
result = FlutterEngineUpdateSemanticsEnabled(engine.get(), false);
567570
ASSERT_EQ(result, FlutterEngineResult::kSuccess);
568571
notify_semantics_enabled_latch_3.Wait();
569-
#endif // OS_FUCHSIA
572+
#endif
570573
}
571574

572575
TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV1Callbacks) {
576+
#if defined(OS_FUCHSIA)
577+
GTEST_SKIP() << "Dart_LoadELF is not implemented on Fuchsia.";
578+
#else
573579
auto& context = GetEmbedderContext<EmbedderTestContextSoftware>();
574580

575581
fml::AutoResetWaitableEvent signal_native_latch;
@@ -765,6 +771,7 @@ TEST_F(EmbedderA11yTest, A11yTreeIsConsistentUsingV1Callbacks) {
765771
result = FlutterEngineUpdateSemanticsEnabled(engine.get(), false);
766772
ASSERT_EQ(result, FlutterEngineResult::kSuccess);
767773
notify_semantics_enabled_latch_3.Wait();
774+
#endif
768775
}
769776

770777
} // namespace testing

engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,21 +916,69 @@ if (enable_unittests) {
916916
}
917917

918918
fuchsia_test_archive("dart_plugin_registrant_unittests") {
919-
deps = [ "//flutter/runtime:dart_plugin_registrant_unittests" ]
919+
deps = [
920+
"//flutter/runtime:plugin_registrant",
921+
"//flutter/runtime:dart_plugin_registrant_unittests",
922+
]
920923
gen_cml_file = true
921924
binary = "dart_plugin_registrant_unittests"
925+
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
926+
# Right now we need to manually specify all the fixtures that are
927+
# declared in the test_fixtures() call above.
928+
resources = [
929+
{
930+
path = "$root_gen_dir/flutter/runtime/assets/plugin_registrant_kernel_blob.bin"
931+
dest = "assets/plugin_registrant_kernel_blob.bin"
932+
},
933+
{
934+
path = "$root_gen_dir/flutter/runtime/assets/plugin_registrant_app_elf_snapshot.so"
935+
dest = "assets/plugin_registrant_app_elf_snapshot.so"
936+
},
937+
]
922938
}
923939

924940
fuchsia_test_archive("no_dart_plugin_registrant_unittests") {
925-
deps = [ "//flutter/runtime:no_dart_plugin_registrant_unittests" ]
941+
deps = [
942+
"//flutter/runtime:no_plugin_registrant",
943+
"//flutter/runtime:no_dart_plugin_registrant_unittests",
944+
]
926945
gen_cml_file = true
927946
binary = "no_dart_plugin_registrant_unittests"
947+
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
948+
# Right now we need to manually specify all the fixtures that are
949+
# declared in the test_fixtures() call above.
950+
resources = [
951+
{
952+
path = "$root_gen_dir/flutter/runtime/assets/no_plugin_registrant_kernel_blob.bin"
953+
dest = "assets/no_plugin_registrant_kernel_blob.bin"
954+
},
955+
{
956+
path = "$root_gen_dir/flutter/runtime/assets/no_plugin_registrant_app_elf_snapshot.so"
957+
dest = "assets/no_plugin_registrant_app_elf_snapshot.so"
958+
},
959+
]
928960
}
929961

930962
fuchsia_test_archive("embedder_a11y_unittests") {
931-
deps = [ "//flutter/shell/platform/embedder:embedder_a11y_unittests" ]
963+
deps = [
964+
"//flutter/shell/platform/embedder:fixtures",
965+
"//flutter/shell/platform/embedder:embedder_a11y_unittests",
966+
]
932967
gen_cml_file = true
933968
binary = "embedder_a11y_unittests"
969+
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
970+
# Right now we need to manually specify all the fixtures that are
971+
# declared in the test_fixtures() call above.
972+
resources = [
973+
{
974+
path = "$root_gen_dir/flutter/shell/platform/embedder/assets/kernel_blob.bin"
975+
dest = "assets/kernel_blob.bin"
976+
},
977+
{
978+
path = "$root_gen_dir/flutter/shell/platform/embedder/assets/app_elf_snapshot.so"
979+
dest = "assets/app_elf_snapshot.so"
980+
},
981+
]
934982
}
935983

936984
fuchsia_test_archive("embedder_proctable_unittests") {
@@ -946,9 +994,25 @@ if (enable_unittests) {
946994
}
947995

948996
fuchsia_test_archive("tonic_unittests") {
949-
deps = [ "//flutter/third_party/tonic/tests:tonic_unittests" ]
997+
deps = [
998+
"//flutter/third_party/tonic/tests:tonic_fixtures",
999+
"//flutter/third_party/tonic/tests:tonic_unittests",
1000+
]
9501001
gen_cml_file = true
9511002
binary = "tonic_unittests"
1003+
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
1004+
# Right now we need to manually specify all the fixtures that are
1005+
# declared in the test_fixtures() call above.
1006+
resources = [
1007+
{
1008+
path = "$root_gen_dir/flutter/third_party/tonic/tests/assets/kernel_blob.bin"
1009+
dest = "assets/kernel_blob.bin"
1010+
},
1011+
{
1012+
path = "$root_gen_dir/flutter/third_party/tonic/tests/assets/app_elf_snapshot.so"
1013+
dest = "assets/app_elf_snapshot.so"
1014+
},
1015+
]
9521016
}
9531017

9541018
# When adding a new dep here, please also ensure the dep is added to

engine/src/flutter/testing/fuchsia/test_suites.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
- 'arm64'
3333
variant: debug
3434
- test_command: test run fuchsia-pkg://fuchsia.com/dart_plugin_registrant_unittests#meta/dart_plugin_registrant_unittests.cm
35-
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
3635
package: dart_plugin_registrant_unittests-0.far
37-
variant: disabled
3836
- test_command: test run fuchsia-pkg://fuchsia.com/dart_runner_tests#meta/dart_runner_tests.cm
3937
package: dart_runner_tests-0.far
4038
- test_command: test run fuchsia-pkg://fuchsia.com/dart_utils_tests#meta/dart_utils_tests.cm
@@ -46,9 +44,7 @@
4644
- test_command: test run fuchsia-pkg://fuchsia.com/display_list_tests#meta/display_list_tests.cm
4745
package: display_list_tests-0.far
4846
- test_command: test run fuchsia-pkg://fuchsia.com/embedder_a11y_unittests#meta/embedder_a11y_unittests.cm
49-
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
5047
package: embedder_a11y_unittests-0.far
51-
variant: disabled
5248
- test_command: test run fuchsia-pkg://fuchsia.com/embedder_proctable_unittests#meta/embedder_proctable_unittests.cm
5349
package: embedder_proctable_unittests-0.far
5450
- test_command: test run fuchsia-pkg://fuchsia.com/embedder_tests#meta/embedder_tests.cm
@@ -77,9 +73,7 @@
7773
- oot_flutter_jit_runner-0.far
7874
- gen/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/mouse-input-view/mouse-input-view.far
7975
- test_command: test run fuchsia-pkg://fuchsia.com/no_dart_plugin_registrant_unittests#meta/no_dart_plugin_registrant_unittests.cm
80-
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
8176
package: no_dart_plugin_registrant_unittests-0.far
82-
variant: disabled
8377
- test_command: test run fuchsia-pkg://fuchsia.com/runtime_tests#meta/runtime_tests.cm
8478
package: runtime_tests-0.far
8579
disabled: on debug_arm64 because of the slowness
@@ -96,7 +90,7 @@
9690
- gen/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/text-input-view/text-input-view.far
9791
variant: debug_x64
9892
- test_command: test run fuchsia-pkg://fuchsia.com/tonic_unittests#meta/tonic_unittests.cm
99-
disabled: Error while initializing the Dart VM, Precompiled runtime requires a precompiled snapshot
93+
disabled: Dart_LoadELF isn't implemented on Fuchsia
10094
package: tonic_unittests-0.far
10195
variant: disabled
10296
- test_command: test run fuchsia-pkg://fuchsia.com/touch-input-test#meta/touch-input-test.cm

0 commit comments

Comments
 (0)