Add await to flutter_test callsites#182983
Add await to flutter_test callsites#182983victorsanni wants to merge 3 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request addresses unawaited futures across various test files and some library code. The changes primarily involve adding the await keyword to asynchronous calls that were previously not awaited, such as gesture.removePointer(), gesture.up(), and goldenFileComparator.update(). In test files where not awaiting a future is intentional for the test's logic, an // ignore: unawaited_futures comment has been added to satisfy lint rules. These changes improve the correctness and robustness of the codebase by ensuring asynchronous operations are properly handled.
| // Test hover for tooltip. | ||
| final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); | ||
| await gesture.addPointer(); | ||
| addTearDown(() => gesture.removePointer()); |
There was a problem hiding this comment.
There are a lot of instances of
addTearDown(gesture.removePointer);in the codebase, should we refactor them all to async/await?
| SystemMouseCursors.grabbing, | ||
| ); | ||
| gesture.up(); | ||
| await gesture.up(); |
There was a problem hiding this comment.
There are some instances of
addTearDown(gesture.up);in the codebase, should we refactor them all to async/await?
Part of #181513