Index: tests/lib/async/future_test.dart |
diff --git a/tests/lib/async/future_test.dart b/tests/lib/async/future_test.dart |
index 078ee4aa80e3118ba478436530fd6a5bc6f414ff..7af689398d8ede777fbf74903ebc163b008d868a 100644 |
--- a/tests/lib/async/future_test.dart |
+++ b/tests/lib/async/future_test.dart |
@@ -76,15 +76,17 @@ testCompleteWithSuccessHandlerBeforeComplete() { |
final completer = new Completer<int>(); |
final future = completer.future; |
- int value; |
- future.then((int v) { value = v; }); |
- Expect.isNull(value); |
+ int after; |
- Expect.isFalse(completer.isCompleted); |
- completer.complete(3); |
- Expect.isTrue(completer.isCompleted); |
+ var port = new ReceivePort(); |
+ future.then((int v) { after = v; }) |
+ .then((_) { |
+ Expect.equals(3, after); |
+ port.close(); |
+ }); |
- Expect.equals(3, value); |
+ completer.complete(3); |
+ Expect.isNull(after); |
} |
testCompleteWithSuccessHandlerAfterComplete() { |