Skip to content
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

Enable generics for waitFor and require Dart 1.21+ in the pubspec SDK range #131

Merged
merged 1 commit into from
Jan 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/support/async.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const defaultTimeout = const Duration(seconds: 5);

const clock = const Clock();

Future/*<T>*/ waitFor/*<T>*/(/*=T*/ condition(),
Future<T> waitFor<T>(T condition(),
{matcher: null,
Duration timeout: defaultTimeout,
Duration interval: defaultInterval}) =>
clock.waitFor/*<T>*/(condition,
clock.waitFor<T>(condition,
matcher: matcher, timeout: timeout, interval: interval);

class Clock {
Expand All @@ -50,7 +50,7 @@ class Clock {
/// is returned. Otherwise, if [condition] throws, then that exception is
/// rethrown. If [condition] doesn't throw then an [expect] exception is
/// thrown.
Future/*<T>*/ waitFor/*<T>*/(/*=T*/ condition(),
Future<T> waitFor<T>(T condition(),
{matcher: null,
Duration timeout: defaultTimeout,
Duration interval: defaultInterval}) async {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
and as such, require the use of the WebDriver remote server.
homepage: https://github.com/google/webdriver.dart
environment:
sdk: '>=1.10.0 <2.0.0'
sdk: '>=1.21.0 <2.0.0'
dependencies:
archive: '^1.0.20'
matcher: '^0.12.0+1'
Expand Down