Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: pkg/scheduled_test/test/value_future_test.dart

Issue 14690009: Make Completers asynchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/scheduled_test/test/value_future_test.dart
diff --git a/pkg/scheduled_test/test/value_future_test.dart b/pkg/scheduled_test/test/value_future_test.dart
index 61ab436284612c5f0c5115b93dfce24a9e40c04a..3cf0fb9179bcca5f7c4ee1c6ff9b7dc20a2fd724 100644
--- a/pkg/scheduled_test/test/value_future_test.dart
+++ b/pkg/scheduled_test/test/value_future_test.dart
@@ -98,30 +98,39 @@ void main() {
});
test('.value is the result of the future', () {
- expect(future.value, equals(12));
+ future.then(expectAsync1((_) {
+ expect(future.value, equals(12));
+ }));
nweiz 2013/05/07 00:11:52 These can be expect(future.then((_) => future
floitsch 2013/05/13 11:19:25 done in CL 15128002.
});
test('.hasValue is true', () {
- expect(future.hasValue, isTrue);
+ future.then(expectAsync1((_) {
+ expect(future.hasValue, isTrue);
+ }));
});
});
group('after an error completion', () {
var future;
+ var safeFuture;
setUp(() {
var completer = new Completer();
future = new ValueFuture(completer.future);
- future.catchError((e) {});
+ safeFuture = future.catchError((e) {});
completer.completeError('bad');
});
test('.value is null', () {
- expect(future.value, isNull);
+ safeFuture.then(expectAsync1((_) {
+ expect(future.value, isNull);
+ }));
});
test('.hasValue is false', () {
- expect(future.hasValue, isFalse);
+ safeFuture.then(expectAsync1((_) {
+ expect(future.hasValue, isFalse);
+ }));
});
});
}

Powered by Google App Engine
This is Rietveld 408576698