@@ -21,7 +21,10 @@ namespace testing {
2121
2222using Embedder11yTest = testing::EmbedderTest;
2323
24- TEST_F (Embedder11yTest, A11yTreeIsConsistent) {
24+ // TODO: This test has been disabled as it is flaky (more reproducible in
25+ // profile more). Multiple calls to a11y changed handler in Dart code is
26+ // suspected. https://github.com/flutter/flutter/issues/35218
27+ TEST_F (Embedder11yTest, DISABLED_A11yTreeIsConsistent) {
2528 auto & context = GetEmbedderContext ();
2629
2730 fml::AutoResetWaitableEvent latch;
@@ -51,7 +54,8 @@ TEST_F(Embedder11yTest, A11yTreeIsConsistent) {
5154 // Wait for initial NotifySemanticsEnabled(false).
5255 callback = [&](Dart_NativeArguments args) {
5356 bool enabled = true ;
54- Dart_GetNativeBooleanArgument (args, 0 , &enabled);
57+ auto handle = Dart_GetNativeBooleanArgument (args, 0 , &enabled);
58+ ASSERT_FALSE (Dart_IsError (handle));
5559 ASSERT_FALSE (enabled);
5660 latch.Signal ();
5761 };
@@ -60,7 +64,8 @@ TEST_F(Embedder11yTest, A11yTreeIsConsistent) {
6064 // Enable semantics. Wait for NotifySemanticsEnabled(true).
6165 callback = [&](Dart_NativeArguments args) {
6266 bool enabled = false ;
63- Dart_GetNativeBooleanArgument (args, 0 , &enabled);
67+ auto handle = Dart_GetNativeBooleanArgument (args, 0 , &enabled);
68+ ASSERT_FALSE (Dart_IsError (handle));
6469 ASSERT_TRUE (enabled);
6570 latch.Signal ();
6671 };
@@ -71,7 +76,8 @@ TEST_F(Embedder11yTest, A11yTreeIsConsistent) {
7176 // Wait for initial accessibility features (reduce_motion == false)
7277 callback = [&](Dart_NativeArguments args) {
7378 bool enabled = true ;
74- Dart_GetNativeBooleanArgument (args, 0 , &enabled);
79+ auto handle = Dart_GetNativeBooleanArgument (args, 0 , &enabled);
80+ ASSERT_FALSE (Dart_IsError (handle));
7581 ASSERT_FALSE (enabled);
7682 latch.Signal ();
7783 };
@@ -80,7 +86,8 @@ TEST_F(Embedder11yTest, A11yTreeIsConsistent) {
8086 // Set accessibility features: (reduce_motion == true)
8187 callback = [&](Dart_NativeArguments args) {
8288 bool enabled = false ;
83- Dart_GetNativeBooleanArgument (args, 0 , &enabled);
89+ auto handle = Dart_GetNativeBooleanArgument (args, 0 , &enabled);
90+ ASSERT_FALSE (Dart_IsError (handle));
8491 ASSERT_TRUE (enabled);
8592 latch.Signal ();
8693 };
@@ -136,7 +143,8 @@ TEST_F(Embedder11yTest, A11yTreeIsConsistent) {
136143 ASSERT_EQ (42 , node_id);
137144
138145 int64_t action_id;
139- Dart_GetNativeIntegerArgument (args, 1 , &action_id);
146+ auto handle = Dart_GetNativeIntegerArgument (args, 1 , &action_id);
147+ ASSERT_FALSE (Dart_IsError (handle));
140148 ASSERT_EQ (static_cast <int32_t >(flutter::SemanticsAction::kTap ), action_id);
141149
142150 Dart_Handle semantic_args = Dart_GetNativeArgument (args, 2 );
0 commit comments