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

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

Issue 3012433002: Fix lib_2/async/future_test.dart multitest. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | 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 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 testType(name, future.whenComplete(() {}), depth - 1); 988 testType(name, future.whenComplete(() {}), depth - 1);
989 } 989 }
990 } 990 }
991 991
992 for (var value in [42, null]) { 992 for (var value in [42, null]) {
993 testType("Future($value)", new Future<int>(() => value)); 993 testType("Future($value)", new Future<int>(() => value));
994 testType("Future.delayed($value)", 994 testType("Future.delayed($value)",
995 new Future<int>.delayed(Duration.ZERO, () => value)); 995 new Future<int>.delayed(Duration.ZERO, () => value));
996 testType( 996 testType(
997 "Future.microtask($value)", new Future<int>.microtask(() => value)); 997 "Future.microtask($value)", new Future<int>.microtask(() => value));
998 testType( 998 testType( //# 01: ok
999 "Future.sync($value)", new Future<int>.sync(() => value)); // #01: ok 999 "Future.sync($value)", new Future<int>.sync(() => value)); //# 01: conti nued
1000 testType( //# 01: continued 1000 testType( //# 01: continued
1001 "Future.sync(future($value))", //# 01: continued 1001 "Future.sync(future($value))", //# 01: continued
1002 new Future<int>.sync(//# 01: continued 1002 new Future<int>.sync(//# 01: continued
1003 () => new Future<int>.value(value))); //# 01: continued 1003 () => new Future<int>.value(value))); //# 01: continued
1004 testType("Future.value($value)", new Future<int>.value(value)); 1004 testType("Future.value($value)", new Future<int>.value(value));
1005 } 1005 }
1006 testType("Completer.future", new Completer<int>().future); 1006 testType("Completer.future", new Completer<int>().future);
1007 testType("Future.error", new Future<int>.error("ERR")..catchError((_) {})); 1007 testType("Future.error", new Future<int>.error("ERR")..catchError((_) {}));
1008 } 1008 }
1009 1009
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 return (new StreamController() 1235 return (new StreamController()
1236 ..add(_result) 1236 ..add(_result)
1237 ..close()) 1237 ..close())
1238 .stream; 1238 .stream;
1239 } 1239 }
1240 1240
1241 Future timeout(Duration duration, {onTimeout()}) { 1241 Future timeout(Duration duration, {onTimeout()}) {
1242 return this; 1242 return this;
1243 } 1243 }
1244 } 1244 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698