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

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

Issue 11866003: Support Timer with 0 millisecond delay in dart2js running in the command line. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/language_dart2js.status ('k') | tests/lib/lib.status » ('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 'dart:async'; 7 import 'dart:async';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 testImmediate() { 10 testImmediate() {
11 final future = new Future<String>.immediate("42"); 11 final future = new Future<String>.immediate("42");
12 var port = new ReceivePort(); 12 var port = new ReceivePort();
13 future.then((x) { 13 future.then((x) {
14 Expect.equals("42", x); 14 Expect.equals("42", x);
15 port.close(); 15 port.close();
16 }); 16 });
17 } 17 }
18 18
19 testNeverComplete() { 19 testNeverComplete() {
20 final completer = new Completer<int>(); 20 final completer = new Completer<int>();
21 final future = completer.future; 21 final future = completer.future;
22 future.then((v) => Except.fails("Value not expected")); 22 future.then((v) => Expect.fails("Value not expected"));
23 future.catchError((e) => Except.fails("Value not expected")); 23 future.catchError((e) => Expect.fails("Value not expected"));
24 } 24 }
25 25
26 testComplete() { 26 testComplete() {
27 final completer = new Completer<int>(); 27 final completer = new Completer<int>();
28 final future = completer.future; 28 final future = completer.future;
29 29
30 completer.complete(3); 30 completer.complete(3);
31 31
32 future.then((v) => Expect.equals(3, v)); 32 future.then((v) => Expect.equals(3, v));
33 } 33 }
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 testFutureWhenErrorFutureValue(); 549 testFutureWhenErrorFutureValue();
550 testFutureWhenValueFutureError(); 550 testFutureWhenValueFutureError();
551 testFutureWhenErrorFutureError(); 551 testFutureWhenErrorFutureError();
552 552
553 testFutureThenThrowsAsync(); 553 testFutureThenThrowsAsync();
554 testFutureCatchThrowsAsync(); 554 testFutureCatchThrowsAsync();
555 testFutureWhenThrowsAsync(); 555 testFutureWhenThrowsAsync();
556 testFutureCatchRethrowsAsync(); 556 testFutureCatchRethrowsAsync();
557 } 557 }
558 558
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698