From c24e8b7943ab8dbe2ac85ec19270cb742e8177bd Mon Sep 17 00:00:00 2001 From: Paul Blasi Date: Wed, 26 Oct 2022 12:12:56 -0600 Subject: [PATCH] Adds direction to SemanticsFlag that ensures `flutter_test` is up to date with the latest flags As part of #107866, more functionality for testing semantics was added. Part of this was `simulatedAccessibilityTraversal`, which is dependent on knowing what flags are important for accessibility. The comments noting what need to be updated when SemanticsFlags are changed now include the relevent field to update for tests to remain accurate as well. --- lib/ui/semantics.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index e18aff4d63f62..9bf8d2be76d8c 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -285,7 +285,9 @@ class SemanticsAction { // // When changes are made to this class, the equivalent APIs in // `lib/ui/semantics/semantics_node.h` and in each of the embedders *must* be -// updated. +// updated. If the change affects the visibility of a [SemanticsNode] to +// accessibility services, `flutter_test/controller.dart#SemanticsController._importantFlags` +// must be updated as well. class SemanticsFlag { const SemanticsFlag._(this.index) : assert(index != null); @@ -324,7 +326,10 @@ class SemanticsFlag { // value in testing/dart/semantics_test.dart, or tests will fail. Also, // please update the Flag enum in // flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java, - // and the SemanticsFlag class in lib/web_ui/lib/semantics.dart. + // and the SemanticsFlag class in lib/web_ui/lib/semantics.dart. If the new flag + // affects the visibility of a [SemanticsNode] to accessibility services, + // `flutter_test/controller.dart#SemanticsController._importantFlags` + // must be updated as well. /// The semantics node has the quality of either being "checked" or "unchecked". ///