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

Side by Side Diff: tests/corelib/src/FuturesTest.dart

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 9 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/co19/co19-runtime.status ('k') | tests/corelib/src/PortTest.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("FuturesTest");
6 #import("dart:isolate");
7
5 Future testWaitEmpty() { 8 Future testWaitEmpty() {
6 List<Future> futures = new List<Future>(); 9 List<Future> futures = new List<Future>();
7 return Futures.wait(futures); 10 return Futures.wait(futures);
8 } 11 }
9 12
10 Future testCompleteAfterWait() { 13 Future testCompleteAfterWait() {
11 List<Future> futures = new List<Future>(); 14 List<Future> futures = new List<Future>();
12 Completer<Object> c = new Completer<Object>(); 15 Completer<Object> c = new Completer<Object>();
13 futures.add(c.future); 16 futures.add(c.future);
14 Future future = Futures.wait(futures); 17 Future future = Futures.wait(futures);
(...skipping 17 matching lines...) Expand all
32 futures.add(testCompleteBeforeWait()); 35 futures.add(testCompleteBeforeWait());
33 36
34 // Use a receive port for blocking the test. 37 // Use a receive port for blocking the test.
35 // Note that if the test fails, the program will not end. 38 // Note that if the test fails, the program will not end.
36 ReceivePort port = new ReceivePort(); 39 ReceivePort port = new ReceivePort();
37 Futures.wait(futures).then((List list) { 40 Futures.wait(futures).then((List list) {
38 Expect.equals(3, list.length); 41 Expect.equals(3, list.length);
39 port.close(); 42 port.close();
40 }); 43 });
41 } 44 }
OLDNEW
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | tests/corelib/src/PortTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698