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

Unified Diff: tests/lib/async/future_test.dart

Issue 12224081: Change Future.delayed to take a Duration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments and made argument optional. Created 7 years, 10 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
« no previous file with comments | « sdk/lib/core/duration.dart ('k') | tests/lib/async/slow_consumer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/future_test.dart
diff --git a/tests/lib/async/future_test.dart b/tests/lib/async/future_test.dart
index 5458e8380c61edc004be148bde7fa164899d09ed..43f083a2a4f7fe17f14190ab7a429c3abbb3679d 100644
--- a/tests/lib/async/future_test.dart
+++ b/tests/lib/async/future_test.dart
@@ -564,7 +564,8 @@ testChainedFutureValueDelay() {
final future = completer.future;
var port = new ReceivePort();
- future.then((v) => new Future.delayed(10, () => v * 2))
+ future.then((v) => new Future.delayed(const Duration(milliseconds: 10),
+ () => v * 2))
.then((v) {
Expect.equals(42, v);
port.close();
@@ -572,6 +573,15 @@ testChainedFutureValueDelay() {
completer.complete(21);
}
+testChainedFutureValue2Delay() {
+ var port = new ReceivePort();
+
+ new Future.delayed(const Duration(milliseconds: 10))
+ .then((v) {
+ Expect.isNull(v);
+ port.close();
+ });
+}
testChainedFutureError() {
final completer = new Completer();
final future = completer.future;
« no previous file with comments | « sdk/lib/core/duration.dart ('k') | tests/lib/async/slow_consumer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698