-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: API breakBackwards-incompatible API changesBackwards-incompatible API changescustomer: espressoframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.t: flutter driver"flutter driver", flutter_drive, or a driver test"flutter driver", flutter_drive, or a driver test
Description
Use case
Espresso/EarlGrey takes care of synchronization within the testing framework, so that test authors do not have to explicitly wait/sleep in their tests. We are working on providing similar synchronization support for Flutter.
Espresso/EarlGrey currently use Driver extension API to talk into Flutter, and it currently exposes one wait API:
- waitUntilNoTransientCallbacks, that wait for no transient callbacks on SchedulerBinding.
And we'd like to expose more waiting conditions on the extension APIs. Not an exhaustive list but some of them are:
- Be able to wait for no pending frames scheduled in SchedulerBinding;
- Be able to wait for no pending async platform messages.
This list will grow as we understand more on the synchronization conditions that we shall wait on.
Proposal
Thanks to @Hixie @tvolkert @goderbauer 's guidance & suggestions (some of them are commented in this PR), this is the final proposal we arrived at:
- A wait API that can support composable wait conditions; Users of this API will be able to specify the conditions that they care about.
- For support for platform messages, limit the scope to testing only by creating a ServicesBinding that is used under testing env and provides a BinaryMessenger that can be used to track platform channel/messages.
Metadata
Metadata
Assignees
Labels
c: API breakBackwards-incompatible API changesBackwards-incompatible API changescustomer: espressoframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.t: flutter driver"flutter driver", flutter_drive, or a driver test"flutter driver", flutter_drive, or a driver test