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

Side by Side Diff: tests/lib/async/future_test.dart

Issue 91213002: Add Future.timeout. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update indentation. Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/future_impl.dart ('k') | tests/lib/async/future_timeout_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library future_test; 5 library future_test;
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 801
802 /// A Future that isn't recognizable as a _Future. 802 /// A Future that isn't recognizable as a _Future.
803 class CustomFuture<T> implements Future<T> { 803 class CustomFuture<T> implements Future<T> {
804 Future _realFuture; 804 Future _realFuture;
805 CustomFuture(this._realFuture); 805 CustomFuture(this._realFuture);
806 Future then(action(result), {Function onError}) => 806 Future then(action(result), {Function onError}) =>
807 _realFuture.then(action, onError: onError); 807 _realFuture.then(action, onError: onError);
808 Future catchError(Function onError, {bool test(e)}) => 808 Future catchError(Function onError, {bool test(e)}) =>
809 _realFuture.catchError(onError, test: test); 809 _realFuture.catchError(onError, test: test);
810 Future whenComplete(action()) => _realFuture.whenComplete(action); 810 Future whenComplete(action()) => _realFuture.whenComplete(action);
811 Future timeout(Duration timeLimit, [void onTimeout()]) =>
812 _realFuture.timeout(timeLimit, onTimeout);
811 Stream asStream() => _realFuture.asStream(); 813 Stream asStream() => _realFuture.asStream();
812 String toString() => "CustomFuture@${_realFuture.hashCode}"; 814 String toString() => "CustomFuture@${_realFuture.hashCode}";
813 int get hashCode => _realFuture.hashCode; 815 int get hashCode => _realFuture.hashCode;
814 } 816 }
OLDNEW
« no previous file with comments | « sdk/lib/async/future_impl.dart ('k') | tests/lib/async/future_timeout_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698