Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Nov 10, 2016

Conversation

jason-simmons
Copy link
Member

Fixes #6690

Also add a version of the Gallery smoke test that enables semantics

@jason-simmons
Copy link
Member Author

@Hixie


void main() {
testWidgets('Enable semantics', (WidgetTester tester) async {
RendererBinding.instance.setSemanticsEnabled(true);
Copy link
Contributor

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).

Copy link
Member Author

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) {
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Hixie
Copy link
Contributor

Hixie commented Nov 9, 2016

LGTM

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());
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extraneous braces

@Hixie
Copy link
Contributor

Hixie commented Nov 10, 2016

still LGTM

…ssigned a new parent

Fixes flutter#6690

Also add a version of the Gallery smoke test that enables semantics
@jason-simmons jason-simmons merged commit ca5e1f3 into flutter:master Nov 10, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flash of red exception on App Bar when returning to home screen in Gallery
2 participants