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

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

Issue 23522012: Replace ReceivePorts with asyncStart|End in some tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove bad comment. Created 7 years, 3 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/lib/async/future_test.dart ('k') | tests/lib/async/intercept_run_async3_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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 futures_test; 5 library futures_test;
6 import 'package:async_helper/async_helper.dart';
6 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
7 import 'dart:async'; 8 import 'dart:async';
8 import 'dart:isolate';
9 9
10 Future testWaitEmpty() { 10 Future testWaitEmpty() {
11 List<Future> futures = new List<Future>(); 11 List<Future> futures = new List<Future>();
12 return Future.wait(futures); 12 return Future.wait(futures);
13 } 13 }
14 14
15 Future testCompleteAfterWait() { 15 Future testCompleteAfterWait() {
16 List<Future> futures = new List<Future>(); 16 List<Future> futures = new List<Future>();
17 Completer<Object> c = new Completer<Object>(); 17 Completer<Object> c = new Completer<Object>();
18 futures.add(c.future); 18 futures.add(c.future);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 futures.add(testWaitEmpty()); 107 futures.add(testWaitEmpty());
108 futures.add(testCompleteAfterWait()); 108 futures.add(testCompleteAfterWait());
109 futures.add(testCompleteBeforeWait()); 109 futures.add(testCompleteBeforeWait());
110 futures.add(testWaitWithMultipleValues()); 110 futures.add(testWaitWithMultipleValues());
111 futures.add(testWaitWithSingleError()); 111 futures.add(testWaitWithSingleError());
112 futures.add(testWaitWithMultipleErrors()); 112 futures.add(testWaitWithMultipleErrors());
113 futures.add(testForEachEmpty()); 113 futures.add(testForEachEmpty());
114 futures.add(testForEach()); 114 futures.add(testForEach());
115 futures.add(testForEachWithException()); 115 futures.add(testForEachWithException());
116 116
117 // Use a receive port for blocking the test. 117 asyncStart();
118 // Note that if the test fails, the program will not end.
119 ReceivePort port = new ReceivePort();
120 Future.wait(futures).then((List list) { 118 Future.wait(futures).then((List list) {
121 Expect.equals(9, list.length); 119 Expect.equals(9, list.length);
122 port.close(); 120 asyncEnd();
123 }); 121 });
124 } 122 }
OLDNEW
« no previous file with comments | « tests/lib/async/future_test.dart ('k') | tests/lib/async/intercept_run_async3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698