-
Notifications
You must be signed in to change notification settings - Fork 28.8k
In the semantics tree, do not detach a child if it has already been assigned a new parent #6773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
void main() { | ||
testWidgets('Enable semantics', (WidgetTester tester) async { | ||
RendererBinding.instance.setSemanticsEnabled(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in theory nothing guarantees the order the tests run in and they shouldn't depend on each other.
I think the right way to factor this out would be to have the inside of the "Flutter Gallery app smoke test" in its own function, and then have the two tests both call that function. The semantics one should enable the semantics before and disable them after. I think it'd be fine for these two tests to be in the same file (otherwise it's a bit weird because one test imports the other).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
for (SemanticsNode child in _children) | ||
child.detach(); | ||
for (SemanticsNode child in _children) { | ||
if (child.parent == this) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment saying why this might not be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
a2424ac
to
270c578
Compare
flutter_gallery_main | ||
.main(); // builds the app and schedules a frame but doesn't trigger one | ||
Future<Null> runSmokeTest(WidgetTester tester) async { | ||
await tester.pumpWidget(new GalleryApp()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is indented 4 instead of 2
for (SemanticsNode child in _children) { | ||
// The list of children may be stale and may contain nodes that have | ||
// been assigned to a different parent. | ||
if (child.parent == this) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extraneous braces
…ssigned a new parent Fixes flutter#6690 Also add a version of the Gallery smoke test that enables semantics
270c578
to
339b320
Compare
Fixes #6690
Also add a version of the Gallery smoke test that enables semantics